POST
/migrations/pending/{pendingId}/rejectReject Pending Migration
Declines a queued pending migration, transitioning it from queued to rejected without executing any DDL.
The row is retained permanently for audit-trail purposes with the deciding admin's identity and an optional reason.
Returns data: { pendingId, status: 'rejected' }.
Attempting rejection on a row that is not in queued state returns K9O_INVALID_FIELD_VALUE (400).
Emits a migration.rejected audit event.
Requires PROJECT_ADMIN.
Parameters
| pendingId * | path | The pending migration's id ( |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
Responses
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 403 | K9O_ACCESS_DENIED | Rejecting a pending migration requires the PROJECT_ADMIN role, or the caller is not a project member. |
| 403 | K9O_RBAC_DENY | A session is required to reject a pending migration: a personal access token alone is refused with `context.reason` `session_required`, and a service, workload or extension token with `human_only`. |
Response body (200)
| data * | object | The pending migration that was rejected. |
| pendingId * | string | The pending migration's id ( |
| status * | "rejected" | Always |
| meta * | any | Request metadata: cost, timing and correlation ids. |
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.migrations.rejectPending('pmig_4Fh2kQ9xLm7a')Showing example in TypeScript
Response example (200)
{
"data": {
"pendingId": "string",
"status": "rejected"
}
}