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

# List an execution's trace spans

> Returns the spans of an Automation execution's trace as a flat list, ordered by start time, then id.
Rebuild the tree from `parent_id`.

Spans in this list leave out their attributes, which hold prompts, completions and tool arguments and
can be large. Get one span to read them.




## OpenAPI

````yaml /openapi/platform-v1.yaml get /api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans
openapi: 3.0.1
info:
  title: CrewAI Platform API
  version: v1
  description: Supported public API for CrewAI Platform.
servers:
  - url: https://app.crewai.com
    description: Current CrewAI Platform host
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Users in the organization.
  - name: Status
    description: Platform health and API availability.
  - name: Automations
    description: >-
      Automations, their source artifacts, their executions, and their
      schedules.
  - name: Teams
    description: Teams in the organization.
  - name: Group Mappings
    description: Identity-provider group mappings to Teams.
  - name: Service Accounts
    description: Service accounts in the organization.
  - name: Webhook Endpoints
    description: Endpoints that receive signed event deliveries.
  - name: Studio Projects
    description: Projects built in Crew Studio.
  - name: Environment Variables
    description: Environment variables in the organization.
  - name: Git Repositories
    description: Git repositories connected to the organization.
  - name: LLM Connections
    description: Connections to LLM providers.
  - name: Tools
    description: Tools in the organization's tool repository.
