# List departments

> Departments and their published public contacts (an office's line, never a person's). Billed as one records request a page. Filters: jurisdiction, region, country, kind, since.

`GET /v1/departments`

Departments and their published public contacts (an office's line, never a person's). Billed as one records request a page. Filters: jurisdiction, region, country, kind, since.

Authentication: `Authorization: Bearer <key>`, an `htd_test_` (sandbox) or `htd_live_` (live) key.

```bash
curl "https://data.heytownhall.com/v1/departments" \
  -H "Authorization: Bearer $HTD_KEY"
```

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `jurisdiction` | query | no | A jurisdiction id. |
| `region` | query | no | A two-letter province or state code. |
| `country` | query | no | CA or US. |
| `kind` | query | no | The department's role, such as planning. |
| `since` | query | no | Records read at or after this instant: what is new since your last read. |
| `limit` | query | no | Results a page, 1 to 100. Default 25. |
| `cursor` | query | no | next_cursor from the previous page. |

## Fields of each result

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `jurisdiction_id` | string |  |
| `country` | string or null |  |
| `region` | string or null |  |
| `department` | string or null |  |
| `role` | string or null |  |
| `phone` | string or null |  |
| `email` | string or null |  |
| `hours` | string or null |  |
| `source_url` | string or null | The page, document, video or platform the record was read from. |
| `read_at` | string or null | When it was read. |

## Answers

| Status | Meaning |
| --- | --- |
| `200` | A page. |
| `400` | invalid_request: a parameter is missing or not valid; `param` names it. |
| `401` | unauthorized: no key, or not a valid one. |
| `402` | billing_required (a live key without a payment method, or paused for an unpaid invoice) or spend_cap_reached. |
| `429` | rate_limited: past the key's requests per minute. Retry-After says when to try again. |
| `503` | upstream_unavailable: the data could not be read. Not an empty answer; try again. |
