Docs·Sessions

GET/api/v1/event/analytics/web-analytics/sessions/:sessionId

Get a session

One session in full, whatever its date: everything a row of /sessions has, plus when it ended, whether the visitor was new, the entry page's title, the referring address, the UTM tags, and the browser and system versions. A session id that does not exist in this audience returns a 404.

Keys: an account key. Getting started explains both kinds.

Parameters

PropInTypeNotes
sessionIdpathstringThe session id, as id on a session row or sessionId on an event.
contactListIdquerystringThe id of the audience (the tracked site) to read, a UUID: anything else returns a 400. You must be a member of the workspace the audience belongs to, or the call returns a 401. An id that matches no audience is not an error: the call returns no data.

Response

PropTypeNotes
idstringThe session id.
visitorIdstringThe visitor (browser) the session belongs to.
visitorDisplaystringThe visitor's email when identified, else the visitor id.
contactIdstringThe person id when the visitor is identified. Left out for anonymous visitors.
startedAtstringWhen the session started, in UTC with milliseconds, such as 2026-09-30 14:03:12.345+00.
durationnumberLength in milliseconds as last reported, 0 until the session first ends.
pageCountnumberPage views in the session.
entryPathstringPath of the first page.
entryHostnamestringHostname of the first page.
isBouncebooleantrue when the session had one page and no interactions (your own events or link clicks; the automatic scroll event does not count). It is set when the session ends, so it reads false until then.
exitPathstringPath of the last page viewed so far.
exitHostnamestringHostname of that last page.
eventCountnumberEverything recorded in the session: page views, your own events, scroll and link-click events.
channelstringChannel the visit came through, such as Organic Search or Direct.
referrerSourcestringSource of the visit, such as Google, '' when none.
countrystringTwo-letter country code, '' when unknown.
regionstringRegion, '' when unknown.
citystringCity, '' when unknown.
browserstringBrowser, such as Chrome.
osstringOperating system, such as Windows.
devicestringDesktop, Mobile or Tablet.
endedAtstringWhen the session last ended, in the same form as startedAt; null while it is open.
isNewVisitorbooleantrue when the tracking script reported a first-time visitor at the start of the session.
entryTitlestringTitle of the first page.
referrerstringThe referring address, usually host and path such as news.ycombinator.com/item, '' when none.
utmSourcestringUTM source of the page the visit landed on, '' when none.
utmMediumstringUTM medium of that page, '' when none.
utmCampaignstringUTM campaign of that page, '' when none.
browserVersionstringBrowser version, major and minor, such as 120.0.
osVersionstringOperating system version, major and minor, such as 10.0.

Request

curl 'https://app.spreelytics.com/api/v1/event/analytics/web-analytics/sessions/:sessionId?contactListId=…' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/event/analytics/web-analytics/sessions/:sessionId');
url.searchParams.set('contactListId', '…');

const res = await fetch(url, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const data = await res.json();
import requests

res = requests.get(
    "https://app.spreelytics.com/api/v1/event/analytics/web-analytics/sessions/:sessionId",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"contactListId": "…"},
)
data = res.json()

Response

{
  "id": "string",
  "visitorId": "string",
  "visitorDisplay": "string",
  "contactId": "string",
  "startedAt": "string",
  "duration": 0,
  "pageCount": 0,
  "entryPath": "string",
  "entryHostname": "string",
  "isBounce": true,
  "exitPath": "string",
  "exitHostname": "string",
  "eventCount": 0,
  "channel": "string",
  "referrerSource": "string",
  "country": "string",
  "region": "string",
  "city": "string",
  "browser": "string",
  "os": "string",
  "device": "string",
  "endedAt": "string",
  "isNewVisitor": true,
  "entryTitle": "string",
  "referrer": "string",
  "utmSource": "string",
  "utmMedium": "string",
  "utmCampaign": "string",
  "browserVersion": "string",
  "osVersion": "string"
}

See your own numbers today.

Free up to 100k events a month · no credit card

Contact

Tell us what you need.

A real person reads these. We usually reply within one working day.

Or email us directly at contact@spreelytics.com.