Sessions

Get a visitor session

GET/api/websites/{websiteId}/sessions/{sessionId}

Returns details for a website session, including linked visitor identities and whether session deletion is available to the caller.

Try it

GET/api/websites/{websiteId}/sessions/{sessionId}
Authorization

Credentials stay in this browser tab and are never sent anywhere except the API.

Path parameters
Response

Send a request to see the response.

Headers

NameTypeDescription
AuthorizationrequiredstringToken returned by POST /api/auth/login, or an API key (`umami_…`) created under Settings → API keys (self-hosted only). Bearer <token>.
x-umami-share-contextrequiredstringRequired context header when authenticating with a share token. <api-key>.
x-umami-share-tokenrequiredstringSigned token returned by a share endpoint. <api-key>.

Path parameters

NameTypeDescription
websiteIdrequiredstringID of the website.
sessionIdrequiredstringID of the visitor session.

Responses

200The operation completed successfully.
NameTypeDescription
browserrequiredstring | nullBrowser used by the visitor.
canDeleterequiredbooleanWhether the caller can delete this session.
cityrequiredstring | nullCity of the visitor.
countryrequiredstring | nullCountry code of the visitor.
devicerequiredstring | nullDevice category used by the visitor.
distinctIdstringDistinct ID of the session. Omitted unless exactly one distinct ID is linked.
distinctIdsrequiredstring[]Distinct IDs linked to the session.
eventsrequirednumber
firstAtrequiredstringDate and time of the first recorded activity.
idrequiredstringUnique identifier of the resource.
languagerequiredstring | nullPreferred language reported by the visitor browser.
lastAtrequiredstringDate and time of the most recent recorded activity.
osrequiredstring | nullOperating system used by the visitor.
regionrequiredstring | nullRegion or subdivision of the visitor.
screenrequiredstring | nullScreen resolution of the visitor device.
stitchedSessionCountrequiredintegerNumber of sessions merged through the distinct ID, including this one.
totaltimerequirednumberTotal visit duration in seconds.
viewsrequirednumberPageview counts for the selected period.
visitsrequirednumberVisit counts for the selected period.
websiteIdrequiredstringID of the website.
200 example
401Unauthorized.
NameTypeDescription
errorrequiredobjectError details returned when the operation fails.
401 example
404Not found.
NameTypeDescription
errorrequiredobjectError details returned when the operation fails.
404 example

Code samples

cURL