# Get all departments

`GET /api/configuration/departments`

- **Success:** `200 OK`
- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Get all departments](https://support.gladstonesoftware.cloud/reference/configuration/get-all-departments)

## Overview

Lists the departments the operator has configured, each with the cost centre it belongs to. Departments are the lower level of the operator's two-tier financial coding structure: every department sits under exactly one [cost centre](get-all-cost-centres.md), and the pair is what financial postings are coded against. Because the cost centre's id and name are included in each entry, this single call is usually enough to build a coding picker — you do not need the cost centres list as well unless you want to show cost centres that have no departments.

This is operator data with no starter set and no cross-tenant meaning. Ids you find in one tenant will not exist in another, so hard-coding one is a latent bug.

Results come back in no guaranteed order, and there is no filter and no paging — every department is returned, and there is no active/inactive flag, so departments the operator has stopped using remain until deleted. A newly created department may not appear immediately.

When none are configured you get `200` with an empty array `[]`.

## Endpoint

`GET {base_url}/api/configuration/departments`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Sample request

```bash title="cURL"
curl -X GET '{base_url}/api/configuration/departments' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `[].id` | string | The department's identifier, unique within your tenant and the value the create and update endpoints expect. Maximum 15 characters. Either chosen by the operator at creation, or auto-generated in the form `DEPT` followed by digits padded to 15 characters when they left it blank — so a single tenant will typically hold a mix of house codes and generated ones, and the shape tells you nothing. **Tenant-specific; never hard-code it.** |
| `[].description` | string | The department's name, and what to show in a picker. Maximum 255 characters. Required when creating a department, and the update endpoint rejects a blank value ("Description cannot be blank"), but departments created outside the API can come back `null` — fall back to `id` rather than rendering an empty row. |
| `[].reference` | string | A free-text code tying this department to the operator's own finance system, such as a nominal or cost code. Maximum 255 characters. Optional and commonly `null` or empty. The platform never interprets it, enforces no format and does not require uniqueness — pass it through to downstream accounting rather than parsing or matching on it. |
| `[].costCentreId` | string | The cost centre this department belongs to. Maximum 15 characters, required on every department, and always a real cost centre — and matches an `id` from [the cost centres list](get-all-cost-centres.md). A department belongs to exactly one cost centre; there is no many-to-many. Because of this link a cost centre cannot be deleted while any department still points at it. |
| `[].costCentreDescription` | string | The parent cost centre's name, included so you do not need a second call to label the hierarchy. Maximum 255 characters. **`null` whenever the cost centre itself has no description** — it is taken from the cost centre, not held on the department — so fall back to `costCentreId` when it is missing. Never edit or match on it; it is display text the operator can change at the cost centre. |

## Sample response

```json title="200 OK"
[
  {
    "id": "string",
    "description": "string",
    "reference": "string",
    "costCentreId": "string",
    "costCentreDescription": "string"
  }
]
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `500` | Internal server error | Any unexpected server-side failure while reading the departments. The response is a bare status code with **no body**, so there is no detail to branch on. Retry with backoff. |
