> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# List session tasks

> Requires `workspaces:read` and `agents:read` -- see the note on session events above about the `500` when `agents:read` is missing.



## OpenAPI

````yaml /api-reference/openapi.yaml get /sessions/{session_id}/tasks
openapi: 3.0.3
info:
  title: Guild Public API
  version: 1.0.0
  description: >-
    The Guild public API, served at https://api.guild.ai/v1. Authenticate with
    an account API key, sent as HTTP Basic (key id as the username, secret as
    the password) or as a Bearer token `<key id>:<secret>`, or with an OAuth 2.0
    access token. Each operation lists the credentials it accepts and the scopes
    it needs; see https://docs.guild.ai/api-reference/introduction#scopes.
    Versions are path integers and v1 is the only one: a breaking change ships
    as a new version rather than changing v1. Lists page with `limit` and
    `offset` and report `pagination.has_more`. A session-events websocket also
    exists at wss://api.guild.ai/v1/sessions/{session_id}/events/ws with the
    same credentials on the handshake; OpenAPI cannot describe websockets, so it
    is not listed in paths.
servers:
  - url: https://api.guild.ai/v1
    description: Production
security: []
tags:
  - name: accounts
  - name: agents
  - name: integrations
  - name: other
  - name: sessions
  - name: skills
  - name: triggers
  - name: workspaces
paths:
  /sessions/{session_id}/tasks:
    get:
      tags:
        - sessions
      summary: List session tasks
      description: >-
        Requires `workspaces:read` and `agents:read` -- see the note on session
        events above about the `500` when `agents:read` is missing.
      operationId: gen_session_tasks
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
        - bearerApiKey: []
        - oauth2:
            - sessions:read
components:
  parameters:
    Limit:
      name: limit
      in: query
      required: false
      schema:
        default: 20
        description: Maximum number of items to return.
        maximum: 500
        minimum: 0
        title: Limit
        type: integer
    Offset:
      name: offset
      in: query
      required: false
      schema:
        default: 0
        description: Number of items to skip before returning results.
        maximum: 9223372036854776000
        minimum: 0
        title: Offset
        type: integer
  schemas:
    Task:
      oneOf:
        - $ref: '#/components/schemas/TaskAgent'
        - $ref: '#/components/schemas/TaskTool'
    Pagination:
      type: object
      properties:
        total_count:
          description: Items matching the request across all pages.
          type: integer
        limit:
          description: Page size of this response.
          type: integer
        offset:
          description: Items skipped before this page.
          type: integer
        has_more:
          description: Whether another page follows; request it with offset + limit.
          type: boolean
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    TaskAgent:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        session_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - CREATED
            - DISPATCHED
            - STARTED
            - RUNNING
            - WAITING
            - ERROR
            - DONE
            - INTERRUPTED
        notified_at:
          type: string
          format: date-time
          nullable: true
          description: |-
            Date and time when this task output was sent to the runtime.
                            This should be None if the task is not DONE or ERROR, or if the
                            runtime hasn't been resumed yet.
        parent_task_id:
          type: string
          format: uuid
          nullable: true
        runtime_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            An optional runtime, if the agent is not run in the default Guild
            runtime.
        saved_state:
          type: string
          nullable: true
        span_id:
          nullable: true
          description: >-
            Span id of the single invoke_agent span that covers this agent task
            across all of its start/resume executions.
        trace_id:
          nullable: true
        version_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            The version of the agent that this task is running. If None, it
            means we're running the assistant.
        agent: {}
        cache_read_tokens: {}
        cache_write_tokens: {}
        input_tokens: {}
        llm_call_count: {}
        output_tokens: {}
        parent_task: {}
        token_usage: {}
        total_tokens: {}
        version: {}
    TaskTool:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        parent_task_id:
          type: string
          format: uuid
        session_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - CREATED
            - DISPATCHED
            - STARTED
            - RUNNING
            - WAITING
            - ERROR
            - DONE
            - INTERRUPTED
        tool_call_id:
          type: string
        tool_name:
          type: string
          maxLength: 255
        http_status_code:
          type: integer
          nullable: true
          description: The HTTP response code of the response
        notified_at:
          type: string
          format: date-time
          nullable: true
          description: |-
            Date and time when this task output was sent to the runtime.
                            This should be None if the task is not DONE or ERROR, or if the
                            runtime hasn't been resumed yet.
        request_bytes:
          type: integer
          nullable: true
          description: The number of bytes in the outgoing request
        response_bytes:
          type: integer
          nullable: true
          description: The number of bytes in the response
        response_data:
          type: string
          nullable: true
          description: >-
            Full JSON response body, stored only when the response was projected
            due to size
        parent_task: {}
        token_usage: {}
  securitySchemes:
    apiKey:
      type: http
      scheme: basic
      description: >-
        API key: key id as the username, secret as the password. An account API
        key carries the same scopes as an OAuth token and is checked against the
        scopes listed under oauth2 on each operation. A trigger API key is
        limited to its trigger's workspace and reaches only the session
        operations that list this scheme alongside the oauth2 scopes.
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: <key id>:<secret>
      description: >-
        The same API key as one Bearer token, `<key id>:<secret>`. An account
        API key carries the same scopes as an OAuth token and is checked against
        the scopes listed under oauth2 on each operation. A trigger API key is
        limited to its trigger's workspace and reaches only the session
        operations that list this scheme alongside the oauth2 scopes.
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 authorization code flow with PKCE (S256). Discovery:
        https://api.guild.ai/.well-known/oauth-authorization-server.
      flows:
        authorizationCode:
          authorizationUrl: https://api.guild.ai/v1/oauth/authorize
          tokenUrl: https://api.guild.ai/v1/oauth/token
          refreshUrl: https://api.guild.ai/v1/oauth/token
          scopes:
            agents:read: Read agents
            agents:write: Read and change agents
            sessions:read: Read sessions
            sessions:write: Read and change sessions
            workspaces:read: Read workspaces
            workspaces:write: Read and change workspaces
            skills:read: Read skills
            skills:write: Read and change skills
            integrations:read: Read integrations
            integrations:write: Read and change integrations
            applications:read: Read applications
            applications:write: Read and change applications
            organizations:read: Read organizations
            organizations:write: Read and change organizations

````