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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sessionId | path | string | Yes | The 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.
| Field | Type | Description |
|---|---|---|
session_id | string | The session_id value shared by this session's usage events. |
session_type | string | Freeform session category from the session_type event field; "unknown" when the events carry no session_type. |
total_cost | string | Total cost for the session (USD, decimal string). |
features | object[] | Per-feature cost breakdown within the session, ordered by cost descending. |
feature | string | Feature name from the session's usage events; events without a feature are grouped under "unknown". |
total_cost | string | Total cost for this feature within the session (USD, decimal string). |
event_count | number (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.
| Status | When it happens |
|---|---|
400 | Invalid request data. Fix the field named in error.message and retry. |
401 | Missing or invalid API key. Send your key as Authorization: Bearer YOUR_API_KEY. |
403 | API key lacks the costs:read scope. Create or update an API key with the costs:read scope, then retry. |
404 | No session with this sessionId exists for your organization. Verify the session_id metadata value sent on your usage events. |
429 | Rate 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.