PATCH
/api/public/v1/departments/{departmentId}

Update a department

Rename a department.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

company-structure:write

Path Parameters

NameTypeRequiredDescription
departmentIdstringRequiredDepartment ID.

Request Body

PropertyTypeDescription
namestringNew department name.
PATCHExample request
curl
curl -X PATCH "https://www.pxb.app/api/public/v1/departments/{departmentId}" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "R&D"
  }'
200Example response
json
{
  "message": "Department updated successfully!",
  "content": {
    "department": {
      "id": "dept_1"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Employees → Directory → Company chart
/employee/directory?view=chart
  1. Open Manage company structure.
  2. Edit a department.