Sessions
Get a visitor's session activity
GET
/api/websites/{websiteId}/sessions/{sessionId}/activityReturns activity for the specified session and sessions linked by visitor identity, using the requested date range and optional distinct ID.
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. |
Query parameters
| Name | Type | Description |
|---|---|---|
| startAt | integer | Start of the date range as a Unix timestamp in milliseconds. |
| endAt | integer | End of the date range as a Unix timestamp in milliseconds. |
| distinctId | string | Custom identifier assigned to the visitor. |
| period | enum<string> | Relative date range, for example 7d or 30day, used instead of an explicit startAt/endAt range. Options: today, 24h, 7d, 30d, 0day, 24hour, 0week, 7day, 0month, 30day, 90day, 0year, 6month, 12month |
Responses
200The operation completed successfully.
| Name | Type | Description |
|---|---|---|
| createdAtrequired | string | Date and time the record was created. |
| eventIdrequired | string | ID of the event. |
| eventNamerequired | string | Name of the custom event. |
| eventTyperequired | number | Event type: 1 for a pageview or 2 for a custom event. |
| hasDatarequired | boolean | |
| hostnamerequired | string | Hostname on which the activity occurred. |
| referrerDomainrequired | string | Domain of the referring page. |
| urlPathrequired | string | Path portion of the page URL. |
| urlQueryrequired | string | Query string portion of the page URL. |
| visitIdrequired | string | ID of the visit. |
200 example
400Bad request.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
400 example
401Unauthorized.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
401 example
Code samples
cURL