Update repository settings
PATCH/api/repos/{owner}/{repo}/settings
updateRepositorySettings
Updates mutable repository metadata: visibility (public/internal/private), description, and the merge-method pair (`allowed_merge_methods` — the methods this repo permits — and `default_merge_method` — the one used when a merge request names none), and `delete_branch_on_merge` — whether a merge also removes the pull request's source branch, on unless a repo turns it off. Omitted fields are left unchanged. The allow-list must be non-empty, duplicate-free, and must contain the resulting default; a request whose RESULTING state breaks that is rejected with 400 rather than silently repaired. It is a set, so it is stored and echoed in a canonical order (`merge` before `squash`) regardless of the order sent. Pass `expected_version` (the `version` from the last read) for optimistic concurrency — a concurrent edit returns 409, as does the rarer case of a request validated against a repo record that changed underneath it (retry after re-reading). Requires repo admin access. `workspace_secrets` (`auto` / `enabled` / `disabled`) — whether trusted CI runs on this repo receive the workspace's CI secrets and may write its shared compile cache; `auto` grants them exactly while the repo's creator is currently an owner or admin of its workspace (repo grants do not count) — additionally requires `workspace:secret:write` on the repo's workspace (the right to manage those secrets), so a repo admin who is not a workspace admin gets 403 for it. `ci_workflow_source` (`neosource` / `neosource_and_github`) — whether `.github/workflows/` files run in place beside `.neosource/workflows/` (a `.github` file named like a native one is shadowed by it). Turning it on registers the default branch's current files before responding and starts no run itself (a promoted `on: schedule` workflow fires at its next tick, the others on the next push); turning it off stops new runs, re-runs and approvals of them in the same write, without cancelling runs already queued or in progress.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X PATCH 'https://neosource.dev/api/repos/OWNER/REPO/settings' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{}'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/settings", {
method: "PATCH",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
Request bodyrequired
application/json
Responses
200Repository updated
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
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
CommitStatusState
State of a single commit status, GitHub-shaped. `Error` is distinct from `Failure` on individual statuses (infrastructure/tooling breakage vs. a real red result) but the combined rollup folds both into `Failure`.
"pending""success""failure""error"