/migrations/pending/{pendingId}Cancel Pending Migration
Cancels a queued pending migration that the calling user authored, transitioning it from queued to cancelled without executing any DDL.
The row is retained permanently for audit-trail purposes.
Only the original author (the operator whose subject ID matches queuedBy) may cancel; any other caller receives K9O_FORBIDDEN (403) even if they hold a project role.
Returns data: { pendingId, status: 'cancelled' }.
Attempting cancellation on a non-queued row returns K9O_INVALID_FIELD_VALUE (400).
Emits a migration.cancelled audit event.
| pendingId * | path | The pending migration's id ( |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 403 | K9O_ACCESS_DENIED | You can only cancel a pending migration you originally queued; another admin must reject it instead. |
| data * | object | The pending migration that was cancelled. |
| pendingId * | string | The pending migration's id ( |
| status * | "cancelled" | Always |
| meta * | any | Request metadata: cost, timing and correlation ids. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.migrations.deletePending('pmig_4Fh2kQ9xLm7a')Showing example in TypeScript
{
"data": {
"pendingId": "string",
"status": "cancelled"
}
}