Update repository settings
Change how a repository handles pull requests.
PATCH
/repos/{owner}/{name}/settingsOnly the fields given are changed. Needs the Maintain role or higher.
required_approvals is at most 6 and max_revisions at most 5. See what a repository can ask for.
- Authentication: Required. Send an access token as
Authorization: Bearer. - MCP tool:
update_repo_settings, with the same inputs
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
owner |
string | Yes | The workspace that owns the repository. |
name |
string | Yes | The repository’s name. |
Body parameters
Section titled “Body parameters”Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.
| Name | Type | Required | Description |
|---|---|---|---|
auto_merge |
boolean | No | Land a g1t agent’s pull request without a person once every rule is met. |
require_up_to_date |
boolean | No | Refuse to merge a pull request that is behind the default branch. When false, merging brings it up to date first. |
required_approvals |
integer | No | How many approving reviews a merge needs. |
count_agent_approvals |
boolean | No | Whether a g1t agent’s approval counts towards required_approvals. |
allow_ignoring_checks |
boolean | No | Whether a member may merge although the acceptance checks did not pass. |
agent_review |
boolean | No | Whether a second agent reviews a g1t agent’s pull request unasked. |
merge_queue |
boolean | No | Merge through a queue: each pull request is tested together with those ahead of it, and only a combination that passed reaches the default branch. |
max_revisions |
integer | No | How many times a g1t agent is sent back before a person is asked. |
Example request
Section titled “Example request”curl -X PATCH https://api.g1t.sh/repos/flagon-io/hello/settings \ -H "Authorization: Bearer $G1T_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "required_approvals": 1, "count_agent_approvals": false, "merge_queue": true }'Example response
Section titled “Example response”A successful request answers 200 with:
{ "auto_merge": false, "require_up_to_date": false, "required_approvals": 1, "count_agent_approvals": false, "allow_ignoring_checks": true, "agent_review": true, "max_revisions": 2, "merge_queue": true, "updated_by": "syntaqx", "updated_at": "2026-10-04T16:20:37.508Z"}Errors
Section titled “Errors”A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
A token is required, or the one sent is not valid. |
| 403 | forbidden |
The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | not_found |
It does not exist, or you cannot see it. |
| 409 | conflict |
The request conflicts with the current state. |
| 422 | invalid |
The input is not valid. message says which field and why. |