Skip to content

Change a remote's settings, all optional: notify (banner, or inbox to also tell the workspace's owners), take_over_after (minutes, 5 to 1440, after which g1t takes over on its own while the remote does not answer; null for never), hand_back (when_clean: an automatic takeover goes back on its own once every ref goes back without a decision; ask), keep_ci_warm (run .g1t/workflows on pushes copied in while standing by), github_workflows (run .github/workflows in CI failover and takeovers), hold_deploys, and for a follower remote_pushes (adopt fast-forwards made there, or overwrite them).

PATCH/repos/{owner}/{name}/mirror/remotes/{id}

Needs the Admin role; agents’ tokens are refused.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: repository with action mirror_update_remote, and the same inputs
  • Scope: An access token needs repo:admin.
Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
id string Yes The remote’s id (rmt_…), from get_mirror.

Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.

Name Type Required Description
notify string No One of banner, inbox.
take_over_after integer or null No
hand_back string No One of when_clean, ask.
keep_ci_warm boolean No
github_workflows boolean No
hold_deploys boolean No
remote_pushes string No One of adopt, overwrite.
curl -X PATCH https://api.g1t.sh/repos/acme/web/mirror/remotes/rmt_01kp4a2b3c4d5e6f7g8h9j0k1m \
-H "Authorization: Bearer $G1T_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"notify": "inbox",
"take_over_after": 30
}'

A successful request answers 200 with:

{
"id": "rmt_01kp4a2b3c4d5e6f7g8h9j0k1m",
"repo_id": "rep_01kp49z8y7x6w5v4t3s2r1q0pn",
"repo": "acme/web",
"provider": "github",
"role": "leader",
"name": "github.com/acme/web",
"url": "https://github.com/acme/web",
"state": "standby",
"state_since": "2026-10-08T13:58:00.000Z",
"state_by": "syntaqx",
"reachable": true,
"unreachable_since": null,
"synced_at": "2026-10-08T13:57:42.000Z",
"last_error": null,
"settings": {
"notify": "inbox",
"take_over_after": 30,
"hand_back": "when_clean",
"keep_ci_warm": false,
"github_workflows": true,
"hold_deploys": true,
"remote_pushes": "adopt"
},
"created_at": "2026-10-05T10:00:00.000Z"
}

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.