Retrieve a Trace

GET /api/0/organizations/{organization_id_or_slug}/trace/{trace_id}/

Retrieve the spans, errors, and (optionally) uptime checks that make up a single trace.

The response is a list of top-level events; each item may have nested children, errors, and occurrences arrays representing related items. Top-level entries are spans by default and may also be uptime checks when include_uptime=1 is passed.

Path Parameters

organization_id_or_slug (string)
REQUIRED

The ID or slug of the organization the resource belongs to.

trace_id (string)
REQUIRED

The ID of the trace, a 32-character hexadecimal string.

Query Parameters:

statsPeriod (string)

The period of time for the query, will override the start & end parameters, a number followed by one of:

  • d for days
  • h for hours
  • m for minutes
  • s for seconds
  • w for weeks

For example, 24h, to mean query data starting from 24 hours ago to now.

start (string)

The start of the period of time for the query, expected in ISO-8601 format. For example, 2001-12-14T12:34:56.7890.

end (string)

The end of the period of time for the query, expected in ISO-8601 format. For example, 2001-12-14T12:34:56.7890.

referrer (string)

Internal referrer identifier used for query tracing. Most clients can omit this.

errorId (string)

A 32-character hexadecimal event ID to bias the trace results toward including.

additional_attributes (array(string))

Additional span attributes to include on each event. Repeat to request multiple.

include_uptime (string)
choices:
  • 0
  • 1

Set to 1 to include uptime check results in the trace. Defaults to 0.

Scopes

<auth_token> requires one of the following scopes:
  • org:admin
  • org:read
  • org:write
Copied
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/trace/{trace_id}/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
Copied
[ { "event_id": "0123456789abcdef0123456789abcdef", "event_type": "span", "transaction_id": "280027d94f30428c83a2de46f932612a", "project_id": 4505281256090153, "project_slug": "javascript", "transaction": "POST /api/0/projects/{org}/{proj}/events/{event_id}/attachments/", "description": "POST /api/0/projects/{org}/{proj}/events/{event_id}/attachments/", "op": "http.server", "name": "http.server", "parent_span_id": null, "profile_id": "", "profiler_id": "", "sdk_name": "sentry.python", "is_transaction": true, "start_timestamp": "2026-04-15T18:22:31.000000Z", "end_timestamp": "2026-04-15T18:22:31.250000Z", "duration": 250, "measurements": {}, "children": [], "errors": [], "occurrences": [] } ]
Was this helpful?