Create Department
POST /clients/{client_id}/departments
Creates a new department within a client organization.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
client_id | string (uuid) | Unique identifier for the client organization |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Department display name. Must be unique within the client. |
description | string | No | Optional department description. |
Response
Returns the created Department object with status 201 Created.
Example Requests
Create with name and description
curl -X POST "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Engineering",
"description": "Software development and infrastructure teams"
}'
Create with name only
curl -X POST "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales"
}'
Example Response
{
"id": "d1a2b3c4-e5f6-7890-abcd-ef1234567890",
"name": "Engineering",
"description": "Software development and infrastructure teams",
"member_count": 0,
"created_at": "2026-02-24T10:00:00.000Z",
"updated_at": "2026-02-24T10:00:00.000Z"
}
member_count is 0 on a newly created department.
Error Responses
| Status | Description |
|---|---|
| 400 | Invalid request body (e.g. missing or empty name) |
| 401 | Authentication required |
| 403 | Insufficient permissions for this client |
| 404 | Client not found |
| 409 | A department with this name already exists in this client |
| 500 | Server error |
400 -- missing name
{
"error": {
"code": "invalid_request",
"message": "Department name is required",
"details": {
"field": "name"
}
}
}
409 -- name conflict
{
"error": {
"code": "conflict",
"message": "A department with this name already exists",
"details": {
"name": "Engineering"
}
}
}
Related Endpoints
- List Departments - Browse all departments
- Get Department - View a department by ID
- Update Department - Edit name or description
- Delete Department - Remove a department