Skip to content

GitHub: Agent tasks schemas

5 GitHub schemas with complete fields and constraints.

← Agent tasks operations · All schemas

Get a task by ID — response body — creator_type: user, organization

FieldTypePresenceDescription and constraints
$objectRoot
archived_atJSONOptional
archived_at (anyOf 1)stringAlternativeTimestamp when the task was archived, null if not archived
Format: date-time
archived_at (anyOf 2)nullAlternative
artifactsarrayOptionalResources created by this task (PRs, branches, etc.)
artifacts[]ModelEach itemExpand Start a task — response body — artifacts item
created_atstringRequired within parentTimestamp when the task was created
Format: date-time
creatorJSONOptionalThe entity who created this task
creator (anyOf 1)objectAlternativeA GitHub user
creator (anyOf 1).idJSONOptional
creator (anyOf 1).id (anyOf 1)integerAlternativeThe unique identifier of the user
Format: int64
creator (anyOf 1).id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
creator_typestringOptionalType of the task creator
Known values: user, organization
custom_agentobjectOptionalCustom agent metadata associated with this task
custom_agent.idstringOptionalThe custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent.
html_urlstringOptionalWeb URL for this task
idstringRequired within parentUnique task identifier
namestringOptionalHuman-readable name derived from the task prompt
ownerobjectOptionalThe owner of the repository
owner.idJSONOptional
owner.id (anyOf 1)integerAlternativeThe unique identifier of the user
Format: int64
owner.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
repositoryobjectOptionalThe repository this task belongs to
repository.idJSONOptional
repository.id (anyOf 1)integerAlternativeThe unique identifier of the repository
Format: int64
repository.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
session_countJSONOptional
session_count (anyOf 1)integerAlternativeNumber of sessions in this task
Format: int32
session_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
statestringRequired within parentCurrent state of the task, derived from its most recent session
Known values: queued, in_progress, completed, failed, idle, waiting_for_user, timed_out, cancelled
updated_atstringOptionalTimestamp of the most recent update
Format: date-time
urlstringOptionalAPI URL for this task
user_collaboratorsarrayOptionalUser objects of collaborators on this task
user_collaborators[]objectEach itemA GitHub user
user_collaborators[].idJSONOptional
user_collaborators[].id (anyOf 1)integerAlternativeThe unique identifier of the user
Format: int64
user_collaborators[].id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Start a task — response body — artifacts item

Get a task by ID — response body — sessions

FieldTypePresenceDescription and constraints
$objectRoot
sessionsarrayOptionalSessions associated with this task
sessions[]ModelEach itemExpand Get a task by ID — response body — sessions sessions item

Referenced models: Get a task by ID — response body — sessions sessions item

Get a task by ID — response body — sessions sessions item

FieldTypePresenceDescription and constraints
$objectRootFull session details within a task
base_refstringOptionalBase branch name
completed_atstringOptionalCompletion timestamp
Format: date-time
created_atstringRequired within parentCreation timestamp
Format: date-time
errorobjectOptionalError details for a failed session
error.messagestringOptionalError message
head_refstringOptionalHead branch name
idstringRequired within parentSession ID
modelstringOptionalModel used for this session
namestringOptionalSession name
ownerobjectOptionalThe owner of the repository
owner.idJSONOptional
owner.id (anyOf 1)integerAlternativeThe unique identifier of the user
Format: int64
owner.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
promptstringOptionalContent of the triggering event
repositoryobjectOptionalThe repository this session belongs to
repository.idJSONOptional
repository.id (anyOf 1)integerAlternativeThe unique identifier of the repository
Format: int64
repository.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
statestringRequired within parentCurrent state of a session
Known values: queued, in_progress, completed, failed, idle, waiting_for_user, timed_out, cancelled
task_idstringOptionalTask ID this session belongs to
updated_atstringOptionalLast update timestamp
Format: date-time
usageModelOptionalExpand Get a task by ID — response body — sessions sessions item usage
userobjectOptionalThe user who created this session
user.idJSONOptional
user.id (anyOf 1)integerAlternativeThe unique identifier of the user
Format: int64
user.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Get a task by ID — response body — sessions sessions item usage

Get a task by ID — response body — sessions sessions item usage

FieldTypePresenceDescription and constraints
$objectRootStructured information about billing units consumed by the session.
amountJSONRequired within parent
amount (anyOf 1)numberAlternativeNumber of billing units used by this session. When the `type` is `ai_credits`, the value is a whole number, expressed in nano units. When presenting this to a human, divide by 1,000,000,000 and round to one decimal place. When aggregating (for example, summing usage across sessions), sum the nano values first, and divide once at the end before presenting to a human to avoid losing precision. When the `type` is `premium_requests`, the value may be fractional (for example `1.5`).
Format: double
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
typestringRequired within parentBilling unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`.
Known values: ai_credits, premium_requests

Start a task — response body — artifacts item

FieldTypePresenceDescription and constraints
$objectRootA resource generated by the task
dataJSONRequired within parentResource data (shape depends on type)
data (anyOf 1)objectAlternativeA GitHub resource (pull request, issue, etc.)
data (anyOf 1).global_idstringOptionalGraphQL global ID
data (anyOf 1).idJSONRequired within parent
data (anyOf 1).id (anyOf 1)integerAlternativeGitHub resource ID
Format: int64
data (anyOf 1).id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
data (anyOf 2)objectAlternativeA Git branch reference
data (anyOf 2).base_refstringRequired within parentBase branch name
data (anyOf 2).head_refstringRequired within parentHead branch name
providerstringRequired within parentProvider namespace
Known values: github
typestringRequired within parentType of artifact. Available Values: `pull`, `branch`.

Known values: pull, branch

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.