GET
GET /agents/tasks — GitHub API
GitHub token (required); https://api.github.com
GitHub APIList tasks
- 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
→ 323 tokens · Vary: Accept
→ 323 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 GET 'https://api.github.com/agents/tasks?per_page=30&page=1&sort=updated_at&direction=desc&state=example-state&is_archived=false&since=example-since' \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2026-03-10'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| per_page | query | integer | No | The number of results per page (max 100). |
| page | query | integer | No | The page number of the results to fetch. |
| sort | query | string | No | The field to sort results by. Can be `updated_at` or `created_at`. |
| direction | query | string | No | The direction to sort results. Can be `asc` or `desc`. |
| state | query | string | No | 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 | query | boolean | No | Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. |
| since | query | string | No | Only show tasks updated at or after this time (ISO 8601 timestamp) |
Response 200 OK
{
"tasks": [
{
"id": "string",
"url": "string",
"html_url": "string",
"name": "string",
"creator": {
"id": 0
},
"creator_type": "user",
"user_collaborators": [
{
"id": 0
}
],
"owner": {
"id": 0
},
"repository": {
"id": 0
},
"state": "queued",
"session_count": 0,
"artifacts": [
{
"provider": "github",
"type": "pull",
"data": {
"id": "[recursive or deeply nested schema]",
"global_id": "[recursive or deeply nested schema]"
}
}
],
"archived_at": "2026-09-03T00:00:00Z",
"updated_at": "2026-09-03T00:00:00Z",
"created_at": "2026-09-03T00:00:00Z",
"custom_agent": {
"id": "string"
}
}
],
"total_active_count": 0,
"total_archived_count": 0
} Get a free GitHub API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.