Update a realm user
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/users/9f3f2e5c-9e3d-4b1d-9f53-2a8af5a5d9a1';
const options = {
method: 'PATCH',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"first_name":"Jane","last_name":"Doe","enabled":true,"email_verified":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}curl --request PATCH \
--url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/users/9f3f2e5c-9e3d-4b1d-9f53-2a8af5a5d9a1 \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "first_name": "Jane", "last_name": "Doe", "enabled": true, "email_verified": true }'Partially updates a realm user.
Required scope: realm-users:write
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
Example
customer-portalExample
9f3f2e5c-9e3d-4b1d-9f53-2a8af5a5d9a1Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Patch request for updating a realm user. At least one field should be provided.
object
Example
jane@example.comExample
JaneExample
DoeWhether the user can sign in.
Example
trueWhether the email address has been verified.
Example
trueExample
{
"first_name": "Jane",
"last_name": "Doe",
"enabled": true,
"email_verified": true
}Responses
Section titled “Responses”The request has succeeded.
Public representation of a realm user.
object
Whether the user can sign in.
Whether the email address has been verified.
Organization associated with the user, when available.
Most recent successful sign-in time, when available.
Time when the user was created, when available.
Example
{
"id": "9f3f2e5c-9e3d-4b1d-9f53-2a8af5a5d9a1",
"username": "john.doe",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"enabled": true,
"email_verified": true,
"organization": "Acme Corp"
}Access is unauthorized.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Access is forbidden.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}The server cannot find the requested resource.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}The request conflicts with the current state of the server.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Client error
object
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"errors": [
{
"field": "example",
"detail": "example",
"code": "example",
"value": "example"
}
]
}Client error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Headers
Section titled “Headers”Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}