/pending-approvals/{pendingId}/approveApprove Change
Records a checker approval decision on a pending change.
The change must be in pending_approval status.
Errors:
- Any other non-pending state returns
K9O_APPROVAL_NOT_PENDING(409). - A maker-cancelled row returns
K9O_APPROVAL_CANCELLED_BY_MAKER(409). - A caller who is not in the change's denormalized
approver_setand holds no active approval delegation getsK9O_APPROVAL_NOT_AUTHORIZED(403).
On success, if the approver-set threshold is satisfied, the platform atomically commits the pending change and emits a data.write.approval.* audit event.
Subscription events fire on commit, not on the approval action itself.
| pendingId * | path | The pending change's id ( |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| reason | any | Why you decided this way. Surrounding whitespace is trimmed, and an empty string counts as no reason. Required to reject. |
| One of: string | ||
| or: null | ||
| reviewBasis | "read" | "verified" | "unread" | What you went on. Required to approve a held function call or MCP tool call, and ignored for other changes. |
| 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_IAM_POLICY_DENIED | The caller's bound IAMPolicy ceiling denies approvals:manage, so they are not authorised to decide pending changes in this project. |
| 403 | K9O_RBAC_DENY | A session is required to approve a pending change: a personal access token alone is refused with `context.reason` `session_required`, and a service, workload or extension token with `human_only`. |
| 404 | K9O_POLICY_NOT_FOUND | No pending-approval record with the supplied identifier exists or is accessible in this project. |
| 409 | K9O_STATE_CONFLICT | The pending change is not awaiting a decision; it has already been approved, rejected, cancelled, or has expired (including a lapsed TTL), or it was decided concurrently. |
| 409 | K9O_APPROVAL_STALE_BASE | The pending change was based on a committed-state version that has since been superseded; it was auto-rejected due to a conflicting write. |
| 409 | K9O_BYOK_REGION_MISMATCH | Applying the approved change writes an encrypted field for a data subject, and the project's customer-managed key does not cover the region it is written in. The change was not applied, and the field is never sealed under a platform key. |
| data * | object | A pending change: a write or action held until an approver decides it. |
| id * | string | The pending change id ( |
| status * | "pending_approval" | "approved" | "redeemed" | "rejected" | "expired" | "cancelled" | "superseded" | Where the change stands. |
| collection * | any | The collection the change writes to. Null for a change that is not a data write, such as a function call or a platform action. |
| One of: string | ||
| or: null | ||
| operation * | any | The kind of write: Null for a change that is not a data write. |
| One of: string | ||
| or: null | ||
| makerId * | string | Who proposed the change: a user ( |
| proposedPayload * | object | What the change would do. For a data write it is the proposed record. For any other change it holds that change's own details: a policy publish, for example, carries |
| targetRecordId * | any | The id of the record (or policy bundle) the change targets. Null for an insert and for a change with no single target. |
| One of: string | ||
| or: null | ||
| approverId * | any | Who decided the change ( Null while it is undecided. |
| One of: string | ||
| or: null | ||
| decidedAt * | any | When the change was decided. Null while it is undecided. |
| One of: string <date-time> | ||
| or: null | ||
| decisionReason * | any | The reason the approver gave. Null when none was given. |
| One of: string | ||
| or: null | ||
| createdAt * | string <date-time> | When the change was proposed. |
| expiresAt * | any | When the change expires if it is still undecided. Null when it does not expire. |
| One of: string <date-time> | ||
| or: null | ||
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.approvals.approve('apr_3Lq9Wx2Km7Rp5Tz8', {})Showing example in TypeScript
{
"reason": "string",
"reviewBasis": "read"
}{
"data": {
"id": "string",
"status": "pending_approval",
"collection": "string",
"operation": "string",
"makerId": "string",
"targetRecordId": "string",
"approverId": "string",
"decidedAt": "string",
"decisionReason": "string",
"createdAt": "string",
"expiresAt": "string"
}
}