List leave requests
Returns leave requests, newest first by their first day: waiting for a decision (pending), approved,
declined and cancelled. Filter by person, status, type, and dates (leave overlapping from to to).
A private type of leave (sick and maternity by default) comes back as kind: away and type_name: Away, with
type_id, reason and decision_note null: integrations never see what it is. Certificates never leave Agoo.
Scope: attendance: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: attendance:read
limit?integerHow many items to return, from 1 to 100.
1 <= value <= 10025cursor?stringThe next_cursor from the previous page. Leave it out for the first page.
length <= 512person_id?stringOnly this person's leave.
^person_[0-7][0-9a-hjkmnp-tv-z]{25}$"person_01kjsesxm0e4zbyvkr7bcfxbfg"status?stringOnly leave in this state.
"pending""approved""declined""cancelled"type_id?stringOnly leave of this type. A private type returns nothing.
^ltype_[0-7][0-9a-hjkmnp-tv-z]{25}$"ltype_01m4y8r6t0e9k2b7c5d3f1g0hj"from?stringOnly leave ending on or after this day, as YYYY-MM-DD.
dateto?stringOnly leave starting on or before this day, as YYYY-MM-DD.
dateA page of leave requests.
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.agoo.ardent.africa/v1/leave-requests?limit=25'{ "data": [ { "id": "leave_01m4z0q2k8fv7tqz3x9c1nbe5d", "person_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "type_id": "string", "type_name": "Annual leave", "kind": "annual", "private": true, "status": "pending", "starts_on": "2019-08-24", "ends_on": "2019-08-24", "half_day": true, "half_day_part": "morning", "days": 3, "unit": "working_days", "paid": true, "reason": "string", "decision_note": "string", "decided_at": "2019-08-24T14:15:22Z", "decided_by": "string", "approval": { "status": "pending", "step": 0, "of": 0 }, "cancelled_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ], "next_cursor": "b3BhcXVlLWN1cnNvcg", "has_more": true}List leave types GET
Returns your organisation's leave types, in the order the Console shows them, archived ones included (`archived: true`). Agoo seeds them from Ghana's Labour Act (15 working days' annual leave, s.20; 12 weeks' maternity, s.57) and HR keeps them in the Console. A `private` type (sick and maternity leave by default) is listed, but leave of that type comes back as `away`. **Scope:** `attendance:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
Record leave POST
Records leave from another system (an HR system, a paper form), approved at once, by the rules HR follows in the Console: within the balance and the type's negative allowance, never on days the person already has leave, and with `over_reason` when it's more than a per-occasion type allows. Working days never count public holidays, closed days or days the person doesn't work (Labour Act s.22). Its days come off the balance and `leave.approved` fires. **Scope:** `attendance:manage` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.