Skip to main content
POST
/
api
/
departments
Create a new department
curl --request POST \
  --url https://your-instance.example.com/api/departments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Sales",
  "description": "Inbound + outbound sales reps",
  "managerIds": [
    "65b1f0a2c3d4e5f6a7b8c9e0"
  ],
  "userIds": [
    "65b1f0a2c3d4e5f6a7b8c9d0",
    "65b1f0a2c3d4e5f6a7b8c9d1"
  ]
}
'
{
  "department": {
    "_id": "65c1a0b0c0d0e0f0a0b0c0d1",
    "name": "Sales",
    "description": "Inbound + outbound sales reps",
    "organizationId": "65a0e0e0e0e0e0e0e0e0e0e0",
    "createdAt": "2026-01-12T09:00:00.000Z",
    "updatedAt": "2026-04-04T12:30:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Department display name; unique within the organization.

description
string

Free-text description of the department's purpose.

managerIds
string[]

User _ids with MANAGER role inside this department.

userIds
string[]

All members of the department (managers + agents).

Response

Department created

department
object
Example:
{
"_id": "65c1a0b0c0d0e0f0a0b0c0d1",
"name": "Sales",
"description": "Inbound + outbound sales reps",
"organizationId": "65a0e0e0e0e0e0e0e0e0e0e0",
"managerIds": [
{
"_id": "65b1f0a2c3d4e5f6a7b8c9e0",
"fullName": "Brenda Lee",
"email": "brenda@example.com",
"accessRole": "ADMIN"
}
],
"userIds": [
{
"_id": "65b1f0a2c3d4e5f6a7b8c9d0",
"fullName": "Alice Rivera",
"email": "alice@example.com",
"accessRole": "AGENT"
}
],
"createdBy": {
"_id": "65b1f0a2c3d4e5f6a7b8c9e0",
"fullName": "Brenda Lee",
"email": "brenda@example.com"
},
"updatedBy": {
"_id": "65b1f0a2c3d4e5f6a7b8c9e0",
"fullName": "Brenda Lee",
"email": "brenda@example.com"
},
"createdAt": "2026-01-12T09:00:00.000Z",
"updatedAt": "2026-04-04T12:30:00.000Z"
}