neosourceDocs
Search docs

Get a mirror

GET/api/repos/{owner}/{repo}/mirrors/{mirror_id}

getMirror

Returns a single mirror by ID. Requires admin access.

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

curl

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

fetch

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

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

mirror_idrequired

Mirror ID.

string

Responses

200Mirror details

application/json

MirrorResponse

object

acknowledged_replicarequired

boolean

Whether the creator acknowledged exact-replica semantics. Surfaced so the UI can explain why a mirror aimed at this repo's upstream is not pushing (ADR 0107 D6) rather than showing an unexplained `last_error`.

created_atrequired

integerint64

last_error

string | null

last_error_at

integer | nullint64

last_synced_at

integer | nullint64

last_synced_op_id

string | null

Hex-encoded operation ID of the last successful push, or null.

mirror_idrequired

string

repo_idrequired

string

ssh_public_keyrequired

string

OpenSSH-format public key. Paste this as a deploy key on the upstream side. Always present in responses — the private key stays in the database.

target_kindrequired

MirrorTargetKind

string

What kind of upstream a mirror is targeting. Persisted as the `mirror_target_kind` Postgres enum.

"github""gitlab""generic"

target_urlrequired

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
  • 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