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

# Get span export status

> Retrieve the status, and when complete the result location, of an async span export.

Poll this with the ``export_id`` returned by POST /v5/spans/export. Only
exports that ran as async jobs on the ClickHouse-backed tracing service have a
pollable status; synchronous Postgres exports return their result directly and
have no export id to poll here. The lookup is proxied to the tracing service
and scoped to the caller's account; a tracing-service failure surfaces as a 503.



## OpenAPI

````yaml https://api.sgp.scale.com/openapi-versions/v5/openapi.json get /v5/spans/export/{export_id}
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/spans/export/{export_id}:
    get:
      tags:
        - Spans
      summary: Get span export status
      description: >-
        Retrieve the status, and when complete the result location, of an async
        span export.


        Poll this with the ``export_id`` returned by POST /v5/spans/export. Only

        exports that ran as async jobs on the ClickHouse-backed tracing service
        have a

        pollable status; synchronous Postgres exports return their result
        directly and

        have no export id to poll here. The lookup is proxied to the tracing
        service

        and scoped to the caller's account; a tracing-service failure surfaces
        as a 503.
      operationId: GET-V5-/v5/spans/export/export_id
      parameters:
        - name: export_id
          in: path
          required: true
          schema:
            type: string
            title: Export Id
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpansExportStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SpansExportStatusResponse:
      properties:
        export_id:
          type: string
          title: Export Id
          description: The export id echoed back.
        status:
          type: string
          enum:
            - running
            - succeeded
            - failed
          title: Status
          description: Lifecycle state.
        run_id:
          title: Run Id
          description: Temporal run id of the export workflow.
          type: string
        rows_written:
          title: Rows Written
          description: Rows written so far (running).
          type: integer
        bytes_written:
          title: Bytes Written
          description: Bytes written so far (running).
          type: integer
        shards_completed:
          title: Shards Completed
          description: Shards completed so far (running).
          type: integer
        shards_total:
          title: Shards Total
          description: Total shards in the plan (running).
          type: integer
        filename:
          title: Filename
          description: Name of the exported file (succeeded).
          type: string
        signed_url:
          title: Signed Url
          description: Pre-signed download URL (succeeded).
          type: string
        expires_at:
          title: Expires At
          description: When the signed URL expires.
          type: string
          format: date-time
        from_ts:
          title: From Ts
          description: Resolved start of the window.
          type: string
          format: date-time
        to_ts:
          title: To Ts
          description: Resolved end of the window.
          type: string
          format: date-time
        snapshot_ts:
          title: Snapshot Ts
          description: Snapshot the export read at.
          type: string
          format: date-time
        truncated:
          $ref: '#/components/schemas/SpansExportTruncation'
          description: Present when the export hit a budget.
        reason:
          title: Reason
          description: Terminal failure reason, incl. not_found.
          type: string
        guidance:
          title: Guidance
          description: Human-readable, actionable next step for a failed export (failed).
          type: string
      type: object
      required:
        - export_id
        - status
      title: SpansExportStatusResponse
      description: >-
        Status for GET /v5/spans/export/{export_id} (mirrors the sgp-traces
        status object).


        Always returned with HTTP 200; unknown or cross-account ids arrive as

        ``failed`` with ``reason=not_found``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpansExportTruncation:
      properties:
        reason:
          type: string
          title: Reason
          description: 'Budget that was hit: row_budget, byte_budget, or disk_budget.'
        rows_exported:
          type: integer
          title: Rows Exported
          description: Rows written before truncation.
      type: object
      required:
        - reason
        - rows_exported
      title: SpansExportTruncation
      description: >-
        Present on a succeeded export that hit a budget; absent for a complete
        one.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````