List approvals visible to the caller
const url = 'https://example.com/v1/approvals?limit=25&scopeKind=tenant&assignedTo=me&decidedBy=me&order=asc&requiredRole=standard';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://example.com/v1/approvals?limit=25&scopeKind=tenant&assignedTo=me&decidedBy=me&order=asc&requiredRole=standard' \ --header 'Authorization: Bearer <token>'Requires a reviewer: a token that carries a reviewerRole, or whose user is a registered reviewer (the roster gives the role). With authorization on, a person who is the tenant’s admin (through a session or an admin key not limited to a project) reads at every tier: with no roster entry, as an admin reviewer; with a lower role, their own tier, and any tier they ask for with requiredRole. The roster doesn’t show such a reader, but the access audit records the tenant-admin check (authz-decision), made only where it changes what the roster gives. Role-scoped: reviewers only see approvals whose requiredRole rank ≤ their rank (standard < senior < admin). With authorization on, only approvals whose project the caller may read. scopeKind/scopeId narrow to one project’s approvals, or every project’s in an org; approvals from before Kindgi 0.1.3 have no project and are listed only without a scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”1..100. Default 25.
Where the previous page ended: its nextCursor, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise 400 bad-input, and the list starts again without it. Absent → first page.
Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.
Optional scope discriminator. If absent, no scope filter is applied.
Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (tenant is implicit from the session). Malformed combinations return 400 scope-invalid.
Only approvals in these statuses: one, or several, repeated (status=pending&status=escalated) or comma-separated (status=pending,assigned,in_review).
me: only the approvals assigned to the caller’s own reviewer row (none when the caller has no row).
me: only the approvals the caller’s own reviewer row decided (none when the caller has no row).
desc (newest first, the default) or asc (oldest first). A page’s nextCursor continues its own order; the page says which order it’s in (order).
Reviewer role class. Hierarchy: standard < senior < admin.
Filter by required reviewer role. Caller must have a rank ≥ the value — else 403.
ISO 8601 timestamp; return approvals created strictly after this.
Only approvals linked to one of these run waits (an approval’s waitTokenId; a run’s journal names its open waits in wait.suspended entries). Repeat it for several, at most 50.
Only the approvals this run asked for.
With runId: also the approvals its child runs asked for, at any depth (a flow’s agent steps).
Responses
Section titled “Responses”Page of approvals.
object
object
object
Reviewer role class. Hierarchy: standard < senior < admin.
object
object
The reviewer’s decision, once one is recorded. Absent while the approval is open, and when it ended without one (it expired, a timeout escalated it, or its run’s end withdrew it).
object
Who decided, as an actor: user:<userId>, the reviewer’s user. The run’s journal and provenance name the decider the same way. The Kindgi runtime always records it; a deployment whose HITL binding doesn’t leaves it out.
Reviewer role class. Hierarchy: standard < senior < admin.
The provider of the session the reviewer decided with: site:<id> for a site’s sign-in, an identity provider’s id for a single sign-on session. Absent for an API key, and on decisions an older runtime recorded.
The reviewer’s display name when they decided: a person renamed since still shows as they were. Absent on decisions an older runtime recorded.
Who asked for it, when recorded: user:<id>, service_account:<id> or system:<what>.
Whether the person who asked may not approve it (four eyes). A runtime that knows it always sends it, false included.
Why it was withdrawn, when its run’s end withdrew it (a reviewer’s withdrawal has its decision instead).
The approval this one was escalated from.
The approval this one was escalated to.
Opaque cursor for the next page, in the same order; treat as opaque on the client.
The order the page is in: asc (oldest first) or desc (newest first). Absent from a runtime before Kindgi 0.1.6, which lists newest first and ignores order.
me on every page of a list asked for with ?decidedBy=me, an empty one too: it holds only the approvals the caller decided. Absent from a runtime before Kindgi 0.1.9, which ignores decidedBy and lists them all.
Example
{ "data": [ { "requiredRole": "standard", "status": "pending", "decision": { "decision": "approve", "reviewerRoleAtDecision": "standard" }, "withdrawnBecause": "run-cancelled" } ], "order": "asc", "decidedBy": "me"}Malformed query parameter or scope.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The caller isn’t a reviewer or the tenant’s admin, or asked for a tier above its own and isn’t the tenant’s admin.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}