Skip to main content
Skip to content

REST-API-Endpunkte für Agentautomatisierungen

Verwenden Sie die REST-API zum Verwalten von Agentautomatisierungen.

List automations for user

Note

This endpoint is in public preview and is subject to change.

Lists automations created by the authenticated user across repositories they can read. This includes both personal and shared automations created by the caller, but excludes shared automations created by another user.

Use the repository-scoped list operation for those automations. The type filter only narrows this creator-scoped collection.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "List automations for user"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

GitHub App installation access tokens are not supported for this endpoint.

Parameter für "List automations for user"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Abfrageparameter
Name, Typ, BESCHREIBUNG
page integer

The page number of the results to fetch.

Standard: 1

per_page integer

The number of results per page (max 100).

Standard: 30

type string

Filter automations by type. personal returns automations owned by their creator, shared returns automations owned by the repository. Omit to return both.

Kann eine der folgenden sein: personal, shared

HTTP-Antwortstatuscodes für "List automations for user"

StatuscodeBESCHREIBUNG
200

Automations retrieved successfully

400

Bad request

401

Authentication required

Codebeispiele für "List automations for user"

Anforderungsbeispiel

get/agents/automations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/automations

Automations retrieved successfully

Status: 200
[ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "repository": { "id": 123456, "owner": "octo-org", "name": "octo-repo" }, "name": "Issue triage", "enabled": true, "type": "personal", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "tools": [ "github/issue_read" ], "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } } ]

List automations for a repository

Note

This endpoint is in public preview and is subject to change.

Returns a paginated list of automations for a repository, including shared automations and personal automations created by the caller. total_count is the number of caller-visible automations matching the supplied filters across all pages. Use the type field to distinguish personal and shared automations.

GitHub App installation access tokens can list shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (read). Personal automations require a user token.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "List automations for a repository"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

Parameter für "List automations for a repository"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

Abfrageparameter
Name, Typ, BESCHREIBUNG
page integer

The page number of the results to fetch.

Standard: 1

per_page integer

The number of results per page (max 100).

Standard: 30

type string

Filter automations by type. personal returns automations owned by their creator, shared returns automations owned by the repository. Omit to return both.

Kann eine der folgenden sein: personal, shared

HTTP-Antwortstatuscodes für "List automations for a repository"

StatuscodeBESCHREIBUNG
200

Automations retrieved successfully

400

Bad request

401

Authentication required

404

Resource not found

Codebeispiele für "List automations for a repository"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations

Automations retrieved successfully

Status: 200
{ "automations": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage", "enabled": true, "type": "personal", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "tools": [ "github/issue_read" ], "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } }, { "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012", "name": "Nightly dependency sweep", "enabled": true, "type": "shared", "require_actor_write_permission": false, "triggers": { "interval": { "cadence": [ "daily" ], "hour_utc": 3 } }, "created_at": "2026-05-02T09:00:00Z", "updated_at": "2026-05-04T11:15:00Z", "created_by": { "id": 456 } } ], "total_count": 3 }

Create an automation for a repository

Note

This endpoint is in public preview and is subject to change.

Creates a new automation in a repository. Personal automations are private to their creator. Shared automations are visible to anyone with read access to the repository and manageable by anyone with write access to the repository.

GitHub App installation access tokens can create shared automations by setting type to shared. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (write). Personal automations require a user token. For installation tokens, created_by identifies the App's bot account.

To call this endpoint, you must have write access to the repository and the "Allow automations" setting must be enabled for the repository.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "Create an automation for a repository"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (write)

Parameter für "Create an automation for a repository"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

Körperparameter
Name, Typ, BESCHREIBUNG
name string Erforderlich

The name of the automation.

triggers object

Trigger configuration for the automation.

Name, Typ, BESCHREIBUNG
interval object
Name, Typ, BESCHREIBUNG
cadence array of strings Erforderlich

One or more schedules on which the Automation runs. Supported values are: hourly, daily, weekly

