# Update repository settings

> Change how a repository handles pull requests.

<div class="g1t-endpoint"><span class="g1t-method" data-method="patch">PATCH</span><code>/repos/{owner}/{name}/settings</code></div>

Only 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](/guides/g1t-agents/#what-a-repository-can-ask-for). `hold_low_confidence` is on unless turned off: see [confidence](/guides/g1t-agents/#how-sure-the-agent-is).

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`repository`](/reference/mcp/#repository) with `action` `update_settings`, and the same inputs
- **Scope:** An access token needs [`repo:write`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## 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. |
| `hold_low_confidence` | boolean | No | Ask a person before merging a g1t agent's change whose confidence is low: auto-merge and the merge queue leave it until a person approves it. On by default. |

## Example request

```sh
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

A successful request answers `200` with:

```json
{
  "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,
  "hold_low_confidence": true,
  "updated_by": "syntaqx",
  "updated_at": "2026-10-04T16:20:37.508Z"
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#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. |
