Docs
Search docs

Cancel a prepared GitHub ref transaction

DELETE/api/repos/{owner}/{repo}/github-ref-transactions/{id}

cancelGithubRefTransaction

Cancels a `github_managed` repository's `prepared` write-through transaction — one that was recorded but never sent to GitHub — and releases its staged objects. Requires repo admin. Idempotent: an already-cancelled transaction answers `200` as it is. An `ambiguous` transaction answers `409 conflict` (resolve it with provider proof instead); any other state answers `409 conflict`.

Requires authentication using a bearer token or a session cookie — see tokens and scopes.

curl

curl -X DELETE 'https://neosource.dev/api/repos/OWNER/REPO/github-ref-transactions/ID' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

fetch("https://neosource.dev/api/repos/OWNER/REPO/github-ref-transactions/ID", {
  method: "DELETE",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
  },
});

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

idrequired

The ref transaction id (a UUID), as a paused push or a band-2 notice names it.

string

Responses

200Cancelled

application/json

GithubRefTransactionResponse

object

A GitHub ref transaction (ADR 0115 Phase 3) — the write-through's durable intent, as the resolve and cancel routes answer it.

accepted_at

integer | nullint64

attemptsrequired

integerint32

authority_epochrequired

integerint64

The GitHub authority epoch the transaction was prepared under.

commandsrequired

array

The canonical command set, sorted by refname.

items

GithubRefCommandResponse

object

One command of a GitHub ref transaction: `refname` from `expected_old` to `new` (`null` = absent: a create has no `expected_old`, a delete no `new`).

expected_old

string | null

new

string | null

refnamerequired

string

created_atrequired

integerint64

Millis since the Unix epoch.

last_error

string | null

projected_at

integer | nullint64

resolved_at

integer | nullint64

When a repository admin resolved or cancelled it.

resolved_by

string | null

The account id of the admin who did.

staterequired

GithubIntentState

string

The state machine shared by `github_ref_transactions.state` and `github_mutation_intents.state`. ONE enum for both tables: their CHECK constraints are byte-identical and the plan describes a single lifecycle — prepare durably, submit at most once, land or fail, project. Splitting them would be two copies of the edge table with nothing comparing them. ```text prepared → submitting, cancelled submitting → accepted, ambiguous, rejected accepted → projected, ambiguous ambiguous → projected, rejected, cancelled projected / rejected / cancelled → (terminal) ``` [`Self::successors`] is the ONLY statement of that table; `can_transition_to`, `predecessors_of` and `is_terminal` are all derived from it, and the stores' SQL guards bind `predecessors_of(target)` rather than restating an edge list in SQL where nothing could compare the two.

"prepared""submitting""accepted""ambiguous""projected""rejected""cancelled"

transaction_idrequired

string

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 401Authentication required
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 409Conflict — one of: conflict, github_ref_proof_mismatch
  • 423Locked — one of: busy
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 502Bad Gateway — one of: upstream
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget