List roster shifts
Returns roster shifts by day: drafts (not yet seen by staff), published shifts, and published shifts removed
since (cancelled). Filter by site, person, open or not, state and days. A published shift with a change waiting
for the next publish shows its published values and pending_change: true; one to be removed at the next publish
shows removing: true. An open shift (open: true, person_id null) is one no one works yet: once published, staff
who can take it may ask for it in Agoo Workspace.
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 <= 512site_id?stringOnly shifts at this site.
^site_[0-7][0-9a-hjkmnp-tv-z]{25}$"site_01kjpt3yw0fz0v414608h9x65s"person_id?stringOnly this person's shifts.
^person_[0-7][0-9a-hjkmnp-tv-z]{25}$"person_01kjsesxm0e4zbyvkr7bcfxbfg"open?booleantrue: only open shifts; false: only shifts someone works.
status?stringOnly shifts in this state.
"draft""published""cancelled"from?stringOnly shifts on or after this day, as YYYY-MM-DD.
dateto?stringOnly shifts on or before this day, as YYYY-MM-DD.
dateA page of roster shifts.
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/roster-shifts?limit=25'{ "data": [ { "id": "roster_shift_01m5dk4qexa6kwfsr9nhy4r7w5", "site_id": "site_01kjpt3yw0fz0v414608h9x65s", "person_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "open": true, "on_date": "2019-08-24", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "start_time": "20:00", "end_time": "08:00", "shift_id": "shift_01kn6pqfm0fmasbh61jnr3syze", "name": "Night gate", "label": "Main gate", "colour": "blue", "break_kind": "none", "break_minutes": 0, "break_starts": "string", "note": "string", "status": "draft", "pending_change": true, "removing": true, "source": "pattern", "published_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}Reopen a timesheet POST
Reopens an approved timesheet, with a reason the person and whoever approved it see: it's unlocked, its days are worked out again, and it goes back through your organisation's approval steps. A timesheet that isn't approved returns `invalid_state`. `timesheet.reopened` fires. **Scope:** `attendance:manage` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
Add a roster shift POST
Adds a shift to a site's roster as a draft, from one of the site's shift templates (`GET /shifts`), with its own start and end when you give them. With no `person_id` it's an open shift. Staff see nothing until the site's roster is published (`POST /rosters/publish`), as in the Console. Rosters themselves are part of Growth and up (`plan_required` otherwise). **Scope:** `attendance:manage` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.