List tasks for repository
[!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:
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
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository. The name is not case sensitive.
Query Parameters
Section titled “ Query Parameters ”The number of results per page (max 100).
The page number of the results to fetch.
The field to sort results by. Can be updated_at or created_at.
The direction to sort results. Can be asc or desc.
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.
Filter by archived status. When true, returns only archived tasks. When false or omitted, returns only non-archived tasks. Defaults to false.
Only show tasks updated at or after this time (ISO 8601 timestamp)
Filter tasks by creator user ID. Accepts one or more user IDs.
Responses
Section titled “ Responses ”Tasks retrieved successfully
object
List of tasks
object
Unique task identifier
API URL for this task
Web URL for this task
Human-readable name derived from the task prompt
A GitHub user
object
The unique identifier of the user
Type of the task creator
User objects of collaborators on this task
A GitHub user
object
The unique identifier of the user
The owner of the repository
object
The unique identifier of the user
The repository this task belongs to
object
The unique identifier of the repository
Current state of the task, derived from its most recent session
Number of sessions in this task
Resources created by this task (PRs, branches, etc.)
A resource generated by the task
object
Provider namespace
Type of artifact. Available Values: pull, branch.
Timestamp when the task was archived, null if not archived
Timestamp of the most recent update
Timestamp when the task was created
Custom agent metadata associated with this task
object
The custom agent’s filename without the extension - for example, performance-optimizer for a .github/agents/performance-optimizer.agent.md custom agent.
Total count of active (non-archived) tasks
Total count of archived tasks
Examples
{ "tasks": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "url": "https://api.github.com/agents/repos/octocat/hello-world/tasks/a1b2c3d4-e5f6-7890-abcd-ef1234567890", "html_url": "https://github.com/octocat/hello-world/copilot/tasks/a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Fix the login button on the homepage", "creator": { "id": 1 }, "creator_type": "user", "owner": { "id": 1 }, "repository": { "id": 1296269 }, "state": "completed", "session_count": 1, "artifacts": [ { "provider": "github", "type": "pull", "data": { "id": 42 } } ], "archived_at": null, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-01T01:00:00Z" } ]}Headers
Section titled “ Headers ”Pagination links. Contains rel=“first” (always), rel=“prev” (when current page > 1), rel=“next” (when more pages exist), and rel=“last” (when on the final page).
Example
<https://api.github.com/agents/repos/{owner}/{repo}/tasks?page=2&per_page=30>; rel="next", <https://api.github.com/agents/repos/{owner}/{repo}/tasks?page=1&per_page=30>; rel="first"Bad request
Structured error response following GitHub REST API conventions. For 422 Unprocessable Entity the errors array contains validation details; for other error status codes only message and documentation_url are returned.
object
Summary message (e.g. “Validation Failed”, “Not Found”)
List of validation errors (present only for 422 responses)
A single validation error
object
Machine-readable error code
Human-readable message (populated when code is “custom”)
URL to relevant API documentation
Example
{ "errors": [ { "code": "missing" } ]}Authentication required
Structured error response following GitHub REST API conventions. For 422 Unprocessable Entity the errors array contains validation details; for other error status codes only message and documentation_url are returned.
object
Summary message (e.g. “Validation Failed”, “Not Found”)
List of validation errors (present only for 422 responses)
A single validation error
object
Machine-readable error code
Human-readable message (populated when code is “custom”)
URL to relevant API documentation
Example
{ "errors": [ { "code": "missing" } ]}Insufficient permissions
Structured error response following GitHub REST API conventions. For 422 Unprocessable Entity the errors array contains validation details; for other error status codes only message and documentation_url are returned.
object
Summary message (e.g. “Validation Failed”, “Not Found”)
List of validation errors (present only for 422 responses)
A single validation error
object
Machine-readable error code
Human-readable message (populated when code is “custom”)
URL to relevant API documentation
Example
{ "errors": [ { "code": "missing" } ]}Resource not found
Structured error response following GitHub REST API conventions. For 422 Unprocessable Entity the errors array contains validation details; for other error status codes only message and documentation_url are returned.
object
Summary message (e.g. “Validation Failed”, “Not Found”)
List of validation errors (present only for 422 responses)
A single validation error
object
Machine-readable error code
Human-readable message (populated when code is “custom”)
URL to relevant API documentation
Example
{ "errors": [ { "code": "missing" } ]}Validation Failed
Structured error response following GitHub REST API conventions. For 422 Unprocessable Entity the errors array contains validation details; for other error status codes only message and documentation_url are returned.
object
Summary message (e.g. “Validation Failed”, “Not Found”)
List of validation errors (present only for 422 responses)
A single validation error
object
Machine-readable error code
Human-readable message (populated when code is “custom”)
URL to relevant API documentation
Example
{ "errors": [ { "code": "missing" } ]}