Update a department
Changes a department. Send only the fields you want to change; null clears an optional one.
- Renaming a department renames it for everyone in it: their
departmentchanges with it. archived: truearchives a department nobody active is in, with no departments under it and no positions that aren't closed; otherwise it returnsinvalid_state.archived: falsebrings one back, unless another department now has its name (conflict). Its history stays either way.- Fires
department.updated, withprevious_attributes.changednaming what changed.
Scope: hr:write · 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: hr:write
department_id*stringThe department's ID.
^dept_[0-7][0-9a-hjkmnp-tv-z]{25}$"dept_01kjsd2v80e5q7m3c9x4ht6wfa"application/json- body
The fields to change. Send null to clear an optional field.
name?stringIts people's department changes with it.
1 <= length <= 120code?|length <= 20parent_id?|The department it sits under, never itself or one under it. null: at the top.
head_id?|nullcost_centre?|length <= 60archived?booleantrue archives a department nobody active is in; false brings an archived one back.
The updated department.
application/json- response
One of your organisation's departments. A person's department is the name of their department.
id*DepartmentIdA department ID (TypeID with the dept prefix).
^dept_[0-7][0-9a-hjkmnp-tv-z]{25}$"dept_01kjsd2v80e5q7m3c9x4ht6wfa"object*"department""department"name*stringUnique among the departments that aren't archived.
1 <= length <= 120"Treasury"code*|Your own short code for it.
length <= 20"TRY"parent_id*|The department it sits under. null: at the top.
head_id*|The person who heads it. null: no one is named.
cost_centre*|length <= 60"CC-210"archived*booleantrue for a department that's archived: kept, with its history, but not offered for new people.
people*integerHow many active people are in it.
0 <= valuecreated_at*stringdate-timeupdated_at*stringdate-timecurl -X PATCH 'https://api.agoohq.com/v1/departments/dept_01kjsd2v80e5q7m3c9x4ht6wfa' \ -H 'Content-Type: application/json' \ -d '{ "head_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "cost_centre": "CC-215"}'{ "id": "dept_01kjsd2v80e5q7m3c9x4ht6wfa", "object": "department", "name": "Treasury", "code": "TRY", "parent_id": "dept_01kjsd1qg0f2n8r5bz7ke3yc4d", "head_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "cost_centre": "CC-215", "archived": false, "people": 14, "created_at": "2026-03-03T09:00:00Z", "updated_at": "2026-10-19T10:15:00Z"}Get a department GET
Returns one department, archived or not. **Scope:** `people:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
List positions GET
Returns your organisation's positions by title, each with who holds it now. Filter by department, or by status: `vacant` lists your vacancies. **Scope:** `people:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.