Attribution Data API

Get session detail

Returns a per-feature cost breakdown for one session. Call it with a GET request to /attribution-data/sessions/{sessionId}, authenticated with a restricted API key and the "costs:read" scope.

Returns a per-feature cost breakdown for one session. Unlike the other attribution endpoints, the lookup spans all time; it is not bounded by a date range. Events without a feature are grouped under "unknown". Include `session_id` on your usage events to group them into sessions; optionally include `session_type` (any string label). Requests count toward your per-API-key rate limit; sustained overruns return 429 with the standard error envelope.

Authentication and scopes

Authenticate with a restricted API key in the Authorization: Bearer <key> header. This endpoint requires the costs:read scope.

Parameters

NameInTypeRequiredDescription
sessionIdpathstringYesThe session_id metadata value to look up.

Response fields

Fields returned in the 200 response body. Nested objects are listed under their parent. A field marked optional may be absent from the body; one marked nullable is always present but its value may be null.

FieldTypeDescription
session_idstringThe session_id value shared by this session's usage events.
session_typestringFreeform session category from the session_type event field; "unknown" when the events carry no session_type. When this session's events carry more than one value, this is the first entry of session_types; read session_types instead if that distinction matters to you.
session_typesstring[]Every session_type value this session's events carry, sorted and deduplicated. Usually one entry. More than one is normal for a trace that crosses a service boundary: the trace carrier propagates span identity only, so a downstream service that does not set session_type itself contributes events recorded as "unknown".
total_coststringTotal cost for the session (USD, decimal string). Excludes terminal outcome markers, matching the flat_total_cost reported by the session tree endpoint for the same session.
featuresobject[]Per-feature cost breakdown within the session, ordered by cost descending.
featurestringFeature name from the session's usage events; events without a feature are grouped under "unknown".
total_coststringTotal cost for this feature within the session (USD, decimal string).
event_countnumber (double)Number of usage events for this feature within the session.

Error codes

Errors return the standard error envelope with a code, message, and a correlationId you can quote to support.

StatusWhen it happens
400Invalid request data. Fix the field named in error.message and retry.
401Missing or invalid API key. Send your key as Authorization: Bearer YOUR_API_KEY.
403API key lacks the costs:read scope. Create or update an API key with the costs:read scope, then retry.
404No session with this sessionId exists for your organization. Verify the session_id metadata value sent on your usage events.
429Rate limit or plan quota exceeded. Slow down and retry after the current window resets.

Rate limits and retries

Rate limit or plan quota exceeded. Slow down and retry after the current window resets.