Skip to main content
POST
Record an interaction or an array of up to 200 interactions. Use your application-owned user_id, the NSL integer item_id, and the non-zero integer event-type ID shown in Data → Events. Built-in event-type IDs can be negative.

Attribution and retries

Copy request_id from the list the user acted on. Use occurred_at in Unix seconds for delayed or historical events. Reuse a deduplication_id only for retries of the same occurrence. Check the returned inserted and processed counts; additional diagnostic fields may be present.

Search events

A search event has a non-empty query and no item_id. Its event_id can be omitted to use the workspace’s Search signal binding. Include result_item_ids when your own search engine displayed results; those IDs do not count as clicked items. Use Search to record a search and fetch results in one call. See Events for signal configuration, batching and delivery behaviour.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Scopes

neuronsearchlab-api/write

Create, update, and delete items; submit events.

Body

application/json

A user ID is always required. An item event needs a non-zero dashboard event_id and a positive NSL-generated item_id. A search event sends a query and no item_id; its event_id is optional and defaults to the event your search signal is bound to. context_id is a positive NSL-generated integer when supplied.

user_id
string

End-user identifier.

Example:

"user-abc123"

userId
string

CamelCase alias for user_id.

item_id
integer

Item ID returned by NSL ingestion. Required unless the event is a search (a query with no item).

Required range: x >= 1
Example:

3187

itemId
integer

CamelCase alias for item_id.

Required range: x >= 1
query
string

What the user searched for. An event with a query and no item_id is a search event: it steers the user's recommendations by the weight of its event type, and event_id defaults to the event your search signal is bound to. With an item_id, the query is kept on the item event as the search the user reached it from. Longer queries are cut to 256 characters.

Maximum string length: 256
Example:

"waterproof trail shoes"

result_item_ids
integer[]

Item IDs your own search engine showed for query, in rank order. Recorded as impressions, not as items the user chose. Only accepted on a search event; the first 50 are kept.

Maximum array length: 50
Required range: x >= 1
Example:
resultItemIds
integer[]

CamelCase alias for result_item_ids.

Required range: x >= 1
event_id
integer

Non-zero event ID shown in dashboard Event configuration. Optional on a search event, where it defaults to your Search event.

eventId
integer

CamelCase alias for event_id.

session_id
string

Optional session identifier.

sessionId
string

CamelCase alias for session_id.

anonymous_id
string

The anonymous visitor ID on the device that sent the event: a browser's first-party ID or an app's install ID. Kept on the event after Identify links the visitor to a user, so the console can show which device each event came from.

Maximum string length: 255
Example:

"aid_7f3c2b91e0"

anonymousId
string

CamelCase alias for anonymous_id.

platform
enum<string>

Where the event was sent from. The SDKs set this for you. Any other value is ignored. Shown on the event in Data → Users.

Available options:
web,
ios,
android,
server,
magento,
shopify,
woocommerce,
bigcommerce,
prestashop,
shopware
Example:

"web"

client
string

The sending library and version, for example js-sdk/2.4.0. The SDKs set this for you.

Maximum string length: 64
Pattern: ^[A-Za-z0-9._+/-]+$
Example:

"js-sdk/2.4.0"

request_id
string<uuid>

Recommendation request ID to attribute this event to.

requestId
string<uuid>

CamelCase alias for request_id.

context_id
integer

Optional context ID created in the dashboard.

Required range: x >= 1
Example:

101

contextId
integer

CamelCase alias for context_id.

Required range: x >= 1
Example:

101

placement
string

Surface or placement where the event happened.

Example:

"home_feed"

metadata
object

Arbitrary JSON object used for filtering, ranking, and debugging.

Example:
occurred_at

Event occurrence timestamp. Numeric values below 1e12 are interpreted as Unix seconds.

Example:

1777478400

occurredAt

CamelCase alias for occurred_at.

timestamp

Legacy timestamp alias.

client_ts

Legacy client timestamp alias.

clientTs

CamelCase alias for client_ts.

deduplication_id
string

Stable caller-owned occurrence key. Reuse only when retrying the same event.

Response

Inserted events

object
enum<string>
required
Available options:
list
data
object[]
required
has_more
boolean
required
url
string
required
inserted
integer
required
Required range: x >= 0
processed
integer
required
Required range: x >= 0
session
object
required
embedding_refresh
object
required
next_cursor
string | null