hour_utc integer

UTC hour anchor (0 through 23) for daily and weekly schedules. Omitted daily and weekly values default to 0 (midnight UTC).

day_of_week integer

UTC weekday anchor for weekly schedules, where 0 is Sunday and 6 is Saturday. Omitted weekly values default to Monday (1).

minute_utc integer

UTC minute anchor for daily and weekly schedules. Omitted daily and weekly values default to 0. Must be omitted whenever cadence includes hourly.

Standard: 0

Kann eine der folgenden sein: 0, 15, 30, 45

write_scope string

Has no effect: scheduled runs can change any resource in the repository, and an organization or repository policy requiring trigger-scoped writes does not apply to them.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_opened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_labeled object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

labels array of strings

Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

workflow_run object
Name, Typ, BESCHREIBUNG
workflows array of strings Erforderlich

Workflow names matched against the name in each workflow YAML file.

conclusions array of strings Erforderlich

Workflow conclusions to match. The current trigger supports failure. Supported values are: failure

query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_opened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_synchronize object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_merged object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_comment object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_comment object
Name, Typ, BESCHREIBUNG
comment_types array of strings Erforderlich

Pull request conversation and inline review comment types to match. Supported values are: timeline_comment, review_comment

query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_opened object
Name, Typ, BESCHREIBUNG
categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_updated object
Name, Typ, BESCHREIBUNG
categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_comment object
Name, Typ, BESCHREIBUNG
comment_types array of strings

Top-level discussion comments and replies to match. Omit to match both. Supported values are: comment, reply

categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_assigned object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

assignees array of strings

Affected assignee logins matched case-insensitively.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_assigned object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

assignees array of strings

Affected assignee logins matched case-insensitively.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

sub_issue_added object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_ready_for_review object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_labeled object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

labels array of strings

Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_merge_conflict object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_submitted object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

states array of strings Erforderlich

Submitted review states to match. Supported values are: approved, changes_requested, commented

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_requested object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_closed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_reopened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_closed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_reopened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_converted_to_draft object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_dismissed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_thread_resolved object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_thread_unresolved object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

automation_completed object
Name, Typ, BESCHREIBUNG
automation_ids array of strings Erforderlich

Upstream Automation IDs in the same repository.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

automation_failed object
Name, Typ, BESCHREIBUNG
automation_ids array of strings Erforderlich

Upstream Automation IDs in the same repository. An Automation cannot list itself, and a user-owned Automation can only be listed by its creator's user-owned Automations.

reasons array of strings

Failure reasons to match. Omit to match only reported failures. Supported values are: reported, crashed, timed_out

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

code_scanning_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

secret_scanning_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

dependabot_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

prompt string Erforderlich

The prompt for the automation.

model string

The model to use for sessions triggered by this automation. Omit or leave empty to let the platform select the model.

reasoning_effort string

The reasoning effort to use for sessions triggered by this automation. Omit or leave empty to use the model's default.

tools array of strings

The tools available to the automation.

enabled boolean

Whether the automation should be created enabled. Defaults to true when omitted.

Standard: true

type string

The type of automation, fixed at creation. personal keeps it private to its creator and its runs act as that user. shared makes it belong to the repository, visible to anyone with read access to the repository and maintainable by anyone with write access to the repository, and its runs act as the Copilot app rather than as a person. shared is rejected when repository ownership is not available for the repository. Supported values: personal, shared. Defaults to personal.

Standard: personal

Kann eine der folgenden sein: personal, shared

require_actor_write_permission boolean

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. When policy validation is enabled, explicitly setting false returns 422 if effective organization or repository policy disallows read-access triggers. If omitted, defaults to false when policy permits read-access triggers, otherwise true. The actor requirement does not apply to interval-scheduled runs, which always run as the automation owner.

continuous_history boolean

When true, runs of this automation build on the session history of its previous runs, and runs of the same automation are serialized. Not tracked in revision history. Defaults to false.

