Sessions
Operations around Sessions and Session data.
Endpoints
GET /api/websites/:websiteId/sessions
GET /api/websites/:websiteId/sessions/stats
GET /api/websites/:websiteId/sessions/:sessionId
GET /api/websites/:websiteId/sessions/:sessionId/activity
GET /api/websites/:websiteId/sessions/:sessionId/properties
GET /api/websites/:websiteId/session-data/properties
GET /api/websites/:websiteId/session-data/values
GET /api/websites/:websiteId/sessions/weeklyGET /api/websites/:websiteId/sessions
Gets website session details within a given time range.
Parameters
startAt: Timestamp (in ms) of starting date.endAt: Timestamp (in ms) of end date.query: (optional string) Search text.page: (optional number, default 1) Determines page.pageSize: (optional string) Determines how many results to return.orderBy: (optional string) Order by column name.
Sample response
{
"data": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"createdAt": "0000-00-00T00:00:00Z",
"websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"lastAt": "0000-00-00T00:00:00Z",
"screen": "1920x1080",
"hostname": "example.com",
"visits": 1,
"os": "xxxxx",
"browser": "xxxxxx",
"language": "xx-xx",
"region": "xx-xx",
"city": "xxxx",
"firstAt": "0000-00-00T00:00:00Z",
"device": "desktop",
"country": "US",
"views": 0
}
],
"count": 11,
"pageSize": 10,
"page": 1
}GET /api/websites/:websiteId/sessions/stats
Gets summarized website session statistics.
Parameters
startAt: Timestamp (in ms) of starting date.endAt: Timestamp (in ms) of end date.url: (optional) Name of URL.referrer: (optional) Name of referrer.title: (optional) Name of page title.query: (optional) Name of query.event: (optional) Name of event.host: (optional) Name of hostname.os: (optional) Name of operating system.browser: (optional) Name of browser.device: (optional) Name of device (ex. Mobile)country: (optional) Name of country.region: (optional) Name of region/state/province.city: (optional) Name of city.
Sample response
{
"pageviews" : {
"value" : 0
},
"visitors" : {
"value" : 11
},
"visits" : {
"value" : 12
},
"countries" : {
"value" : 2
},
"events" : {
"value" : 12
}
}pageviews: Pages hitsvisitors: Number of unique visitorsvisits: Number of sessionscountries: Number of unique countriesevents: Number of custom events
GET /api/websites/:websiteId/sessions/:sessionId
Gets session details for a individual session
Parameters
None
Sample response
URL: https://umami.mydomain.com/api/websites/86d4095c-a2a8-4fc8-9521-103e858e2b41/sessions/a35fe227-2fe9-5147-85a0-15f0fd48faed
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"hostname": "umami.is",
"browser": "ios",
"os": "iOS",
"device": "mobile",
"screen": "390x844",
"language": "en-US",
"country": "US",
"subdivision1": "US-IN",
"city": "Bloomington",
"firstAt": "2024-09-09T18:12:01Z",
"lastAt": "2024-09-09T18:12:08Z",
"visits": 1,
"views": 3,
"events": 0,
"totaltime": 7
}GET /api/websites/:websiteId/sessions/:sessionId/activity
Gets session activity for a individual session
Parameters
startAt: Timestamp (in ms) of starting date.endAt: Timestamp (in ms) of end date.
Sample response
[
{
"eventType" : 1,
"urlQuery" : "",
"urlPath" : "/",
"eventName" : "",
"createdAt" : "0000-00-00T00:00:00Z",
"referrerDomain" : "",
"eventId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"visitId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
{
"eventType" : 1,
"urlQuery" : "",
"urlPath" : "/",
"eventName" : "",
"createdAt" : "0000-00-00T00:00:00Z",
"referrerDomain" : "",
"eventId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"visitId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
]GET /api/websites/:websiteId/sessions/:sessionId/properties
Gets session properties for a individual session
Sample response
URL: https://umami.mydomain.com/api/websites/86d4095c-a2a8-4fc8-9521-103e858e2b41/sessions/a35fe227-2fe9-5147-85a0-15f0fd48faed/properties
[
{
"websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"sessionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"dataKey": "email",
"dataType": 1,
"stringValue": "[email protected]",
"numberValue": null,
"dateValue": null,
"createdAt": "0000-00-00T00:00:00Z"
},
{
"websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"sessionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"dataKey": "name",
"dataType": 1,
"stringValue": "xxxx xxxxx",
"numberValue": null,
"dateValue": null,
"createdAt": "0000-00-00T00:00:00Z"
}
]GET /api/websites/:websiteId/session-data/properties
Gets session data counts by property name
Parameters
startAt: Timestamp (in ms) of starting date.endAt: Timestamp (in ms) of end date.
Sample response
[
{
"propertyName": "id",
"total": 1039
},
{
"propertyName": "region",
"total": 1039
},
{
"propertyName": "name",
"total": 1039
},
{
"propertyName": "email",
"total": 1039
}
]GET /api/websites/:websiteId/session-data/values
Gets session data counts for a given property
Parameters
startAt: Timestamp (in ms) of starting date.endAt: Timestamp (in ms) of end date.propertyName: Property name.
Sample response
[
{ "value": "EU", "total": 609 },
{ "value": "US", "total": 431 }
]GET /api/websites/:websiteId/sessions/weekly
Get collected count of sessions by hour of weekday.
Parameters
startAt: (number) Timestamp (in ms) of start date.endAt: (number) Timestamp (in ms) of end date.timezone: (string) Timezone.
Sample response
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]