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 workspace’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”Responses
Section titled “Responses”Page of approvals.
object
Example
{ "data": [ { "requiredRole": "standard", "status": "pending", "decision": { "decision": "approve", "reviewerRoleAtDecision": "standard" }, "withdrawnBecause": "run-cancelled", "approver": { "kind": "member" }, "connection": { "as": "company" } } ], "order": "asc", "decidedBy": "me"}Malformed query parameter or scope.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The caller isn’t a reviewer or the workspace’s admin, or asked for a tier above its own and isn’t the workspace’s admin.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The database was too busy to answer in time (database-busy), or the authorization store couldn’t be reached (authz-backend-unavailable); Retry-After (whole seconds) says when to try again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}