REST API endpoints for agent tasks

Use the REST API to start and manage Copilot cloud agent tasks

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List tasks for repository

GET /agents/repos/{owner}/{repo}/tasks

Note

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

Returns a list of tasks for a specific repository
Fine-grained access tokens for "List tasks for repository"
This endpoint works with the following fine-grained token types:

GitHub App user access tokens
Fine-grained personal access tokens

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/agents/repos/OWNER/REPO/tasks

Response schema (Status: 200):

Start a task

POST /agents/repos/{owner}/{repo}/tasks

Note

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

Starts a new Copilot cloud agent task for a repository.
This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription.
Fine-grained access tokens for "Start a task"
This endpoint works with the following fine-grained token types:

GitHub App user access tokens
Fine-grained personal access tokens

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

"Agent tasks" repository permissions (read and write)

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

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/agents/repos/OWNER/REPO/tasks \
  -d '{
  "prompt": "Fix the login button on the homepage",
  "base_ref": "main"
}'

Response schema (Status: 201):

Task with a custom agent

Request:

curl -L \
  -X POST \
  https://api.github.com/agents/repos/OWNER/REPO/tasks \
  -d '{
  "prompt": "Fix the login button on the homepage",
  "base_ref": "main",
  "custom_agent": "my-custom-agent"
}'

Response schema (Status: 201):

Get a task by repo

GET /agents/repos/{owner}/{repo}/tasks/{task_id}

Note

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

Returns a task by ID scoped to an owner/repo path
Fine-grained access tokens for "Get a task by repo"
This endpoint works with the following fine-grained token types:

GitHub App user access tokens
Fine-grained personal access tokens

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/agents/repos/OWNER/REPO/tasks/TASK_ID

Response schema (Status: 200):

List tasks

GET /agents/tasks

Note

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

Returns a list of tasks for the authenticated user
Fine-grained access tokens for "List tasks"
This endpoint works with the following fine-grained token types:

GitHub App user access tokens
Fine-grained personal access tokens

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/agents/tasks

Response schema (Status: 200):

Same response schema as List tasks for repository.

Get a task by ID

GET /agents/tasks/{task_id}

Note

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

Returns a task by ID with its associated sessions
Fine-grained access tokens for "Get a task by ID"
This endpoint works with the following fine-grained token types:

GitHub App user access tokens
Fine-grained personal access tokens

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/agents/tasks/TASK_ID

Response schema (Status: 200):

Same response schema as Get a task by repo.