POST
POST /agents/repos/{owner}/{repo}/automations — GitHub API
GitHub token (required); https://api.github.com
GitHub APICreate an automation for a repository
- Base URL
- https://api.github.com
- Auth
- Authorization: Bearer <GITHUB_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 375 tokens · Vary: Accept
→ 375 tokens · Vary: Accept
Critical gotchas
GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.
Fine-grained tokens only authorize repositories and permissions selected when the token is created.
cURL
curl -X POST 'https://api.github.com/agents/repos/example-owner/example-repo/automations' \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2026-03-10' \ -H 'Content-Type: application/json' \ -d '{ "name": "example-name", "prompt": "example-prompt"}'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| owner | path | string | Yes | The account owner of the repository. The name is not case sensitive. |
| repo | path | string | Yes | The name of the repository. The name is not case sensitive. |
| name | body | string | Yes | The name of the automation. |
| triggers | body | object | No | Public trigger configuration keyed by stable public trigger identifier. Each trigger has a closed, trigger-specific configuration schema. |
| prompt | body | string | Yes | The prompt template for the automation. |
| model | body | string | No | The model to use for sessions triggered by this automation. Omit to use the platform default. |
| reasoning_effort | body | string | No | The reasoning effort to use for sessions triggered by this automation. Omit or leave empty for no override. Currently supported values: `none`, `low`, `medium`, `high`, `xhigh`, `max` |
| tools | body | string[] | No | The tools available to the automation. |
| allowed_custom_agents | body | string[] | No | Custom agents (subagents) this automation is allowed to invoke. |
| enabled | body | boolean | No | Whether the automation should be created enabled. Defaults to true when omitted. |
| owner_type | body | string | No | Who owns the automation, fixed at creation. `user` keeps it private to its creator and its runs act as that user. `repository` 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. `repository` is rejected when repository ownership is not available for the repository. Supported values: `user`, `repository`. Defaults to `user`. |
| write_scope | body | string | No | Controls which repository resources a run may modify. `trigger` limits writes to the resource that started the run, when one exists, and resources created during the run; `repository` allows writes to any resource in the repository. Supported values: `trigger`, `repository`. |
| require_actor_write_permission | body | boolean | No | When true, event-triggered runs require the event actor to have repo write permission, even when the org's allow_read_access_triggers policy is enabled. Does not apply to interval-scheduled runs, which always run as the automation owner. Defaults to false. |
Response 200 OK
{
"id": "string",
"name": "string",
"enabled": true,
"owner_type": "user",
"write_scope": "trigger",
"require_actor_write_permission": false,
"triggers": {
"interval": {
"cadence": [
"hourly"
],
"hour_utc": 0,
"day_of_week": 0,
"minute_utc": 0,
"write_scope": "trigger"
},
"issue_opened": {
"query": "string",
"write_scope": "trigger"
},
"issue_labeled": {
"query": "string",
"labels": [
"string"
],
"write_scope": "trigger"
},
"workflow_run": {
"workflows": [
"string"
],
"conclusions": [
"failure"
],
"query": "string",
"write_scope": "trigger"
},
"pull_request_opened": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"pull_request_synchronize": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"pull_request_merged": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"issue_comment": {
"body_substring": "string",
"write_scope": "trigger"
},
"pull_request_comment": {
"comment_types": [
"timeline_comment"
],
"body_substring": "string",
"write_scope": "trigger"
},
"discussion_opened": {
"categories": [
"string"
],
"body_substring": "string",
"write_scope": "trigger"
},
"discussion_updated": {
"categories": [
"string"
],
"body_substring": "string",
"write_scope": "trigger"
},
"discussion_comment": {
"comment_types": [
"comment"
],
"categories": [
"string"
],
"body_substring": "string",
"write_scope": "trigger"
},
"issue_assigned": {
"query": "string",
"assignees": [
"string"
],
"write_scope": "trigger"
},
"pull_request_assigned": {
"query": "string",
"paths": [
"string"
],
"assignees": [
"string"
],
"write_scope": "trigger"
},
"sub_issue_added": {
"query": "string",
"write_scope": "trigger"
},
"pull_request_ready_for_review": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"pull_request_labeled": {
"query": "string",
"paths": [
"string"
],
"labels": [
"string"
],
"write_scope": "trigger"
},
"pull_request_merge_conflict": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"pull_request_review_submitted": {
"query": "string",
"paths": [
"string"
],
"states": [
"approved"
],
"write_scope": "trigger"
},
"pull_request_review_requested": {
"query": "string",
"paths": [
"string"
],
"write_scope": "trigger"
},
"automation_completed": {
"automation_ids": [
"string"
],
"write_scope": "trigger"
}
},
"prompt": "string",
"tools": [
"string"
],
"allowed_custom_agents": [
"string"
],
"model": "string",
"reasoning_effort": "string",
"created_at": "2026-09-03T00:00:00Z",
"updated_at": "2026-09-03T00:00:00Z",
"created_by": {
"id": 0
}
} Get a free GitHub API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.