Skip to main content

Sessions API

Overview​

Returns a paginated list of viewer playout sessions (HTTP-ABR or SRT) for a tenant, one record per session: what was watched, where (country/region), for how long, and on what platform.

Downloads have their own endpoint, download_sessions, which works the same way; see Download Sessions.

This is the API behind the Sessions tab of the Analytics & Reporting app.


Endpoints​

OperationEndpoint
StreamingPOST /:tid/sessions
DownloadsPOST /:tid/download_sessions

Authentication: tenant admin (or content admin) bearer token.


Query Parameters​

NameTypeRequiredDescription
start_tsintegerNoStart time, unix seconds. Default: 1 month ago
end_tsintegerNoEnd time, unix seconds. Default: now
limitintegerNoMax results to return (paging)
offsetintegerNoResult offset (paging)
srtbooleanNoIf true, query SRT (live) sessions. Streams only

Request Body​

{
"filters": {
"<column>": ["<value1>", "<value2>"]
},
"order_by": "view_start DESC"
}
FieldDescription
filtersRestrict results: OR within a field, AND across fields
exclude_filtersLeave out matching results, in the same form as filters
order_byField to order by. Default view_start DESC

Filter keys are column names from Session Fields, or for downloads from Download Sessions. Send {} for no filters.

Range keys​

duration_secs, watched_secs, pct_watched and total_bytes filter by range instead of exact match, using "N-M" (for example "filters": {"watched_secs": ["60-300"]}), OR'd across several ranges. For downloads, only total_bytes applies.

CSV​

Send Accept: text/csv instead of Accept: application/json to get CSV. Without limit, CSV returns every matching row.


Example Request​

curl -X POST "https://appsvc.svc.eluv.io/casa/main/<tenantId>/sessions?limit=50&offset=0" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"filters": {
"object_id": ["iq__abc123..."]
},
"order_by": "view_start DESC"
}'

Example Response​

{
"sessions": [
{
"uuid": "sess_abc123",
"session_id": "sess_abc123",
"tenant": "<tenantId>",
"view_start": 1765832948,
"view_end": 1765834748,
"view_time": "2026-05-15T18:29:08Z",
"auth_identity": "0xabc123...",
"auth_addr": "0xabc123...",
"client_country": "US",
"client_region": "CA",
"client_city": "Los Angeles",
"platform": "Roku",
"os": "Roku OS",
"product": "Roku",
"user_agent": "Roku/DVP-...",
"ip_title_id": "TVOD-001",
"title": "Example Title",
"object_id": "iq__abc123...",
"library_id": "ilib_def456...",
"duration_secs": 5400,
"watched_secs": 1800,
"pct_watched": 33
}
],
"paging": {
"offset": 0,
"limit": 50,
"total": 214,
"start_ts": 1763240948,
"end_ts": 1765832948,
"is_srt": false
}
}

Session Fields​

FieldTypeDescription
uuidstringSession identifier
session_idstringMay be empty for older non-SRT sessions
tenantstringTenant ID
view_startint64Unix timestamp, session start
view_endint64Unix timestamp, session end
view_timetimestampFormatted version of view_start, for display/debugging
auth_identitystringAuthenticated identity for the session
auth_addrstringWallet address associated with the session
auth_emailstringEmail associated with the session, if available
client_ipstringClient IP address
client_locationstringFree-text geolocation string
client_citystringClient city (geolocation)
client_countrystringClient country (geolocation)
client_regionstringClient region/state (geolocation)
client_latitudefloatClient latitude, if resolved
client_longitudefloatClient longitude, if resolved
productstringClient product
platformstringHardware platform, extracted from user agent
user_agentstringRaw client user agent string
osstringOS name/version, extracted from user agent
refererstringHTTP referer
idstringContent object version hash
object_idstringContent object's Fabric ID (iq__...)
ip_title_idstringTitle ID from the object's public metadata
titlestringObject's display title
library_idstringFabric library ID containing the object
offeringstringPlayout offering used
duration_secsint64Total content duration, in seconds
watched_secsint64Seconds actually watched during the session
pct_watchedint64watched_secs / duration_secs, as a percentage
total_bytesint64Bytes delivered during the session
extrasstringFree-form JSON with additional client-reported data, if any
createdint64Unix timestamp

Download Sessions​

POST /:tid/download_sessions takes the same query parameters (except srt) and request body, and returns the same paging. Its records have the session fields except duration_secs, watched_secs, pct_watched, offering and extras, plus:

FieldTypeDescription
status_codeint64HTTP status of the download. Failed downloads are included
file_pathstringPath of the file downloaded

For the NFTs and billing IDs behind each session, use Enriched Sessions.