--- title: Departments (LLM) description: GET /departments - list a desk's departments for routing. --- # GET /departments List every non-deleted department on the token's desk. Scope: `tickets:read`. Full URL: `https://.headoni.app/api/v1/departments` Auth header: `Authorization: Bearer hd_` Use the returned `id` as `departmentId` in `POST /tickets`. Private departments are included; `isPublicToUsers` only affects the portal form, not API routing. ## Example Request ```bash curl https://acme.headoni.app/api/v1/departments \ -H "Authorization: Bearer hd_your_secret_here" ``` ## Success Response Status `200`. ```json { "departments": [ { "id": "1490200000000000001", "name": "Support", "isDefault": true, "isPublicToUsers": true }, { "id": "1490200000000000002", "name": "Billing", "isDefault": false, "isPublicToUsers": false } ] } ``` ## Field Reference | field | type | notes | | --- | --- | --- | | id | string | pass as `departmentId` on create | | name | string | display name | | isDefault | boolean | the department used when `departmentId` is omitted | | isPublicToUsers | boolean | shown on the portal form; does not affect API routing | Order: by name, ascending. ## Errors | status | error | cause | | --- | --- | --- | | 401 | unauthenticated | missing or invalid token | | 403 | insufficient_scope | token lacks `tickets:read` |