Docs Developers Nudges endpoint

Nudges endpoint

List nudge events and preview what nudge would fire for a given session state using the elNudge Nudges API.

Base URL: https://api.elnudge.com/v1

All requests require an Authorization: Bearer sk_live_XXXXXXXX header. See Authentication for details.


List nudge events

GET /v1/nudges

Returns a paginated list of nudge events for your site, ordered by shown_at descending.

Query parameters

ParameterTypeDescription
session_idstringFilter to nudge events for a specific session
typestringFilter by nudge type. One of: chat_bubble, toast, exit_modal, sticky_bar
fromISO 8601 stringReturn events at or after this timestamp
toISO 8601 stringReturn events before this timestamp
limitintegerNumber of results (default: 50, max: 200)
cursorstringPagination cursor from a previous response's next_cursor

Example request

curl "https://api.elnudge.com/v1/nudges?type=exit_modal&from=2026-04-01T00:00:00Z&limit=100" \
  -H "Authorization: Bearer sk_live_XXXXXXXX"

Example response

{
  "data": [
    {
      "id": "nudg_01HY8QWK9LMNO2PQR3ST4UV5WX",
      "session_id": "sess_01HY8QVZK3MN2PXRT5GW4JCBD",
      "type": "exit_modal",
      "shown_at": "2026-04-29T10:16:30Z",
      "outcome": "clicked",
      "influenced_conversion": true
    },
    {
      "id": "nudg_01HY8QXA1BCDE2FGH3IJ4KL5MN",
      "session_id": "sess_01HY8QV1A2BC3DE4FG5HJ6KL7M",
      "type": "exit_modal",
      "shown_at": "2026-04-29T09:53:41Z",
      "outcome": "dismissed",
      "influenced_conversion": false
    }
  ],
  "next_cursor": "eyJpZCI6Im51ZGdfMDFIWThRWEExQkNERTJGR0gzSUo0S0w1TU4iLCJkaXJlY3Rpb24iOiJiZWZvcmUifQ==",
  "has_more": true
}

Nudge event object fields

FieldTypeDescription
idstringUnique nudge event identifier
session_idstringThe session this nudge belongs to
typestringchat_bubble, toast, exit_modal, or sticky_bar
shown_atstringISO 8601 UTC — when the nudge was displayed
outcomestringshown, clicked, dismissed, or chat_opened
influenced_conversionbooleantrue if a purchase occurred within 30 min of this nudge interaction

Preview a nudge (for testing)

POST /v1/nudges/preview

Given a hypothetical session state, returns the nudge that would fire — or null if no nudge would fire. Use this endpoint to verify your nudge configuration during integration testing without needing to simulate a real visitor session.

This endpoint works with both sk_live_ and sk_test_ keys.

Request body

{
  "session_state": {
    "intent_score": 75,
    "page_url": "/products/ultra-stride-v2",
    "idle_ms": 35000
  }
}
FieldTypeDescription
intent_scoreintegerSimulated intent score (0–100)
page_urlstringThe page URL to simulate the nudge on
idle_msintegerMilliseconds the visitor has been idle on the current page

Example request

curl -X POST "https://api.elnudge.com/v1/nudges/preview" \
  -H "Authorization: Bearer sk_test_XXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "session_state": {
      "intent_score": 75,
      "page_url": "/products/ultra-stride-v2",
      "idle_ms": 35000
    }
  }'

Example response — nudge would fire

{
  "data": {
    "would_fire": true,
    "nudge": {
      "type": "toast",
      "message": "Still deciding? Here's what makes our Ultra Stride stand out.",
      "cta": "Tell me more",
      "reason": "High intent score on a product page with idle time exceeding threshold"
    }
  }
}

Example response — no nudge would fire

{
  "data": {
    "would_fire": false,
    "nudge": null,
    "reason": "Page URL matches a configured quiet zone"
  }
}

The reason field is informational — useful for debugging why a nudge is or is not firing in a given scenario.