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
Headers
| Name | Type | Description |
|---|---|---|
| Authorizationrequired | string | Token returned by POST /api/auth/login, or an API key (`umami_…`) created under Settings → API keys (self-hosted only). Bearer <token>. |
| x-umami-share-contextrequired | string | Required context header when authenticating with a share token. <api-key>. |
| x-umami-share-tokenrequired | string | Signed token returned by a share endpoint. <api-key>. |
Path parameters
| Name | Type | Description |
|---|---|---|
| websiteIdrequired | string | ID of the website. |
| sessionIdrequired | string | ID of the visitor session. |
Responses
200The operation completed successfully.
| Name | Type | Description |
|---|---|---|
| browserrequired | string | null | Browser used by the visitor. |
| canDeleterequired | boolean | Whether the caller can delete this session. |
| cityrequired | string | null | City of the visitor. |
| countryrequired | string | null | Country code of the visitor. |
| devicerequired | string | null | Device category used by the visitor. |
| distinctId | string | Distinct ID of the session. Omitted unless exactly one distinct ID is linked. |
| distinctIdsrequired | string[] | Distinct IDs linked to the session. |
| eventsrequired | number | |
| firstAtrequired | string | Date and time of the first recorded activity. |
| idrequired | string | Unique identifier of the resource. |
| languagerequired | string | null | Preferred language reported by the visitor browser. |
| lastAtrequired | string | Date and time of the most recent recorded activity. |
| osrequired | string | null | Operating system used by the visitor. |
| regionrequired | string | null | Region or subdivision of the visitor. |
| screenrequired | string | null | Screen resolution of the visitor device. |
| stitchedSessionCountrequired | integer | Number of sessions merged through the distinct ID, including this one. |
| totaltimerequired | number | Total visit duration in seconds. |
| viewsrequired | number | Pageview counts for the selected period. |
| visitsrequired | number | Visit counts for the selected period. |
| websiteIdrequired | string | ID of the website. |
200 example
401Unauthorized.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
401 example
404Not found.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
404 example
Code samples
cURL