HTTP-Antwortstatuscodes für "Create an automation for a repository"

StatuscodeBESCHREIBUNG
201

Automation created successfully

400

Bad request

401

Authentication required

403

Insufficient permissions

404

Resource not found

422

Validation Failed

Codebeispiele für "Create an automation for a repository"

Anforderungsbeispiel

post/agents/repos/{owner}/{repo}/automations
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations \ -d '{"name":"Issue triage","type":"personal","triggers":{"issue_opened":{"query":"is:open"}},"prompt":"Inspect the new issue and suggest labels, priority, and next steps.","tools":["github/get_file_contents","github/issue_read"],"model":"gpt-6-sol","reasoning_effort":"high"}'

Automation created successfully

Status: 201
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage", "enabled": true, "type": "personal", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "prompt": "Inspect the new issue and suggest labels, priority, and next steps.", "tools": [ "github/get_file_contents", "github/issue_read" ], "model": "gpt-6-sol", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-01T12:00:00Z", "created_by": { "id": 123 } }

List available automation tools for a repository

Note

This endpoint is in public preview and is subject to change.

Lists available tools for automations in a repository, including both GitHub-provided tools and tools provided by custom MCP servers.

GitHub-provided tools are returned in named groups, with a name and description provided for each tool.

MCP entries describe configured tool selection, not live discovery or runtime availability. An explicit allowlist is returned in tools, with each id in <server-name>/<tool-name> format, for example sentry/list_issues. An allowlist of ["*"] is returned as supports_wildcard: true with an empty tools array. Server URLs, authentication headers, environment variables, and credentials are never returned.

For MCP tools, a list of configured MCP servers is provided, along with the tools allowlisted for each server. Where supports_wildcard is true, any tool that exists on the server can be used.

GitHub App installation access tokens can list available automation tools. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (read).

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "List available automation tools for a repository"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

Parameter für "List available automation tools for a repository"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

HTTP-Antwortstatuscodes für "List available automation tools for a repository"

StatuscodeBESCHREIBUNG
200

Repository automation tool catalog retrieved successfully

401

Authentication required

404

Repository not found, inaccessible, or automations unavailable

Codebeispiele für "List available automation tools for a repository"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/available-tools
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/available-tools

Repository automation tool catalog retrieved successfully

Status: 200
{ "tool_groups": [ { "id": "issues", "title": "Issues", "tools": [ { "id": "github/issue_read", "title": "Read issue", "description": "Fetch a single issue by its number, including its title, body, state, labels, assignees, and other metadata.", "scope": "read" } ] } ], "mcp_servers": [ { "name": "jira", "tools": [ { "id": "jira/search" }, { "id": "jira/get_issue" } ], "supports_wildcard": false }, { "name": "sentry", "tools": [], "supports_wildcard": true } ] }

List available automation triggers for a repository

Note

This endpoint is in public preview and is subject to change.

Lists available triggers for automations in a repository.

Each available trigger includes a title and description that can be presented in user interfaces, plus a machine-readable schema of filters supported by the trigger.

GitHub App installation access tokens can list available automation triggers. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (read).

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "List available automation triggers for a repository"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

Parameter für "List available automation triggers for a repository"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

HTTP-Antwortstatuscodes für "List available automation triggers for a repository"

StatuscodeBESCHREIBUNG
200

Available automation triggers retrieved successfully

401

Authentication required

404

Repository not found, inaccessible, or automations unavailable

Codebeispiele für "List available automation triggers for a repository"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/available-triggers
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/available-triggers

Available automation triggers retrieved successfully

Status: 200
[ { "id": "issue_opened", "title": "Issue opened", "description": "Runs when an issue is opened.", "fields": [ { "id": "query", "label": "Issue query", "required": false, "description": "Only run for issues matching this query, using [issue search syntax](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests).", "schema": { "type": "string", "minLength": 1 } }, { "id": "write_scope", "label": "Write scope", "required": false, "description": "Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default `trigger`). Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies.", "schema": { "type": "string", "enum": [ "trigger", "repository" ] } } ] } ]

