apicheats.dev github/llms.txt Raw .md
PATCH

PATCH /agents/repos/{owner}/{repo}/automations/{automation_id} — GitHub API

GitHub token (required); https://api.github.com

GitHub API

Edit an automation for a repository

Base URL
https://api.github.com
Auth
Authorization: Bearer <GITHUB_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 376 tokens · Vary: Accept

Critical gotchas

GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.

Fine-grained tokens only authorize repositories and permissions selected when the token is created.

cURL

curl -X PATCH 'https://api.github.com/agents/repos/example-owner/example-repo/automations/automation-id' \  -H "Authorization: Bearer $GITHUB_TOKEN" \  -H 'Accept: application/vnd.github+json' \  -H 'X-GitHub-Api-Version: 2026-03-10' \  -H 'Content-Type: application/json' \  -d '{}'

Parameters

Name In Type Required Description
owner path string Yes The account owner of the repository. The name is not case sensitive.
repo path string Yes The name of the repository. The name is not case sensitive.
automation_id path string Yes The unique identifier of the automation.
name body string No The name of the automation.
enabled body boolean No Set to true to enable, false to disable. Omit to leave unchanged.
write_scope body string No Controls which repository resources a run may modify. `trigger` limits writes to the resource that started the run, when one exists, and resources created during the run; `repository` allows writes to any resource in the repository. Supported values: `trigger`, `repository`. Omit to leave unchanged.
require_actor_write_permission body boolean No When true, event-triggered runs require the event actor to have repo write permission, even when the org's allow_read_access_triggers policy is enabled. Does not apply to interval-scheduled runs, which always run as the automation owner. Omit to leave unchanged.
model body string No The model to use for sessions triggered by this automation. Omit to leave unchanged. Send an empty string to clear the model and revert to the platform default.
reasoning_effort body string No The reasoning effort to use for sessions triggered by this automation. Omit to leave unchanged. Send an empty string to clear the override. Currently supported values: `none`, `low`, `medium`, `high`, `xhigh`, `max`
triggers body object No Public trigger configuration keyed by stable public trigger identifier. Each trigger has a closed, trigger-specific configuration schema.
prompt body string No The prompt template for the automation.
tools body string[] No The tools available to the automation. Send an empty array to clear all tools.
allowed_custom_agents body string[] No Custom agents (subagents) this automation is allowed to invoke. Send an empty array to clear all custom agents.

Response 200 OK

{
  "id": "string",
  "name": "string",
  "enabled": true,
  "owner_type": "user",
  "write_scope": "trigger",
  "require_actor_write_permission": false,
  "triggers": {
    "interval": {
      "cadence": [
        "hourly"
      ],
      "hour_utc": 0,
      "day_of_week": 0,
      "minute_utc": 0,
      "write_scope": "trigger"
    },
    "issue_opened": {
      "query": "string",
      "write_scope": "trigger"
    },
    "issue_labeled": {
      "query": "string",
      "labels": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "workflow_run": {
      "workflows": [
        "string"
      ],
      "conclusions": [
        "failure"
      ],
      "query": "string",
      "write_scope": "trigger"
    },
    "pull_request_opened": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_synchronize": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_merged": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "issue_comment": {
      "body_substring": "string",
      "write_scope": "trigger"
    },
    "pull_request_comment": {
      "comment_types": [
        "timeline_comment"
      ],
      "body_substring": "string",
      "write_scope": "trigger"
    },
    "discussion_opened": {
      "categories": [
        "string"
      ],
      "body_substring": "string",
      "write_scope": "trigger"
    },
    "discussion_updated": {
      "categories": [
        "string"
      ],
      "body_substring": "string",
      "write_scope": "trigger"
    },
    "discussion_comment": {
      "comment_types": [
        "comment"
      ],
      "categories": [
        "string"
      ],
      "body_substring": "string",
      "write_scope": "trigger"
    },
    "issue_assigned": {
      "query": "string",
      "assignees": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_assigned": {
      "query": "string",
      "paths": [
        "string"
      ],
      "assignees": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "sub_issue_added": {
      "query": "string",
      "write_scope": "trigger"
    },
    "pull_request_ready_for_review": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_labeled": {
      "query": "string",
      "paths": [
        "string"
      ],
      "labels": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_merge_conflict": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "pull_request_review_submitted": {
      "query": "string",
      "paths": [
        "string"
      ],
      "states": [
        "approved"
      ],
      "write_scope": "trigger"
    },
    "pull_request_review_requested": {
      "query": "string",
      "paths": [
        "string"
      ],
      "write_scope": "trigger"
    },
    "automation_completed": {
      "automation_ids": [
        "string"
      ],
      "write_scope": "trigger"
    }
  },
  "prompt": "string",
  "tools": [
    "string"
  ],
  "allowed_custom_agents": [
    "string"
  ],
  "model": "string",
  "reasoning_effort": "string",
  "created_at": "2026-09-03T00:00:00Z",
  "updated_at": "2026-09-03T00:00:00Z",
  "created_by": {
    "id": 0
  }
}
Get a free GitHub API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.