For AI agents: markdown of this page — /docs-content-en/entities/departments/get.md documentation index — /llms.txt

Get a department

GET /v1/departments/:id

Returns a single department by identifier with all its fields.

Parameters

Parameter Type Required Description
id (path) number yes Department ID

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/departments/47" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/departments/47" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/departments/47', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Department:', data.name, '— head ID', data.headId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/departments/47', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

The department object with all fields — see Department fields.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 47,
    "name": "Sales department",
    "sort": 500,
    "parentId": 1,
    "headId": 99
  }
}

Error response example

404 — department not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "department 9999 not found"
  }
}

Errors

HTTP Code Description
404 ENTITY_NOT_FOUND No department with this ID was found
403 SCOPE_DENIED The API key does not have the department scope
401 TOKEN_MISSING The API key has no configured tokens

Full list of common API errors — Errors.

See also