/pending-approvals/bulkDecide Changes in Bulk
Approves or rejects a batch of pending changes in a single atomic attestation using a batch criterion predicate (by maker session, by criteria predicate, by time window, or by table scope).
Creates one approval attestation record (aat_<base62>) and transitions all matched pending change records (pch_<base62>) in the same transaction.
The operation is all-or-nothing: if the caller lacks authority over any matched change, the entire batch is rejected with K9O_BULK_APPROVAL_AUTHORITY_INSUFFICIENT (403) before any state transition.
Requires PROJECT_ADMIN or APPROVAL_VIEWER bulk-approval privilege.
A reason field is required when bulk-rejecting.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| action * | "approve" | "reject" | Whether to approve or reject every matching change. |
| criteria * | object | A JSON predicate selecting which waiting changes to decide, in the same grammar as approval policies: Paths such as A predicate the platform can't evaluate is refused with 400 |
| reason | any | Why you decided. Required to reject. Surrounding whitespace is trimmed, and an empty string counts as no reason. |
| One of: string | ||
| or: null | ||
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_SESSION_EXPIRED | The caller's session token is expired or invalid; re-authenticate to continue. |
| 403 | K9O_BULK_APPROVAL_AUTHORITY_INSUFFICIENT | The caller lacks authority over one or more of the pending changes matched by the bulk criteria; the entire batch is rejected with no partial application. |
| 403 | K9O_RBAC_DENY | A session is required to decide pending changes: a personal access token alone is refused with `context.reason` `session_required`, and a service, workload or extension token with `human_only`. |
| data * | object | The outcome of the bulk decision. |
| attestationId * | string | An id for this batch ( Each decided change's audit event names it. |
| action * | "approve" | "reject" | The action that was applied. |
| affectedCount * | integer | How many changes were decided: the length of |
| affectedIds * | string[] | The ids of the changes that were decided ( |
| failed * | object[] | The matching changes that could not be decided, each with its error. Every matching change is in |
| id * | string | The id of the change that was not decided ( |
| code * | string | The error code that stopped it. |
| reason * | string | A message explaining the error. |
| reason * | any | The reason recorded on each decision. Null when none was given. |
| One of: string | ||
| or: null | ||
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.approvals.bulk({})Showing example in TypeScript
{
"action": "approve",
"reason": "string"
}{
"data": {
"attestationId": "string",
"action": "approve",
"affectedCount": 0,
"affectedIds": [
"string"
],
"failed": [
{
"id": "string",
"code": "string",
"reason": "string"
}
],
"reason": "string"
}
}