Enriched Sessions API
Overview
Returns a page of sessions, each with who the viewer is and what authorized them:
user_ident-- the viewer's ID with your identity provider: thesubof the JWT they logged in with. Omitted if the viewer never logged in through your identity provider, for example one signed in with an Eluvio account.authorized_by-- the NFTs the viewer held when the session started (view_start) that the content's access rules admit, however the viewer got them: bought, rented, subscribed, transferred or gifted. An NFT held then counts even if it was revoked or transferred later. An empty list means the viewer played without one, for example as a tenant admin.- For each NFT: when and how this viewer got it, its marketplace
sku, and, if the tenant has a title catalog listing the content played,billing-- the title catalog offer it was sold under.
A subscription covers many titles, and each title has its own offer, so it has no single billing ID. Each session
gets the billing_id of the title watched.
Endpoint
POST
https://appsvc.svc.eluv.io/casa/main/:tid/sessions_enriched
Authentication: tenant admin bearer token.
Request
The same query parameters and request body as Sessions, with these differences:
| Parameter | Description |
|---|---|
limit | Default and maximum 200 |
offset | Must not be negative |
search_index | iq__ ID of a title catalog search index to use instead of the tenant's configured one |
JSON only; no CSV.
Paging Through History
- Request one time window at a time with
start_ts/end_ts(for example, a day), and useoffsetonly within a window. Large offsets get slower. - Send one request at a time per tenant. A request made while another is running gets HTTP 429 with a
Retry-Afterheader: wait that many seconds and retry. - Which NFTs a viewer held when a session started never changes, but
billing,title_iqand the access rules come from the title catalog and the content as they are now. A session's result can change when either is updated, for example once a title is added to the catalog, so fetch a range again after such a change.
Response
Success (HTTP 200)
Each session has the session fields, plus:
| Field | Description |
|---|---|
| user_ident | The viewer's ID with your identity provider (the login JWT's sub), if any |
| authorized_by | The NFTs that authorized the session; see below. Empty if none |
| title_iq | Title catalog title of the content played, if the catalog lists it |
| authorized_by_error | Set if this session could not be checked (for example, an invalid object_id) |
The response also has paging and, if a title catalog was used, its search_index.
authorized_by entries
| Field | Description |
|---|---|
| contract_addr | NFT contract address |
| token_id | Token ID |
| acquired_at | When this viewer got it, unix seconds |
| acquired_by | mint (issued to this viewer) or transfer (received from someone else) |
| sku | Marketplace item that mints it, when one can be identified |
| billing | Title catalog offers it was sold under, for the content played; see below. Omitted if none |
billing entries
| Field | Description |
|---|---|
| billing_id | The offer's billing ID |
| offer_type | EST, TVOD or SVOD |
| access_tier | Subscription tier, for SVOD |
| region | Offer region, for example US |
| variant | Offer variant, for example hd-3d-sdr |
The offer is the one for the variant played whose licensing window covers the date the NFT was first issued (for
SVOD, the session start). Where no offer matches a condition, that condition is dropped.
Example Response
{
"sessions": [
{
"uuid": "<session-id>",
"auth_addr": "0xabc123...",
"object_id": "iq__...",
"title": "Example Title",
"view_start": 1796102181,
"watched_secs": 1320,
"user_ident": "<idp-user-id>",
"title_iq": "iq__...",
"authorized_by": [
{
"contract_addr": "0xdef456...",
"token_id": "3957",
"acquired_at": 1796102163,
"acquired_by": "mint",
"sku": "<svod-sku>",
"billing": [
{
"billing_id": "<billing-id>",
"offer_type": "SVOD",
"access_tier": "premium",
"region": "US",
"variant": "hd-3d-sdr"
}
]
}
]
}
],
"paging": { "offset": 0, "limit": 200, "total": 1, "start_ts": 1796000000, "end_ts": 1796103000 },
"search_index": "iq__..."
}
Errors
| Status | Meaning |
|---|---|
| 400 | Invalid parameter or body, for example a negative offset |
| 401 | Missing or invalid token, or the user is not a tenant admin |
| 403 | The user is a content admin, not a tenant admin |
| 429 | Another request for this tenant is running; wait Retry-After seconds |
| 502 | The authorization lookup failed; retry later |
If You Use the Entitlements API
If you create entitlements with the Entitlements API, each
authorized_by entry's contract_addr and token_id match an entitlement's minted[] in
List Entitlements, listed by the session's auth_addr.
That gives each session the entitlement's metadata: customer_id, affiliate_id, and any fields you set on
Create Entitlement.
Curl Example
curl -X POST "https://appsvc.svc.eluv.io/casa/main/<tenantId>/sessions_enriched?start_ts=1796000000&end_ts=1796086400&limit=200" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'