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.
GET https://api.bearlumen.com/v1/attribution-data/sessions/{sessionId}
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 example
Success response (200):
{
"features": [
{
"event_count": 2,
"feature": "match-narration",
"total_cost": "6.34"
},
{
"event_count": 1,
"feature": "npc-dialogue",
"total_cost": "2.66"
},
{
"event_count": 1,
"feature": "world-summary",
"total_cost": "1.4"
}
],
"session_id": "sess_mQ4vX8kN",
"session_type": "multiplayer",
"total_cost": "10.4"
}
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.