# Departments

`GET /departments`

Group: People Management › Departments · Operation ID: `departments`

Returns a list of departments. GET departments/:id returns a richer record, including the parent and manager display names and the external identifiers.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=departments)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Query surface

- `id` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `departmentNumber` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `departmentCode` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `parentId` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `name` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `status` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `lastModifiedDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- Orderable: id, departmentNumber, departmentCode, name, managerName, status, employeeCount, lastModifiedDate
- Selectable: id, departmentNumber, departmentCode, parentId, name, description, managerName, status, employeeCount, lastModifiedDate

## Response

`200` Success

Under `data`, an array of departmentsRow:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The unique identifier for the department. |
| `departmentNumber` | string or null | no | The system-generated department number, for example '100010'. Absent while none has been assigned. |
| `departmentCode` | string or null | no | The short code for the department, for example 'IT', 'HR' or 'FIN'. |
| `parentId` | string or null | no | The identifier of the parent department. Absent for a top-level department. See id on GET departments/:id. |
| `name` | string | no | The display name of the department. |
| `description` | string or null | no | A free-form description of the department's purpose and responsibilities. |
| `managerName` | string or null | no | The full name of the department's managing employee. Absent when no manager is assigned. |
| `status` | string or null | no | The timeline status of the department. Possible values: 'planned', 'inactive', 'active', 'canceled'. |
| `employeeCount` | number or null | no | The number of employees in the department. |
| `lastModifiedDate` | string (date-time) or null | no | The date and time the department record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |

## Statuses

- `400` — Invalid request or business failure
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
