Mirror to GitHub with an auto-registered deploy key
POST/api/repos/{owner}/{repo}/mirrors/github
createGithubMirror
One-click 'keep GitHub as a backup': creates a GitHub-targeted push mirror and registers its deploy key on the GitHub repo using your linked GitHub account — no manual key paste. Requires repo admin AND a GitHub identity with the `admin:public_key` scope; returns `403` `NeedsScopeError` (scope `admin:public_key`) when the scope is missing so the UI can elevate.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/repos/OWNER/REPO/mirrors/github' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"github_full_name":"string"}'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/mirrors/github", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"github_full_name":"string"}),
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
Request bodyrequired
application/json
Responses
201Mirror created + deploy key registered
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
one of
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 409Conflict — one of: already_exists, conflict
- 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