Skip to main content

Update a user

Update a user. PATCH /api/openapi/v1/users/{userId}, scope admin.v1.user-directory.manage.

  • Scope: admin.v1.user-directory.manage
  • Permission: Manage users and departments (user-directory)
  • Permission type: Manage
  • Endpoint: PATCH/api/openapi/v1/users/{userId}

Trusted email domain validation

A non-empty email must exactly match a currently verified, non-deleted domain in the organization. With no trusted domains, the request fails with 422 directory_user_email_domain_not_verified. Wildcards and parent-domain inheritance are not supported. Validation uses the complete profile after applying the patch. Omitting email preserves its current value, so changing only the name or departments can still fail. To clear email, explicitly send "email": "" and retain at least one other valid identity. This tightens the previous behavior for organizations without trusted domains. Before upgrading, callers must configure and verify a matching domain or remove email as described above. Independent account enablement, seat assignment, and existing sign-in sessions retain their previous rules.

Authentication and request headers

Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
NameLocationTypeRequiredDescriptionExample
AuthorizationheaderstringYesApplication API key, passed as a Bearer token.Bearer qwk_***
X-Request-IdheaderstringNoOptional request tracing identifier; generated by the server if omitted.req-20260831-001

Request parameters

NameLocationTypeRequiredDescriptionExample
userIdpathstring · uuidRequiredUser ID"<uuid>"
Idempotency-KeyheaderstringNoIdempotency key used to prevent duplicate submissions"<string>"
accountbodystringNoAccount"<string>"
department_idsbodyarray | nullNo-["<string>"]
emailbodystringNoEmail"<string>"
job_numberbodystringNoEmployee ID"<string>"
namebodystringNoName"<string>"
phonebodystringNoPhone number"<string>"

Request example

cURL

Responses

200 OK
NameTypeRequiredDescriptionExample
accountstringNoAccount"<string>"
department_idsarray | nullYesDepartments (department IDs)["<string>"]
emailstringNoEmail"<string>"
job_numberstringNoEmployee ID"<string>"
namestringYesName"<string>"
phonestringNoPhone number"<string>"
qidstring · uuidYesQID"<uuid>"
seat_statusstringYesSeat assignment"assigned"
sourcestringYesSource"manual"
statusstringYesUser status"pending"
updated_atstring · date-timeYesUpdated at"2026-08-27T10:00:00Z"
third_party_user_idstringYesExternal user ID; an empty string when unset."external-001"
departmentsarrayYesDepartment details; an empty array when no departments are assigned.[{"id":"22222222-2222-4222-8222-222222222222","name":"Engineering","path":"Company/Engineering","external_id":"external-dept","is_primary":true}]
credentialobjectYesPassword lifecycle metadata; contains no password or hash.{"password_state":"active","must_change_password":false,"credential_version":2}
created_atstring · date-timeYesUser creation time."2026-09-19T01:00:00Z"
last_active_atstring · date-timeNoLatest IAM activity time; omitted when unavailable. This is not the latest business activity time."2026-09-23T01:00:00Z"
departments[].idstring · uuidYesDepartment ID.-
departments[].namestringYesDepartment name.-
departments[].pathstringYesDepartment path.-
departments[].external_idstringNoExternal department ID; omitted when unset.-
departments[].is_primarybooleanYesWhether this is the primary department.-
credential.password_statestringYesPassword state: unset (not set), initial (initial password), or active (active password).-
credential.must_change_passwordbooleanYesWhether a password change is required.-
credential.credential_versionintegerYesCredential version.-
credential.password_updated_atstring · date-timeNoPassword update time; omitted when unavailable.-
credential.first_login_completed_atstring · date-timeNoFirst completed sign-in time; omitted before completion.-
Response example
default Flat business error
NameTypeRequiredDescriptionExample
codestringNoStable business error code"<string>"
detailstringYesHuman-readable error description"<string>"
detailsOpenapiErrorDetailsNoError details{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstringNoRequest field that failed validation"<string>"
details.reasonstringNoStable validation failure reason"<string>"
details.suggestionstringNoSuggested normalized value"<string>"
errorstringYesStable HTTP error type"<string>"
Response example