Approve or decline a claim for an open shift
Approves or declines a claim waiting for a decision, all its approval steps at once. Approving gives the open shift to
the person who asked (other claims for it are taken), and they're told; it's refused with conflict when they now
have a shift at that time or are on leave. A decline needs a note they see. A claim that isn't waiting returns
invalid_state. shift_claim.approved or shift_claim.declined fires.
Scope: attendance:manage · 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:manage
shift_claim_id*stringThe claim's ID.
^shift_claim_[0-7][0-9a-hjkmnp-tv-z]{25}$"shift_claim_01m5a2wsp4k55wjfe13p30bjq7"Idempotency-Key*stringA UUID you generate for this operation. If you retry with the same key within 24 hours, Agoo returns the
original response instead of acting twice. While the first request is still running, a retry returns
conflict. Reusing a key with a different request returns idempotency_key_reused. Responses with
rate_limited, internal_error or unavailable aren't stored, so retry those with the same key.
uuidapplication/json- body
decision*string"approve""decline"note?stringRequired to decline (3 to 300 characters): they see it.
length <= 300The claim, decided.
application/json- response
Someone asking to take a published open shift, and where it stands.
id*ShiftClaimIdA claim for an open shift's ID (TypeID with the shift_claim prefix).
^shift_claim_[0-7][0-9a-hjkmnp-tv-z]{25}$"shift_claim_01m5a2wsp4k55wjfe13p30bjq7"site_id*SiteIdA site ID (TypeID with the site prefix).
^site_[0-7][0-9a-hjkmnp-tv-z]{25}$"site_01kjpt3yw0fz0v414608h9x65s"status*string"pending""approved""declined""withdrawn""taken""expired"shift*A shift on a site's roster. A published shift with a change waiting shows its published values.
person_id*PersonIdA person ID (TypeID with the person prefix).
^person_[0-7][0-9a-hjkmnp-tv-z]{25}$"person_01kjsesxm0e4zbyvkr7bcfxbfg"note*string|nulldecision_note*string|nullapproval*|Where its approval stands; null when it needed none.
created_at*stringdate-timedecided_at*|date-timeupdated_at*stringdate-timecurl -X POST 'https://api.agoo.ardent.africa/v1/shift-claims/shift_claim_01m5a2wsp4k55wjfe13p30bjq7/decide' \ -H 'Idempotency-Key: 3f6b2a1e-8c4d-4f7a-9b2e-5d1c0a7e9f64' \ -H 'Content-Type: application/json' \ -d '{ "decision": "decline", "note": "Kofi is covering it"}'{ "id": "shift_claim_01m5a2wsp4k55wjfe13p30bjq7", "site_id": "site_01kjpt3yw0fz0v414608h9x65s", "status": "pending", "shift": { "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" }, "person_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg", "note": "string", "decision_note": "string", "approval": { "status": "pending", "step": 0, "of": 0 }, "created_at": "2019-08-24T14:15:22Z", "decided_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Get a claim for an open shift GET
Returns one claim for an open shift. **Scope:** `attendance:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
List watchlist entries GET
Returns your watchlist entries, newest first. Expired entries aren't returned. **Scope:** `watchlist:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.