agent-tasks

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.

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

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.

Query parameters

per_pageinteger

The number of results per page (max 100).

pageinteger

The page number of the results to fetch.

sort'updated_at' | 'created_at'

The field to sort results by. Can be updated_at or created_at.

direction'asc' | 'desc'

The direction to sort results. Can be asc or desc.

statestring

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_archivedboolean

Filter by archived status. When true, returns only archived tasks. When false or omitted, returns only non-archived tasks. Defaults to false.

sincestring date-time

Only show tasks updated at or after this time (ISO 8601 timestamp)

creator_idinteger[]

Filter tasks by creator user ID. Accepts one or more user IDs.

Response

Tasks retrieved successfully

total_active_countinteger

Total count of active (non-archived) tasks

total_archived_countinteger

Total count of archived tasks

Changes

Changed in 7 of the 62 revisions of this API.316

    • added the optional property tasks/items/custom_agent to the response with the 200 status

      response-optional-property-added

    • for the query request parameter creator_id, the type/format was generalized from integer/ to array/

      request-parameter-type-generalized

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

  • bc41f0958ba7112See the full diff
    • added subschema #1 subschema #2 to the tasks/items/artifacts/items/data response property oneOf list for the response status 200

      response-property-one-of-added

    • added the new pull enum value to the tasks/items/artifacts/items/type response property for the response status 200

      response-property-enum-value-added

    • removed the github_resource enum value from the tasks/items/artifacts/items/type response property for the response status 200

      response-property-enum-value-removed

    • removed subschema #1 subschema #2 from the tasks/items/artifacts/items/data response property oneOf list for the response status 200

      response-property-one-of-removed

    • for the query request parameter is_archived, default value false was added

      request-parameter-default-value-added

    • endpoint added

      endpoint-added