v2

latestOpenAPI 3.0.3Apache-2.02026-08-07119359591.9 KB
Spans

List spans

Returns a paginated list of spans.

The spans are sorted by their timestamp, with the most recent coming first.

<Note>This endpoint is in beta, read more here.</Note>

post/v2/spans

Query parameters

limitinteger

Maximum items to return

cursorstring

Opaque pagination cursor returned from a previous response (pagination.next_cursor). Treat it as an unreadable token; do not attempt to parse or construct it.

Request body

project_idstring required

The project ID to list spans for

start_timestring date-time

Filter to spans starting at or after this timestamp (inclusive). ISO 8601 format (e.g., 2024-01-01T00:00:00Z). Defaults to 1 week ago.

end_timestring date-time

Filter to spans starting before this timestamp (exclusive). ISO 8601 format (e.g., 2024-01-02T00:00:00Z). Defaults to the current time.

filterstring

Filter expression to apply to the query. Supports SQL-like syntax for filtering spans by attributes (e.g., status_code = 'ERROR'). Optional; omit it to apply no filter. If provided, it must not be empty or whitespace-only.

Response

Returns a list of spans

Example response

{
  "spans": [
    {
      "annotations": [
        {
          "annotator": {
            "email": "user@example.com"
          }
        }
      ],
      "trace_annotations": [
        {
          "annotator": {
            "email": "user@example.com"
          }
        }
      ]
    }
  ]
}