Docs·Visitors and people
GET
/api/v1/spreelytics/people/:contactIdentityId/timelineGet a person's timeline
Returns what one identified person did as a single list, newest first: page views, custom events and payments, across all their devices and including what they did before they were identified. Session ends, scroll events and link clicks are left out.
The list is paged, and page starts at 0. It answers 404 for an id that is not a person in this audience. Every role can call it, Viewer included.
Keys: an account key or an audience key. Getting started explains both kinds.
Parameters
| Prop | In | Type | Notes |
|---|---|---|---|
contactIdentityId | path | string | The person id, a UUID. |
contactListId | query | string | The audience id, a UUID. With an audience key it must be that key's own audience. |
page? | query | number | Page number, starting at 0. Defaults to 0. |
pageSize? | query | number | Items per page, 1 to 100 (other values are clamped). Defaults to 25. |
Response
| Prop | Type | Notes |
|---|---|---|
content | PersonTimelineItemDto[] | The items, newest first. Each has source (web, or revenue for an event that carried a payment), type (pageview or the event name), label (the path for a page view, otherwise the event name), timestamp (ISO 8601 in UTC, to the second), amount (payments only, in your reporting currency; a refund shows as a negative amount) and parameters (the event's properties as strings, when it had any). |
size | number | The page size used. |
page | number | The page returned, counted from 0. |
totalItems | number | How many items there are across all pages. |
totalPages | number | How many pages there are at this page size. |
Each item in content
| Prop | Type | Notes |
|---|---|---|
source | ``web` \ | `revenue`` |
type | string | 'pageview' | event name |
label | string | |
timestamp | string | |
amount | number | |
parameters | Record_string.string_ |
Request
curl 'https://app.spreelytics.com/api/v1/spreelytics/people/:contactIdentityId/timeline?contactListId=…' \
-H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/people/:contactIdentityId/timeline');
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/spreelytics/people/:contactIdentityId/timeline",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"contactListId": "…"},
)
data = res.json()
Response
{
"content": [
{
"source": "web",
"type": "string",
"label": "string",
"timestamp": "string",
"amount": 0,
"parameters": {}
}
],
"size": 0,
"page": 0,
"totalItems": 0,
"totalPages": 0
}