POST
/
v5
/
spans
/
search
Search and list spans
curl --request POST \
  --url https://api.egp.scale.com/v5/spans/search \
  --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>"
  ]
}'
{
  "object": "list",
  "items": [
    {
      "id": "<string>",
      "object": "span",
      "created_by": {
        "id": "<string>",
        "object": "identity",
        "type": "user"
      },
      "name": "<string>",
      "trace_id": "<string>",
      "parent_id": "<string>",
      "group_id": "<string>",
      "start_timestamp": "2023-11-07T05:31:56Z",
      "end_timestamp": "2023-11-07T05:31:56Z",
      "input": {},
      "output": {},
      "metadata": {},
      "status": "SUCCESS",
      "type": "STANDALONE",
      "application_interaction_id": "<string>",
      "application_variant_id": "<string>",
      "account_id": "<string>"
    }
  ],
  "limit": 100,
  "total": 123,
  "has_more": true
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Query Parameters

starting_after
string | null
ending_before
string | null
limit
integer
default:100
Required range: 1 <= x <= 1000
sort_order
enum<string> | null
default:asc
Available options:
asc,
desc
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

Response

Successful Response

items
Items · object[]
required
total
integer
required

The total of items that match the query. This is greater than or equal to the number of items returned.

has_more
boolean
required

Whether there are more items left to be fetched.

object
enum<string>
default:list
Available options:
TitleConst
Objectlist
limit
integer
default:100

The maximum number of items to return.