What staff did
const url = 'https://api.sloose.com/staff/actions?limit=100';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.sloose.com/staff/actions?limit=100' \ --header 'Authorization: Bearer <token>'Backoffice route: a staff session, or ADMIN_TOKEN. Staff actions, newest first, a page at a time (limit and cursor, answering nextCursor): who, what, to which organisation or person, and why when a reason was given.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only actions on this organisation.
Only actions on this organisation.
Actions to leave out, comma-separated (org.view, which every page visit writes, buries what was changed). Absent: every action.
Actions to leave out, comma-separated (org.view, which every page visit writes, buries what was changed). Absent: every action.
How many to return, at most 500; 100 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.
Example
100How many to return, at most 500; 100 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.
The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s (createdAt, id) order, and a malformed one is 400 INVALID_CURSOR.
The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s (createdAt, id) order, and a malformed one is 400 INVALID_CURSOR.
Responses
Section titled “Responses”A page of actions, newest first.
object
object
The staff member who acted. Null means one of three things, which detail tells apart: the shared admin token acted (nothing in detail says otherwise); somebody who is not staff did, named by detail.by — owner, admin, self, or one of Sloose’s own jobs (cron, purge); or a staff member did who has since been erased, and detail.formerStaff is true.
That staff member’s address. For one whose account was deleted but whose row another organisation’s records still need, the reference stays and this is a placeholder; detail.formerStaff is true for those rows too, so read the mark before the address.
What the action was about, by action. Two keys say who acted where staffUserId alone does not: by (owner, admin, self, cron, purge) and formerStaff (true for an act of a staff member since erased).
Pass as cursor for the next page; null when this was the last.
Examplegenerated
{ "actions": [ { "id": "example", "action": "example", "orgId": "example", "orgName": "example", "staffUserId": "example", "staffEmail": "example", "targetUserId": "example", "targetEmail": "example", "reason": "example", "detail": "example", "createdAt": "example" } ], "nextCursor": "example"}cursor is malformed (code: INVALID_CURSOR).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).