---
title: "List Spans"
method: GET
path: "/spans"
tags: ["Spans"]
---

# List Spans

`GET /spans`

List spans, optionally filtered by trace_id and/or task_id

## Query parameters

- `trace_id` string, nullable
- `task_id` string, nullable
- `limit` integer
- `page_number` integer
- `order_by` string, nullable
- `order_direction` string

## Response `200`

Successful Response

- Span[]
  - `id` string, required
  - `trace_id` string, required — Unique identifier for the trace this span belongs to
  - `task_id` string, nullable — ID of the task this span belongs to
  - `parent_id` string, nullable — ID of the parent span if this is a child span in a trace
  - `name` string, required — Name that describes what operation this span represents
  - `start_time` string, date-time, required — The time the span started
  - `end_time` string, date-time, nullable — The time the span ended
  - `input` union — Input parameters or data for the operation
    - object
    - object[]
  - `output` union — Output data resulting from the operation
    - object
    - object[]
  - `data` union — Any additional metadata or context for the span
    - object
    - object[]

## Other responses

- `422` — Validation Error

## Changes

> 55 revisions in range; 4 could not be searched.

- **2026-04-21** `eeb5bf63b18d` — 2 info
  - added the new optional `query` request parameter `task_id`
  - added the optional property `items/task_id` to the response with the `200` status

[Change history](https://skmtc.dev/scaleapi/apis/agentex-api/changes/spans/get.md)

---

[API](https://skmtc.dev/scaleapi/apis/agentex-api.md) · [All operations](https://skmtc.dev/scaleapi/apis/agentex-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scaleapi/agentex-api/revisions/1e0aaafd5780/schema)