paths:
  /api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans:
    parameters:
      - name: automation_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          example: 4f6d0d9a-7b78-4c6a-b64f-2e2e3d2c8f9a
      - name: execution_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          example: 4f6d0d9a-7b78-4c6a-b64f-2e2e3d2c8f9a
      - name: page_size
        in: query
        required: false
        description: >-
          Maximum number of spans to return. Defaults to 100; values above 1000
          are reduced to 1000.
        schema:
          type: integer
          minimum: 1
          default: 100
      - name: page_token
        in: query
        required: false
        description: >-
          Continues after the last span of a previous page. Pass
          `meta.next_page_token` from that response.
        schema:
          type: string
    get:
      tags:
        - Automations
      summary: List an execution's trace spans
      description: >
        Returns the spans of an Automation execution's trace as a flat list,
        ordered by start time, then id.

        Rebuild the tree from `parent_id`.


        Spans in this list leave out their attributes, which hold prompts,
        completions and tool arguments and

        can be large. Get one span to read them.
      operationId: listAutomationExecutionTraceSpans
      responses:
        '200':
          description: OK
          content:
            application/json:
              examples:
                success:
                  value:
                    data:
                      - id: a1b2c3d4e5f60718
                        parent_id: 0f1e2d3c4b5a6978
                        name: call llm
                        type: llm_call
                        status: ok
                        started_at: '2026-07-07T00:00:01.250000Z'
                        finished_at: '2026-07-07T00:00:03.500000Z'
                        duration_ms: 2250
                        input_tokens: 812
                        output_tokens: 164
                    meta:
                      total_size: 1
                      next_page_token: null
                      complete: true
              schema:
                type: object
                required:
                  - data
                  - meta
                additionalProperties: false
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - parent_id
                        - name
                        - type
                        - status
                        - started_at
                        - finished_at
                        - duration_ms
                        - input_tokens
                        - output_tokens
                      additionalProperties: false
                      properties:
                        id:
                          type: string
                          example: a1b2c3d4e5f60718
                          description: The span id, 16 lowercase hex characters.
                        parent_id:
                          type: string
                          example: 0f1e2d3c4b5a6978
                          nullable: true
                          description: >-
                            The id of the enclosing span, or null for a root
                            span. The parent can be missing from the trace while
                            the execution runs, because a span is recorded only
                            once it ends.
                        name:
                          type: string
                          example: call llm
                          description: The span name the runtime reported.
                        type:
                          type: string
                          enum:
                            - flow
                            - flow_method
                            - crew
                            - task
                            - agent
                            - agent_reasoning
                            - llm_call
                            - tool_call
                            - tool_failure
                            - mcp_connection
                            - memory
                            - knowledge
                            - guardrail
                            - policy
                            - human_feedback
                            - skill
                            - other
                          example: llm_call
                          description: >
                            What the span records:

                            - `flow`: A flow run.

                            - `flow_method`: One method of a flow.

                            - `crew`: A crew run.

                            - `task`: One task of a crew.

                            - `agent`: An agent working on a task, or a
                            standalone agent run.

                            - `agent_reasoning`: An agent planning before it
                            acts.

                            - `llm_call`: One call to a language model.

                            - `tool_call`: One tool call, MCP tools included.

                            - `tool_failure`: A tool call that failed.

                            - `mcp_connection`: A connection to an MCP server.

                            - `memory`: A memory read or write.

                            - `knowledge`: A knowledge query or search.

                            - `guardrail`: A guardrail evaluation.

                            - `policy`: A policy evaluation.

                            - `human_feedback`: A request for, or the answer to,
                            human input.

                            - `skill`: Discovering, loading or using a skill.

                            - `other`: Any other span. Use `name` to tell these
                            apart.
                        status:
                          type: string
                          enum:
                            - ok
                            - error
                            - unknown
                          example: ok
                          description: >
                            How the span ended:

                            - `ok`: The operation succeeded.

                            - `error`: The operation failed. A span detail
                            carries the reason in `status_message`.

                            - `unknown`: The span reported no status the
                            platform recognizes.
                        started_at:
                          type: string
                          format: date-time
                          example: '2026-07-07T00:00:01.250000Z'
                        finished_at:
                          type: string
                          format: date-time
                          example: '2026-07-07T00:00:03.500000Z'
                        duration_ms:
                          type: integer
                          nullable: true
                          example: 2250
                        input_tokens:
                          type: integer
                          nullable: true
                          example: 812
                          description: Prompt tokens of an LLM call.
                        output_tokens:
                          type: integer
                          nullable: true
                          example: 164
                          description: Completion tokens of an LLM call.
                  meta:
                    type: object
                    required:
                      - total_size
                      - next_page_token
                      - complete
                    additionalProperties: false
                    properties:
                      total_size:
                        type: integer
                        minimum: 0
                        description: Number of spans in the trace.
                      next_page_token:
                        type: string
                        nullable: true
                        description: Token for the next page, or null on the last page.
                      complete:
                        type: boolean
                        description: >-
                          False while the execution runs, or when the trace
                          holds more spans than the platform returns (5,000). A
                          trace that is not complete may be missing spans.
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                unauthorized:
                  value:
                    errors:
                      - type: >-
                          https://docs-platform.crewai.com/api/problems/unauthorized
                        code: unauthorized
                        title: Unauthorized
                        status: 401
                        detail: Missing or invalid bearer token.
                  summary: Missing or invalid bearer token
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                not_found:
                  value:
                    errors:
                      - type: >-
                          https://docs-platform.crewai.com/api/problems/not_found
                        code: not_found
                        title: Not found
                        status: 404
                        detail: The requested resource could not be found.
                  summary: The execution is not one of the Automation's kickoffs
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              examples:
                invalid_page_token:
                  value:
                    errors:
                      - type: >-
                          https://docs-platform.crewai.com/api/problems/validation_error
                        code: validation_error
                        title: Validation error
                        status: 422
                        detail: page_token is not valid.
                  summary: A page token this endpoint did not issue
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    ErrorEnvelope:
      type: object
      required:
        - errors
      additionalProperties: false
      properties:
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Error'
    Error:
      type: object
      description: Public API error object.
      required:
        - type
        - code
        - title
        - status
        - detail
      additionalProperties: false
      properties:
        type:
          type: string
          format: uri
          enum:
            - https://docs-platform.crewai.com/api/problems/bad_request
            - https://docs-platform.crewai.com/api/problems/clipper_disabled
            - https://docs-platform.crewai.com/api/problems/clipper_disallowed
            - >-
              https://docs-platform.crewai.com/api/problems/clipper_feature_disabled
            - https://docs-platform.crewai.com/api/problems/clipper_not_found
            - https://docs-platform.crewai.com/api/problems/conflict
            - https://docs-platform.crewai.com/api/problems/forbidden
            - https://docs-platform.crewai.com/api/problems/internal_error
            - https://docs-platform.crewai.com/api/problems/not_found
            - https://docs-platform.crewai.com/api/problems/service_unavailable
            - >-
              https://docs-platform.crewai.com/api/problems/tool_execution_failed
            - https://docs-platform.crewai.com/api/problems/unauthorized
            - https://docs-platform.crewai.com/api/problems/validation_error
          example: https://docs-platform.crewai.com/api/problems/bad_request
        code:
          type: string
          enum:
            - bad_request
            - clipper_disabled
            - clipper_disallowed
            - clipper_feature_disabled
            - clipper_not_found
            - conflict
            - forbidden
            - internal_error
            - not_found
            - service_unavailable
            - tool_execution_failed
            - unauthorized
            - validation_error
          example: bad_request
        title:
          type: string
          x-crewai-enum-format: freeform
          enum:
            - Bad request
            - Clipper resource disabled
            - Clipper resource disallowed
            - Clipper feature disabled
            - Clipper resource not found
            - Conflict
            - Forbidden
            - Internal error
            - Not found
            - Service unavailable
            - Tool execution failed
            - Unauthorized
            - Validation error
          example: Bad request
        status:
          type: integer
          enum:
            - 400
            - 401
            - 403
            - 404
            - 409
            - 422
            - 500
            - 503
          example: 400
        detail:
          type: string
          example: The request is invalid.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.