v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
agent-tasks

Get a task by repo

[!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:

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.

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

Path parameters

ownerstring required

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

repostring required

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

task_idstring required

The unique identifier of the task.

Response

Task retrieved successfully

idstring required

Unique task identifier

urlstring

API URL for this task

html_urlstring

Web URL for this task

namestring

Human-readable name derived from the task prompt

creator_type'user' | 'organization'

Type of the task creator

state'queued' | 'in_progress' | 'completed' | 'failed' | 'idle' | 'waiting_for_user' | 'timed_out' | 'cancelled' required

Current state of the task, derived from its most recent session

session_countinteger

Number of sessions in this task

archived_atstring date-time nullable

Timestamp when the task was archived, null if not archived

updated_atstring date-time

Timestamp of the most recent update

created_atstring date-time required

Timestamp when the task was created