Sessions

Operations around Sessions and Session data.

Endpoints

GET /api/websites/:websiteId/sessions
GET /api/websites/:websiteId/sessions/stats
GET /api/websites/:websiteId/sessions/weekly
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

Filters

All Endpoints marked with filters can now be filtered with the parameters below.

Parameters

ParameterTypeDescription
pathstring(optional) Name of URL.
referrerstring(optional) Name of referrer.
titlestring(optional) Name of page title.
querystring(optional) Name of query parameter.
browserstring(optional) Name of browser.
osstring(optional) Name of operating system.
devicestring(optional) Name of device (ex. Mobile).
countrystring(optional) Name of country.
regionstring(optional) Name of region/state/province.
citystring(optional) Name of city.
hostnamestring(optional) Name of hostname.
languagestring(optional) Visitor browser language (ex. en-US).
tagstring(optional) Name of tag.
eventstring(optional) Name of event.
distinctIdstring(optional) Name of distinct ID.
utmSourcestring(optional) UTM source.
utmMediumstring(optional) UTM medium.
utmCampaignstring(optional) UTM campaign name.
utmContentstring(optional) UTM content.
utmTermstring(optional) UTM term.
segmentuuid(optional) UUID of segment.
cohortuuid(optional) UUID of cohort.

GET /api/websites/:websiteId/sessions

Gets website session details within a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
searchstring(optional) Search text.
pagenumber(optional, default 1) Determines page.
pageSizenumber(optional, default 20) Determines how many results to return.
filters-Can accept filter parameters.

Sample response

{
  "data": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "hostname": "umami.is",
      "browser": "chrome",
      "os": "Mac OS",
      "device": "desktop",
      "screen": "1800x1169",
      "language": "en-US",
      "country": "SE",
      "region": "SE-AB",
      "city": "Stockholm",
      "firstAt": "2025-10-21T13:35:51Z",
      "lastAt": "2025-10-21T15:00:09Z",
      "visits": 2,
      "views": 18,
      "createdAt": "2025-10-21T15:00:09Z"
    },
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "hostname": "umami.is",
      "browser": "safari",
      "os": "Mac OS",
      "device": "desktop",
      "screen": "1512x982",
      "language": "en-IN",
      "country": "IN",
      "region": "IN-GJ",
      "city": "Bhavnagar",
      "firstAt": "2025-10-21T14:59:47Z",
      "lastAt": "2025-10-21T14:59:48Z",
      "visits": 1,
      "views": 1,
      "createdAt": "2025-10-21T14:59:48Z"
    }
  ],
  "count": 923,
  "page": 1,
  "pageSize": 20
}

GET /api/websites/:websiteId/sessions/stats

Gets summarized website session statistics.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
filters-Can accept filter parameters.

Sample response

{
  "pageviews": {
    "value": 2924
  },
  "visitors": {
    "value": 905
  },
  "visits": {
    "value": 1050
  },
  "countries": {
    "value": 84
  },
  "events": {
    "value": 517
  }
}
  • pageviews: Pages hits
  • visitors: Number of unique visitors
  • visits: Number of unique visits
  • bounces: Number of visitors who only visit a single page
  • totaltime: Time spent on the website

GET /api/websites/:websiteId/sessions/weekly

Get collected count of sessions by hour of weekday.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of start date.
endAtnumberTimestamp (in ms) of end date.
timezonestringTimezone (ex. America/Los_Angeles).
filters-Can accept filter parameters.

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, 45, 58, 57, 65, 53, 58, 135],
  [117, 124, 132, 127, 135, 142, 141, 138, 1, 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]
]

GET /api/websites/:websiteId/sessions/:sessionId

Gets session details for a individual session

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "distinctId": "",
  "browser": "chrome",
  "os": "Mac OS",
  "device": "desktop",
  "screen": "1800x1169",
  "language": "en-US",
  "country": "SE",
  "region": "SE-AB",
  "city": "Stockholm",
  "firstAt": "2025-10-21T13:35:51Z",
  "lastAt": "2025-10-21T15:00:09Z",
  "visits": 2,
  "views": 18,
  "events": 12,
  "totaltime": 1609
}

GET /api/websites/:websiteId/sessions/:sessionId/activity

Gets session activity for a individual session

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.

Sample response

[
  {
    "createdAt": "2025-10-21T15:00:09Z",
    "urlPath": "/blog",
    "urlQuery": "",
    "referrerDomain": "umami.is",
    "eventId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "eventType": 1,
    "eventName": "",
    "visitId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "hasData": 0
  },
  {
    "createdAt": "2025-10-21T14:56:30Z",
    "urlPath": "/docs",
    "urlQuery": "",
    "referrerDomain": "umami.is",
    "eventId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "eventType": 1,
    "eventName": "",
    "visitId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "hasData": 0
  },
  {
    "createdAt": "2025-10-21T14:56:30Z",
    "urlPath": "/",
    "urlQuery": "",
    "referrerDomain": "umami.is",
    "eventId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "eventType": 1,
    "eventName": "",
    "visitId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "hasData": 0
  }
]

GET /api/websites/:websiteId/sessions/:sessionId/properties

Gets session properties for a individual session

Sample response

[
  {
    "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "sessionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "dataKey": "email",
    "dataType": 1,
    "stringValue": "[email protected]",
    "numberValue": null,
    "dateValue": null,
    "createdAt": "2025-10-22T02:28:17Z"
  },
  {
    "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "sessionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "dataKey": "id",
    "dataType": 1,
    "stringValue": "910bfde0-21dd-4d24-804d-716035e92ddc",
    "numberValue": null,
    "dateValue": null,
    "createdAt": "2025-10-22T02:28:17Z"
  },
  {
    "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "sessionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "dataKey": "name",
    "dataType": 1,
    "stringValue": "Bob Aol",
    "numberValue": null,
    "dateValue": null,
    "createdAt": "2025-10-22T02:28:17Z"
  }
]

GET /api/websites/:websiteId/session-data/properties

Gets session data counts by property name

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
filters-Can accept filter parameters.

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

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
propertyNamestringProperty name.
filters-Can accept filter parameters.

Sample response

[
  {
    "value": "EU",
    "total": 626
  },
  {
    "value": "US",
    "total": 462
  }
]