Skip to content
Elara One docs
Search

Record search events

POST
/v1/search/events

Reports, in batches of 1–20, what the shopper did with search answers: settled (a suggest answer they stopped at: it becomes a counted search), click and add_to_cart. Each event names the answer by its X-Search-Id; the engine takes the query and the totals from its own 15-minute record of that answer, so the client never sends query text, counts or anything personal. Events for an unknown or expired search id, a repeated settled, a settled for a results page, or a click on something the answer cannot have shown are dropped silently: every well-formed batch is 202. Never retry a failed beacon.

Authorization

tenantKey
headerX-Tenant-Key<token>

The public store key (pk_live_…). Required on every call.

Header Parameters

X-Client-IP?string

Optional. IP address of the shopper (one IPv4/IPv6, no port, no list). Honoured only together with a valid X-Tenant-Secret; ignored otherwise. Used for rate limits and recorded with form submissions.

X-Tenant-Secret?string

Optional here. Server secret of the store: server-to-server only, never from a browser. Enables X-Client-IP.

Request Body

application/json
  1. body

A batch of 1–20 search beacon events. The shape is strict: a malformed event makes the whole batch 422 VALIDATION_FAILED. Well-formed events that do not resolve (unknown or expired search id, not in their search's result set) are dropped silently, still 202.

every event type (settled | click | add_to_cart), search_id (a ULID, any letter case) settled trigger: idle | blur | enter click item_type (product | collection | brand | tag | page | post), item_id, position (JSON integer ≥ 1) add_to_cart product_id (JSON integer ≥ 1)

A field that belongs to another type (e.g. position on settled) is a 422. Nothing else is read: queries, totals or shopper data a client might add are ignored.

events*array<>

1–20 events, sent in the order they happened.

Items1 <= items <= 20

Response Body

Success.

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.elaraone.app/api/v1/search/events' \  -H 'X-Tenant-Key: pk_live_…' \  -H 'X-Tenant-Secret: your-server-secret' \  -H 'Content-Type: application/json' \  -d '{  "events": [    {      "type": "settled",      "search_id": "01JB8Z6Q4M9W2C7XK3T5VYHNPR"    }  ]}'
Example Response
{  "data": {    "accepted": 0  }}