Insights API (1.0.0)
Download OpenAPI specification:Download
The Algolia Insights API lets you collect events related to your search and discovery experience. Events represent actions that users take on your app or website. They unlock powerful features, such as recommendations, personalization, smarter search results, and analytics that help you optimize your user experience.
Events represent user interactions with your website or app. They include details like the event's name, type, a timestamp or a user token.
Send events
Send a list of events to the Insights API.
You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB.
Authorizations:
Request Body schema: application/json
required | Array of Clicked object IDs after search (object) or Converted object IDs after search (object) or Clicked object IDs (object) or Converted object IDs (object) or Clicked filters (object) or Converted filters (object) or Viewed object IDs (object) or Viewed filters (object) (EventsItems) [ 1 .. 1000 ] items List of click and conversion events. An event is an object representing a user interaction. Events have attributes that describe the interaction, such as an event name, a type, or a user token. Some attributes require other attributes to be declared, and some attributes can't be declared at the same time. All events must be valid, otherwise the API returns an error. | ||||||||||||||||
Array ([ 1 .. 1000 ] items) One of
|
Responses
Request samples
- Payload
{- "events": [
- {
- "eventName": "Products Clicked",
- "eventType": "click",
- "index": "test-index",
- "userToken": "test-user-1",
- "objectIDs": [
- "object-1"
], - "positions": [
- 1
], - "queryID": "7dfe2ada7bca48bdd0629649df0bee07"
}
]
}
Response samples
- 200
- 400
- 401
- 404
- 405
- 413
- 422
Success indicates that the Insights API received the events correctly, and that event properties are formatted correctly. Success doesn't imply that the event can be used by any Algolia feature. For example, the Insights API doesn't check if the index name you provided exists, or if the object IDs exist in your index.
{- "status": 200,
- "message": "OK"
}