POST
/
v5
/
spans
/
export
Export spans
curl --request POST \
  --url https://api.egp.scale.com/v5/spans/export \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "parents_only": true,
  "span_ids": [
    "<string>"
  ],
  "trace_ids": [
    "<string>"
  ],
  "excluded_span_ids": [
    "<string>"
  ],
  "excluded_trace_ids": [
    "<string>"
  ],
  "group_id": "<string>",
  "names": [
    "<string>"
  ],
  "statuses": [
    "SUCCESS"
  ],
  "types": [
    "TEXT_INPUT"
  ],
  "search_texts": [
    "<string>"
  ],
  "extra_metadata": {},
  "application_variant_ids": [
    "<string>"
  ],
  "export_method": "direct",
  "export_format": "json",
  "with_children": false,
  "include_assessments": false
}'
{
  "filename": "<string>",
  "signed_url": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Query Parameters

from_ts
string<date-time> | null

The starting (oldest) timestamp in ISO format.

to_ts
string<date-time> | null

The ending (most recent) timestamp in ISO format.

Body

application/json
parents_only
boolean

Only fetch spans that are the top-level (ie. have no parent_id)

span_ids
string[]

Filter by span IDs

trace_ids
string[]

Filter by trace IDs

excluded_span_ids
string[]

List of span IDs to exclude from results

excluded_trace_ids
string[]

List of trace IDs to exclude from results

group_id
string

Filter by group ID

names
string[]

Filter by trace/span name

statuses
enum<string>[]

Filter on span status

types
enum<string>[]
search_texts
string[]

Free text search across span input and output fields

extra_metadata
object

Filter on custom metadata key-value pairs

application_variant_ids
string[]

Filter by application variant IDs

export_method
enum<string>

The method for exporting spans. signed_url returns a pre-signed URL, while direct returns the raw content.

Available options:
signed_url,
direct
export_format
enum<string>

The format of the exported spans. json returns a single JSON array, while jsonl returns one JSON object per line.

Available options:
json,
jsonl,
csv
with_children
boolean
default:false

Whether to include child spans in the export. If true, all spans related to the trace will be included.

include_assessments
boolean
default:false

If true, include span assessments inline in the export under each span's 'assessments' field.

Response

Successful Response

Response model for exporting spans. This class represents the response when users export span data. It contains either a signed URL to download the exported data from object storage, or the actual content bytes when direct download is used (in environments where object storage is not configured).

filename
string
required

The name of the exported file

signed_url
string

Pre-signed URL to download the file from object storage, if applicable

content
file

The raw file content as bytes, used when direct download is enabled