Get an automation

Note

This endpoint is in public preview and is subject to change.

Fetches a repository automation by ID. The automation must be a personal automation belonging to you or a shared automation.

Shared automations are visible to anyone with read access to the repository. The created_by field identifies the creator and is distinct from the automation's type.

GitHub App installation access tokens can access shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (read). Personal automations require a user token.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "Get an automation"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

Parameter für "Get an automation"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

HTTP-Antwortstatuscodes für "Get an automation"

StatuscodeBESCHREIBUNG
200

Automation retrieved successfully

400

Bad request

401

Authentication required

404

Resource not found

Codebeispiele für "Get an automation"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/{automation_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID

Automation retrieved successfully

Status: 200
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage", "enabled": true, "type": "shared", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "prompt": "Inspect the new issue and suggest labels, priority, and next steps.", "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } }

Update an automation

Note

This endpoint is in public preview and is subject to change.

Updates an existing automation in a repository. The automation must be a personal automation belonging to you or a shared automation. Omitted fields are left unchanged. The automation's type is immutable.

GitHub App installation access tokens can update shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (write). Personal automations require a user token.

To call this endpoint, you must have write access to the repository and the "Allow automations" setting must be enabled for the repository.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "Update an automation"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (write)

Parameter für "Update an automation"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

Körperparameter
Name, Typ, BESCHREIBUNG
name string

The name of the automation.

enabled boolean

Set to true to enable, false to disable. Omit to leave unchanged.

require_actor_write_permission boolean

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. When policy validation is enabled, explicitly setting false returns 422 if effective organization or repository policy disallows read-access triggers. The actor requirement does not apply to interval-scheduled runs, which always run as the automation owner. Omit to leave unchanged.

continuous_history boolean

When true, runs of this automation build on the session history of its previous runs, and runs of the same automation are serialized. Not tracked in revision history. Omit to leave unchanged.

model string

The model to use for sessions triggered by this automation. Omit to leave unchanged. Send an empty string to clear the override and let the platform select the model.

reasoning_effort string

The reasoning effort to use for sessions triggered by this automation. Omit to leave unchanged. Send an empty string to clear the override and use the model's default.

triggers object

Trigger configuration for the automation.

Name, Typ, BESCHREIBUNG
interval object
Name, Typ, BESCHREIBUNG
cadence array of strings Erforderlich

One or more schedules on which the Automation runs. Supported values are: hourly, daily, weekly

hour_utc integer

UTC hour anchor (0 through 23) for daily and weekly schedules. Omitted daily and weekly values default to 0 (midnight UTC).

day_of_week integer

UTC weekday anchor for weekly schedules, where 0 is Sunday and 6 is Saturday. Omitted weekly values default to Monday (1).

minute_utc integer

UTC minute anchor for daily and weekly schedules. Omitted daily and weekly values default to 0. Must be omitted whenever cadence includes hourly.

Standard: 0

Kann eine der folgenden sein: 0, 15, 30, 45

write_scope string

Has no effect: scheduled runs can change any resource in the repository, and an organization or repository policy requiring trigger-scoped writes does not apply to them.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_opened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_labeled object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

labels array of strings

Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

workflow_run object
Name, Typ, BESCHREIBUNG
workflows array of strings Erforderlich

Workflow names matched against the name in each workflow YAML file.

conclusions array of strings Erforderlich

Workflow conclusions to match. The current trigger supports failure. Supported values are: failure

query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_opened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_synchronize object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_merged object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_comment object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_comment object
Name, Typ, BESCHREIBUNG
comment_types array of strings Erforderlich

Pull request conversation and inline review comment types to match. Supported values are: timeline_comment, review_comment

