Docs
Search docs

List the repository's preserved refs

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

listGithubPreservedRefs

Every branch and tag under `neosource-preserved/` — where an attach keeps a local tip it would otherwise have moved or dropped (ADR 0136 D5). These refs live only here: they are never pushed to GitHub. Each names the attach that made it when one of the repository's recent attach runs matches its `<date>-<run>` segment (`attach_run_id`, and `created_at` = when that attach applied); both are `null` for a ref no known run made. Requires read access.

Authentication optional — this operation also accepts anonymous requests. When authenticating, use a bearer token or a session cookie.

curl

curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/github-preserved-refs' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

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

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

Responses

200The preserved refs, in refname order

application/json

GithubPreservedRefsResponse

object

`GET …/github-preserved-refs`.

refsrequired

array

In refname order.

items

GithubPreservedRef

object

One ref under the preserved namespace (`neosource-preserved/`).

attach_run_id

string | null

The attach that made it, when one of the repository's recent attach runs matches the `<date>-<run>` segment of its name; `null` for a ref no known run made.

created_at

integer | nullint64

When that attach applied (millis since the Unix epoch); `null` when no run matched or it never applied.

refnamerequired

string

targetrequired

string

40-hex git OID of the commit it holds.

Standard errors

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

  • 400Bad Request — one of: invalid_input
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 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