Docs Developers Sessions endpoint

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

ParameterTypeDefaultDescription
fromISO 8601 string30 days agoReturn sessions starting at or after this timestamp
toISO 8601 stringnowReturn sessions starting before this timestamp
limitinteger50Number of sessions to return. Maximum: 200
cursorstringPagination 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

FieldTypeDescription
idstringUnique session identifier
started_atstringISO 8601 UTC — session start
ended_atstringISO 8601 UTC — session end or last event time
page_countintegerNumber of distinct pages visited
intent_scoreintegerFinal intent score (0–100)
convertedbooleantrue if a purchase was completed in this session
nudge_countintegerNumber 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

PlanSessions available via API
StarterLast 30 days
GrowthLast 30 days
ScaleLast 90 days
EnterpriseLast 90 days (extended retention available on request)

Sessions older than your plan's retention window return a 404 response.