Skip to main content
DELETE/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.

Parameters
pendingId *path

The pending migration's id (pmig_...).

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
403K9O_ACCESS_DENIEDYou can only cancel a pending migration you originally queued; another admin must reject it instead.
Response body (200)
data *object

The pending migration that was cancelled.

pendingId *string

The pending migration's id (pmig_...).

status *"cancelled"

Always cancelled.

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.deletePending('pmig_4Fh2kQ9xLm7a')

Showing example in TypeScript

Response example (200)
{
  "data": {
    "pendingId": "string",
    "status": "cancelled"
  }
}

More in Storage & Schema