Docs
Search docs

Delete a preserved ref

DELETE/api/repos/{owner}/{repo}/github-preserved-refs

deleteGithubPreservedRef

Deletes one ref under `neosource-preserved/`, named in full by `ref` (`refs/heads/neosource-preserved/…` or `refs/tags/neosource-preserved/…`). A **local** delete only — the ref never reached GitHub, so nothing is written there — and admitted on a GitHub-synced repository, because the namespace is this deployment's. Any other refname is `400 invalid_input`: this is not a general branch delete. `404` when the repository has no such ref. Requires repository **admin**; a branch protection rule that would refuse the same delete as a push is `403 forbidden`.

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-preserved-refs?ref=REF' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

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

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

Query parameters

refrequired

The full refname, under `refs/heads/neosource-preserved/` or `refs/tags/neosource-preserved/`.

string

Responses

204Deleted

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: already_exists, conflict, non_fast_forward
  • 423Locked — one of: busy
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget