Skip to main content

Departments

Overview

Departments endpoints manage department resources for the authenticated tenant.

Endpoint Summary

MethodRoutePurpose
GET/v1/data/departmentsList departments
POST/v1/data/departmentsCreate department
PUT/v1/data/departments/{departmentId}Update department
DELETE/v1/data/departments/{departmentId}Delete department

GET /v1/data/departments

Return departments available in the authenticated context.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Example Request

curl -X GET "{{BASE_URL}}/v1/data/departments" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": [
{
"id": "3b499f65-bdc5-4fd3-a492-5e4c6d3d4bd1",
"parent_id": null,
"name": "Human Resources"
},
{
"id": "0de546f7-2fe7-4f89-b91d-af225f4a627c",
"parent_id": "3b499f65-bdc5-4fd3-a492-5e4c6d3d4bd1",
"name": "Mobility"
}
]
}

POST /v1/data/departments

Create a department.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
namestringYesDepartment name.
parent_idstringNoParent department UUID (or null).

Example Request

curl -X POST "{{BASE_URL}}/v1/data/departments" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Human Resources",
"parent_id": null
}'

Success Response (200)

{
"success": true,
"result": {
"id": "3b499f65-bdc5-4fd3-a492-5e4c6d3d4bd1",
"parent_id": null,
"name": "Human Resources"
}
}

PUT /v1/data/departments/{departmentId}

Update a department.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
departmentIdstringYesDepartment UUID.

Request Body Fields

FieldTypeRequiredDescription
namestringYesDepartment name.
parent_idstringNoParent department UUID (or null).

Example Request

curl -X PUT "{{BASE_URL}}/v1/data/departments/{{DEPARTMENT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "People Operations",
"parent_id": null
}'

Success Response (200)

{
"success": true,
"result": {
"id": "3b499f65-bdc5-4fd3-a492-5e4c6d3d4bd1",
"parent_id": null,
"name": "People Operations"
}
}

DELETE /v1/data/departments/{departmentId}

Delete a department.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
departmentIdstringYesDepartment UUID.

Example Request

curl -X DELETE "{{BASE_URL}}/v1/data/departments/{{DEPARTMENT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (204)

{
"success": true,
"result": []
}