query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_opened object
Name, Typ, BESCHREIBUNG
categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_updated object
Name, Typ, BESCHREIBUNG
categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

discussion_comment object
Name, Typ, BESCHREIBUNG
comment_types array of strings

Top-level discussion comments and replies to match. Omit to match both. Supported values are: comment, reply

categories array of strings

Discussion category names matched case-insensitively.

body_substring string

A case-insensitive substring matched against the event body.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_assigned object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

assignees array of strings

Affected assignee logins matched case-insensitively.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_assigned object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

assignees array of strings

Affected assignee logins matched case-insensitively.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

sub_issue_added object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_ready_for_review object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_labeled object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

labels array of strings

Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_merge_conflict object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_submitted object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

states array of strings Erforderlich

Submitted review states to match. Supported values are: approved, changes_requested, commented

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_requested object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_closed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

issue_reopened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_closed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_reopened object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_converted_to_draft object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_dismissed object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_thread_resolved object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

pull_request_review_thread_unresolved object
Name, Typ, BESCHREIBUNG
query string

A GitHub issue or pull request search query.

paths array of strings

Gitignore-style changed-file path globs.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

automation_completed object
Name, Typ, BESCHREIBUNG
automation_ids array of strings Erforderlich

Upstream Automation IDs in the same repository.

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

automation_failed object
Name, Typ, BESCHREIBUNG
automation_ids array of strings Erforderlich

Upstream Automation IDs in the same repository. An Automation cannot list itself, and a user-owned Automation can only be listed by its creator's user-owned Automations.

reasons array of strings

Failure reasons to match. Omit to match only reported failures. Supported values are: reported, crashed, timed_out

write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

code_scanning_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

secret_scanning_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

dependabot_alert object

Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.

Name, Typ, BESCHREIBUNG
write_scope string

Sets the write scope for this trigger's runs. Omit to inherit the automation's effective scope (default trigger). Organization or repository policy may restrict the effective scope to trigger. Explicitly setting repository on create or edit returns 422 when policy validation is enabled and that policy applies.

Kann eine der folgenden sein: trigger, repository

allow_copilot_triggers boolean

When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422.

prompt string

The prompt for the automation.

tools array of strings

The tools available to the automation. Send an empty array to clear all tools.

HTTP-Antwortstatuscodes für "Update an automation"

StatuscodeBESCHREIBUNG
200

Automation updated successfully

400

Bad request

401

Authentication required

404

Resource not found

422

Validation Failed

Codebeispiele für "Update an automation"

Anforderungsbeispiel

patch/agents/repos/{owner}/{repo}/automations/{automation_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID \ -d '{"name":"Issue triage and prioritization","enabled":true,"model":"gpt-5.4","reasoning_effort":"high","triggers":{"issue_opened":{"query":"is:open label:auto-triage"}}}'

Automation updated successfully

Status: 200
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage and prioritization", "enabled": true, "type": "personal", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open label:auto-triage" } }, "prompt": "Inspect the new issue and suggest labels, priority, and next steps.", "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } }

Delete an automation

Note

This endpoint is in public preview and is subject to change.

Deletes an automation in a repository. The automation must be a personal automation belonging to you or a shared automation. Data dedicated to the automation is also deleted when present and may remain recoverable for a limited period according to the configured retention policy.

GitHub App installation access tokens can delete shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (write). Personal automations require a user token.

To call this endpoint, you must have write access to the repository and the "Allow automations" setting must be enabled for the repository.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "Delete an automation"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (write)

Parameter für "Delete an automation"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

HTTP-Antwortstatuscodes für "Delete an automation"

StatuscodeBESCHREIBUNG
204

Automation deleted successfully

400

Bad request

401

Authentication required

404

Resource not found

503

Automation deletion is temporarily unavailable and can be retried.

Codebeispiele für "Delete an automation"

Anforderungsbeispiel

