List departments
Returns your organisation's departments by name, each with the department it sits under, its head, code, cost
centre and how many active people are in it. Archived departments are left out unless you ask for them with
archived=true. A person's department is the name of their department.
Scope: people:read · Plan: Pro and Enterprise in live mode; every plan in test mode.
AuthorizationBearer <token>Send Authorization: Bearer <token> on every request. The token is one of:
| Prefix | What it is | Where it may be used |
|---|---|---|
agoo_sk_live_ | Secret key, live mode | Your servers only |
agoo_sk_test_ | Secret key, test mode | Your servers only |
agoo_pk_live_ | Publishable key, live mode | Browsers and apps: create pre-registrations and bookings, read public booking types (with their intake questions) and their free slots, read the visit types open for pre-registration with their public forms. Never lists people. |
agoo_pk_test_ | Publishable key, test mode | As above, in test mode |
Admins create keys in Console → Developers → API keys and choose each key's scopes. A key is shown once. Never put a secret key in a URL, a browser or a mobile app.
Scope: people:read
archived?booleantrue: archived departments too.
falseYour departments.
application/json- response
data*array<>next_cursor*|Pass this as cursor to get the next page. null on the last page.
"b3BhcXVlLWN1cnNvcg"has_more*booleancurl -X GET 'https://api.agoohq.com/v1/departments'{ "data": [ { "id": "dept_01kjsd2v80e5q7m3c9x4ht6wfb", "object": "department", "name": "Operations", "code": "OPS", "parent_id": null, "head_id": "person_01kjsf3c00ecxs9b3k1hw7wq2n", "cost_centre": "CC-300", "archived": false, "people": 38, "created_at": "2026-03-03T09:00:00Z", "updated_at": "2026-10-12T08:40:00Z" }, { "id": "dept_01kjsd2v80e5q7m3c9x4ht6wfa", "object": "department", "name": "Treasury", "code": "TRY", "parent_id": "dept_01kjsd1qg0f2n8r5bz7ke3yc4d", "head_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "cost_centre": "CC-210", "archived": false, "people": 14, "created_at": "2026-03-03T09:00:00Z", "updated_at": "2026-10-06T14:30:00Z" } ], "next_cursor": null, "has_more": false}Deactivate a person DELETE
Deactivates a person instead of deleting them, so their visit and attendance history stays intact. A deactivated person can't host visitors, clock in or sign in, and no longer counts towards your plan's limits. - Fires `person.deactivated`. - Upcoming visits they host keep their `host_id`. Reassign them with `PATCH /visits/{visit_id}`. - Deactivating someone who is already deactivated returns them unchanged and fires no event. **Scope:** `people:write` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
Create a department POST
Makes a department. Names are unique among the departments that aren't archived: a name already in use returns `conflict`. A `parent_id` must be one of your departments that isn't archived, and `head_id` someone in your directory. - Fires `department.created`. **Scope:** `hr:write` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.