Submit events
Submit user interaction events.
Documentation Index
Fetch the complete documentation index at: https://docs.neuronsearchlab.com/llms.txt
Use this file to discover all available pages before exploring further.
Description
Records user behavior that powers personalization, attribution, analytics, and model training. Events use atype field plus a type-specific object so new event shapes can be added without changing shared fields.
Common event types are impression, view, click, like, purchase, and conversion. Your console event definitions decide which types are valid for your tenant.
Request
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | yes | End-user identifier. |
item_id | string | yes | Prefixed item ID such as itm_7f3a2c9e. |
context_id | string | no | Optional context identifier for analytics and attribution. Use the same context ID convention as your recommendation request, for example 101. |
type | string | yes | Event type configured in the console. |
session_id | string | no | Session identifier for attribution and analytics. |
request_id | string | no | Recommendation request ID returned by GET /v1/recommendations. |
placement | string | no | Surface or placement where the event occurred. |
occurred_at | integer | no | Unix timestamp for when the action happened. Defaults to ingestion time. |
<type> | object | no | Type-specific payload. Include {} when there are no type-specific fields. |
metadata | object | no | Additional event context. |
userId, itemId, eventType, event_type, eventId, event_id, contextId, sessionId, requestId, client_ts, clientTs, occurredAt, and timestamp are still accepted. Event batches are capped at 200 events per request by default.
Response
inserted, processed, session) and an embedding_refresh block describing the async user-embedding refresh job that was enqueued for the affected users.
Errors
| Status | Scenario |
|---|---|
400 | Missing required fields, invalid JSON, unknown item, or unknown event type |
401 | Missing or invalid Bearer token |
403 | Token does not include neuronsearchlab-api/write |
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
- object
- object[]
At least one user ID alias, one item ID alias, and one event type alias are required. Type-specific payloads are accepted as additional object properties named after the event type.
End-user identifier.
"usr_abc123"
CamelCase alias for user_id.
Public item ID.
^itm_[A-Za-z0-9][A-Za-z0-9_-]{2,}$"itm_7f3a2c9e"
CamelCase alias for item_id.
^itm_[A-Za-z0-9][A-Za-z0-9_-]{2,}$Tenant-configured event type.
"purchase"
Snake-case alias for type.
CamelCase alias for type.
Legacy alias for event type.
CamelCase legacy alias for event type.
Optional session identifier.
CamelCase alias for session_id.
Recommendation request ID to attribute this event to.
CamelCase alias for request_id.
Optional context identifier for analytics and attribution. Use the same context ID convention as the recommendation request.
"101"
CamelCase alias for context_id.
"101"
Surface or placement where the event happened.
"home_feed"
Arbitrary JSON object used for filtering, ranking, and debugging.
{
"category": "electronics",
"brand": "Acme",
"price": 10999,
"currency": "usd"
}Event occurrence timestamp. Numeric values below 1e12 are interpreted as Unix seconds.
1777478400
CamelCase alias for occurred_at.
Legacy timestamp alias.
Legacy client timestamp alias.
CamelCase alias for client_ts.
Response
Inserted events