delete/agents/repos/{owner}/{repo}/automations/{automation_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID

Automation deleted successfully

Status: 204

List revisions for an automation

Note

This endpoint is in public preview and is subject to change.

Returns a list of revisions for an automation, ordered from newest to oldest.

Access follows the automation's own ownership rules: a user-owned automation's history is readable only by its creator, and a repository-owned automation's history follows repository read access. History remains readable after the automation is deleted.

Follow the opaque cursor in the rel="next" link from the Link header to continue when more revisions are available.

Fine-grained access tokens for "List revisions for an automation"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

GitHub App installation access tokens are not supported for this endpoint.

Parameter für "List revisions for an automation"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

Abfrageparameter
Name, Typ, BESCHREIBUNG
cursor string

Opaque cursor identifying where to continue reading revision history, taken from the next link of a previous response. Omit to start from the most recent revision.

per_page integer

The number of results per page (max 100).

Standard: 30

HTTP-Antwortstatuscodes für "List revisions for an automation"

StatuscodeBESCHREIBUNG
200

Revision history retrieved successfully

400

Bad request

401

Authentication required

404

Resource not found

Codebeispiele für "List revisions for an automation"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/{automation_id}/revisions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID/revisions

Revision history retrieved successfully

Status: 200
{ "revisions": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890:000000000003", "automation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "revision_number": 3, "change_type": "edited", "creator": { "id": 123 }, "editor": { "id": 456 }, "editor_type": "user", "changed_at": "2026-05-03T14:30:00Z", "snapshot": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage", "enabled": true, "type": "shared", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "prompt": "Inspect the new issue and suggest labels, priority, and next steps.", "tools": [ "github/issue_read" ], "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } } } ] }

Get an automation revision

Note

This endpoint is in public preview and is subject to change.

Returns a specific revision of an automation, including its configuration after that change.

Access follows the automation's own ownership rules: a user-owned automation's history is readable only by its creator, and a repository-owned automation's history follows repository read access. History remains readable after the automation is deleted.

A revision ID belonging to a different automation returns 404.

Fine-grained access tokens for "Get an automation revision"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

GitHub App installation access tokens are not supported for this endpoint.

Parameter für "Get an automation revision"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

revision_id string Erforderlich

The unique identifier of the automation revision.

HTTP-Antwortstatuscodes für "Get an automation revision"

StatuscodeBESCHREIBUNG
200

Revision retrieved successfully

401

Authentication required

404

Resource not found

