Sessions endpoint
List and retrieve visitor sessions using the elNudge Sessions API endpoints.
Base URL: https://api.elnudge.com/v1
All requests require an Authorization: Bearer sk_live_XXXXXXXX header. See Authentication for details.
List sessions
GET /v1/sessions
Returns a paginated list of sessions for your site, ordered by started_at descending (most recent first).
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
from | ISO 8601 string | 30 days ago | Return sessions starting at or after this timestamp |
to | ISO 8601 string | now | Return sessions starting before this timestamp |
limit | integer | 50 | Number of sessions to return. Maximum: 200 |
cursor | string | — | Pagination cursor from a previous response's next_cursor field |
Example request
curl "https://api.elnudge.com/v1/sessions?from=2026-04-01T00:00:00Z&to=2026-04-30T23:59:59Z&limit=50" \
-H "Authorization: Bearer sk_live_XXXXXXXX"
Example response
{
"data": [
{
"id": "sess_01HY8QVZK3MN2PXRT5GW4JCBD",
"started_at": "2026-04-29T10:14:32Z",
"ended_at": "2026-04-29T10:28:07Z",
"page_count": 6,
"intent_score": 82,
"converted": true,
"nudge_count": 2
},
{
"id": "sess_01HY8QV1A2BC3DE4FG5HJ6KL7M",
"started_at": "2026-04-29T09:52:11Z",
"ended_at": "2026-04-29T09:54:03Z",
"page_count": 2,
"intent_score": 18,
"converted": false,
"nudge_count": 0
}
],
"next_cursor": "eyJpZCI6InNlc3NfMDFIWThRVjFBMkJDM0RFNEZHNUhKNktMN00iLCJkaXJlY3Rpb24iOiJiZWZvcmUifQ==",
"has_more": true
}
Session object fields
| Field | Type | Description |
|---|---|---|
id | string | Unique session identifier |
started_at | string | ISO 8601 UTC — session start |
ended_at | string | ISO 8601 UTC — session end or last event time |
page_count | integer | Number of distinct pages visited |
intent_score | integer | Final intent score (0–100) |
converted | boolean | true if a purchase was completed in this session |
nudge_count | integer | Number of nudges displayed during the session |
Pagination
If has_more is true, pass the next_cursor value in your next request to retrieve the following page:
curl "https://api.elnudge.com/v1/sessions?cursor=eyJpZCI6InN..." \
-H "Authorization: Bearer sk_live_XXXXXXXX"
Get a single session
GET /v1/sessions/:id
Returns a single session with its full event log and nudge outcomes.
Example request
curl "https://api.elnudge.com/v1/sessions/sess_01HY8QVZK3MN2PXRT5GW4JCBD" \
-H "Authorization: Bearer sk_live_XXXXXXXX"
Example response
{
"data": {
"id": "sess_01HY8QVZK3MN2PXRT5GW4JCBD",
"started_at": "2026-04-29T10:14:32Z",
"ended_at": "2026-04-29T10:28:07Z",
"page_count": 6,
"intent_score": 82,
"converted": true,
"nudge_count": 2,
"events": [
{
"type": "PAGE_VIEW",
"url": "/collections/running",
"occurred_at": "2026-04-29T10:14:32Z"
},
{
"type": "PAGE_VIEW",
"url": "/products/ultra-stride-v2",
"occurred_at": "2026-04-29T10:15:48Z"
},
{
"type": "ADD_TO_CART",
"url": "/products/ultra-stride-v2",
"occurred_at": "2026-04-29T10:22:15Z"
},
{
"type": "PURCHASE",
"url": "/checkout/thank-you",
"occurred_at": "2026-04-29T10:27:44Z"
}
],
"nudges": [
{
"nudge_id": "nudg_01HY8QWK9LMNO2PQR3ST4UV5WX",
"type": "toast",
"shown_at": "2026-04-29T10:16:30Z",
"outcome": "clicked",
"influenced_conversion": true
},
{
"nudge_id": "nudg_01HY8QXA1BCDE2FGH3IJ4KL5MN",
"type": "chat_bubble",
"shown_at": "2026-04-29T10:14:45Z",
"outcome": "shown",
"influenced_conversion": false
}
]
}
}
Data retention
| Plan | Sessions available via API |
|---|---|
| Starter | Last 30 days |
| Growth | Last 30 days |
| Scale | Last 90 days |
| Enterprise | Last 90 days (extended retention available on request) |
Sessions older than your plan's retention window return a 404 response.