Departments
Overview
Departments endpoints manage department resources for the authenticated tenant.
Endpoint Summary
| Method | Route | Purpose |
|---|---|---|
GET | /v1/data/departments | List departments |
POST | /v1/data/departments | Create 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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | application/json |
Accept | Yes | application/json |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Department name. |
parent_id | string | No | Parent 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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | application/json |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
departmentId | string | Yes | Department UUID. |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Department name. |
parent_id | string | No | Parent 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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
departmentId | string | Yes | Department 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": []
}