Codebeispiele für "Get an automation revision"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/{automation_id}/revisions/{revision_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID/revisions/REVISION_ID

Revision retrieved successfully

Status: 200
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890:000000000003", "automation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "revision_number": 3, "change_type": "edited", "creator": { "id": 123 }, "editor": { "id": 456 }, "editor_type": "user", "changed_at": "2026-05-03T14:30:00Z", "snapshot": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Issue triage", "enabled": true, "type": "shared", "require_actor_write_permission": false, "triggers": { "issue_opened": { "query": "is:open" } }, "prompt": "Inspect the new issue and suggest labels, priority, and next steps.", "tools": [ "github/issue_read" ], "model": "gpt-5.4", "reasoning_effort": "high", "created_at": "2026-05-01T12:00:00Z", "updated_at": "2026-05-03T14:30:00Z", "created_by": { "id": 123 } } }

List tasks for an automation in a repository

Note

This endpoint is in public preview and is subject to change.

Returns a paginated list of tasks created by an automation in the specified repository. The automation must belong to that exact repository.

User-owned automation history is visible only to the automation's creator. Repository-owned automation history is visible to callers with read access to repository automations. Deleted and unlisted tasks are excluded. Tasks produced by private-session agents are excluded unless the caller created the task, is a task collaborator, or the task is shared.

A missing repository, an inaccessible repository, or an automation that does not belong to the specified repository returns 404 without revealing which condition occurred.

GitHub App installation access tokens can list tasks for shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (read). Personal automations require a user token.

Fine-grained access tokens for "List tasks for an automation in a repository"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (read)

Parameter für "List tasks for an automation in a repository"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

Abfrageparameter
Name, Typ, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

The page number of the results to fetch.

Standard: 1

sort string

The field to sort results by. Can be updated_at or created_at.

Standard: updated_at

Kann eine der folgenden sein: updated_at, created_at

direction string

The direction to sort results. Can be asc or desc.

Standard: desc

Kann eine der folgenden sein: asc, desc

state string

Comma-separated list of task states to filter by. Can be any combination of: queued, in_progress, completed, failed, idle, waiting_for_user, timed_out, cancelled.

is_archived boolean

Filter by archived status. When true, returns only archived tasks. When false or omitted, returns only non-archived tasks. Defaults to false.

Standard: false

HTTP-Antwortstatuscodes für "List tasks for an automation in a repository"

StatuscodeBESCHREIBUNG
200

Automation task history retrieved successfully

401

Authentication required

404

Repository or automation not found, inaccessible, or unavailable

422

Validation failed

Codebeispiele für "List tasks for an automation in a repository"

Anforderungsbeispiel

get/agents/repos/{owner}/{repo}/automations/{automation_id}/tasks
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID/tasks

Automation task history retrieved successfully

Status: 200
{ "tasks": [ { "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012", "name": "Triage issue #42", "creator": { "id": 123 }, "creator_type": "user", "repository": { "id": 1296269 }, "state": "completed", "session_count": 1, "artifacts": [], "archived_at": null, "created_at": "2026-05-02T12:00:00Z", "updated_at": "2026-05-02T12:05:00Z" } ] }

Run an automation

Note

This endpoint is in public preview and is subject to change.

Runs an automation in a repository. Set event to manual and optionally include context of up to 10,000 characters, which will be injected into the automation's prompt.

The repository must have the "Allow automations" setting enabled, and the automation must be a personal automation belonging to you or a shared automation.

GitHub App installation access tokens can run shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (write). Personal automations require a user token.

A successful response accepts the run request and includes a preallocated task_id. User tokens can fetch it with the "Get a task by repo" Agent tasks API. GitHub App installation tokens can list tasks for the automation in the repository and match the returned task_id. The response does not confirm execution or task creation. Task creation is asynchronous, so fetching the task immediately may return 404 Not Found, and downstream skips or failures can prevent its creation.

To call this endpoint, you must have write access to the repository.

To call this endpoint, OAuth app tokens and personal access tokens (classic) need the repo scope.

Fine-grained access tokens for "Run an automation"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Agent tasks" repository permissions (write)

Parameter für "Run an automation"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
owner string Erforderlich

The account owner of the repository. The name is not case sensitive.

repo string Erforderlich

The name of the repository. The name is not case sensitive.

automation_id string Erforderlich

The unique identifier of the automation.

Körperparameter
Name, Typ, BESCHREIBUNG
event string Erforderlich

The event to trigger. Only manual is supported.

Wert: manual

context string

Additional context for this automation run, up to 10,000 characters. Supported only when event is manual. The context supplements the automation's configured instructions.

HTTP-Antwortstatuscodes für "Run an automation"

StatuscodeBESCHREIBUNG
202

Automation run request accepted for asynchronous processing

400

Bad request

401

Authentication required

403

Insufficient permissions

404

Resource not found

409

Automation usage limit reached for the current period

422

Validation failed

503

Service unavailable

Codebeispiele für "Run an automation"

Anforderungsbeispiel

post/agents/repos/{owner}/{repo}/automations/{automation_id}/tasks
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/agents/repos/OWNER/REPO/automations/AUTOMATION_ID/tasks \ -d '{"event":"manual","context":"New Sentry issue detected: https://contoso.sentry.io/issues/7796648726"}'

Automation run request accepted for asynchronous processing

Status: 202
{ "task_id": "6f7b2fd5-bc70-4f55-befe-8653bd76045f", "automation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "event": "manual" }