Enable GitHub metadata sync for an imported repository
POST/api/repos/{owner}/{repo}/github-sync
enableGithubSync
Opts a GitHub-imported repository into metadata sync (issues, comments, labels) and enqueues the backfill. Requires repo admin and a GitHub-linked identity with a stored access token — the caller becomes the importer whose token authorizes the sync. The GitHub `owner/name` is resolved from the repo's import history; repos that were not imported from GitHub are rejected, as are repos that already carry natively-numbered issues or pull requests (the first enable reserves the numbering band and cannot renumber existing content — sync can only be enabled on freshly imported repos). Calling this on a sync that hit its failure budget (`state = error`) re-arms it: the state returns to `backfilling` and the backfill resumes from its persisted cursors.
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/github-sync' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/github-sync", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
},
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
Responses
202Sync enabled and backfill enqueued
application/json
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