Sessions

List visitor sessions

GET/api/websites/{websiteId}/sessions

Returns a page of visitor sessions in the date range, newest first. Search matches distinct ID, city, browser, operating system, or device.

Headers

NameTypeDescription
AuthorizationrequiredstringAuthentication credentials, e.g. Bearer <token>.

Path parameters

NameTypeDescription
websiteIdrequiredstringWebsite ID.

Query parameters

NameTypeDescription
startAtnumberStart of the date range as a Unix timestamp in milliseconds.
endAtnumberEnd of the date range as a Unix timestamp in milliseconds.
startDatestringStart of the date range as an ISO 8601 date or date-time.
endDatestringEnd of the date range as an ISO 8601 date or date-time.
timezonestringIANA time zone used to interpret dates and group results, for example America/New_York.
unitstringTime interval used to group results: minute, hour, day, month, or year.
compareenum<string>Comparison period: prev for the previous period or yoy for the same period last year.
Options: prev, yoy
pathstringFilter by page URL path.
referrerstringFilter by referring URL.
titlestringFilter by page title.
querystringFilter by page URL query string.
osstringOperating system used by the visitor.
browserstringBrowser used by the visitor.
devicestringDevice category used by the visitor.
countrystringCountry code of the visitor.
regionstringRegion or subdivision of the visitor.
citystringCity of the visitor.
tagstringTag attached to the tracked activity.
hostnamestringHostname on which the activity occurred.
distinctIdstringCustom identifier assigned to the visitor.
languagestringPreferred language reported by the visitor browser.
eventstringFilter by custom event name.
utmSourcestringUTM campaign source.
utmMediumstringUTM campaign medium.
utmCampaignstringUTM campaign name.
utmContentstringUTM campaign content.
utmTermstringUTM campaign search term.
segmentstringID of a saved segment used to filter results.
cohortstringID of a saved cohort used to filter visitors.
eventTypeintegerEvent type: 1 for a pageview or 2 for a custom event.
excludeBouncestringSet a non-empty value to exclude visits with only one pageview.
matchenum<string>Whether records must match all filters or any filter.
Options: all, any
pageintegerPage number, starting at 1.
pageSizeintegerNumber of results per page.
maxResultsintegerMaximum number of results to include.
searchstringSearch text used to filter results.

Responses

200A page of sessions.
NameTypeDescription
countrequiredintegerNumber of matching records.
datarequiredWebsiteSession[]Data returned by the operation.
isCappedbooleanWhether the results were truncated by the maximum result limit.
pagerequiredintegerPage number, starting at 1.
pageSizerequiredintegerNumber of results per page.
200 example
400Bad request.
NameTypeDescription
errorrequiredobjectError details returned when the operation fails.
400 example
401Unauthorized.
NameTypeDescription
errorrequiredobjectError details returned when the operation fails.
401 example

Code samples

cURL