Skip to main content

Update a department

Update a department. PATCH /api/openapi/v1/departments/{departmentId}, 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/departments/{departmentId}

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
departmentIdpathstring · uuidRequiredDepartment ID"<uuid>"
Idempotency-KeyheaderstringRequiredIdempotency key used to prevent duplicate submissions"<string>"
external_idbodystringNoExternal department ID"<string>"
namebodystringNoDepartment name"<string>"
parent_idbodystring · uuidNoParent department (department ID)"<uuid>"

Request example

cURL

Responses

200 OK
NameTypeRequiredDescriptionExample
department_idstring · uuidYesDepartment ID"<uuid>"
external_idstringNoExternal department ID"<string>"
namestringYesDepartment name"<string>"
orderinteger · int64YesSort order0
parent_idstring | nullYesParent department (department ID)"<string>"
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