Skip to content

Let a run of a pull request from outside start: it waits as action_required, by the repository's approval policy (get_fork_pr_approval), until someone with the Write role approves it.

POST/repos/{owner}/{name}/actions/runs/{id}/approve

A workflow job’s own token cannot approve. Returns the run.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: workflow with action approve_run, and the same inputs
  • Scope: An access token needs workflows:write.
Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
id string Yes The run’s id, run_….
curl -X POST https://api.g1t.sh/repos/flagon-io/g1t/actions/runs/run_01kq9a2c4e6g8j0m2p4r6t8v0x/approve \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"id": "run_01kq9a2c4e6g8j0m2p4r6t8v0x",
"workflow_id": "wfl_01kpw2c5d8e1f4g7h0j3k6m9np",
"path": ".g1t/workflows/ci.yml",
"name": "CI",
"title": "Fix a typo in the README",
"number": 41,
"attempt": 1,
"event": "pull_request",
"ref": "refs/pull/88/merge",
"sha": "4c1e7a9b2d5f8e0a3c6b9d2f5a8c1e4b7d0f3a6c",
"pull": 88,
"status": "queued",
"conclusion": null,
"error": null,
"actor": "octo-fan",
"created_at": "2026-10-08T08:02:11.004Z",
"started_at": null,
"finished_at": null
}

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.