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/jsonrequired
required | Array of Clicked object IDs after search (object) or Added to cart object IDs after search (object) or Purchased object IDs after search (object) or Converted object IDs after search (object) or Clicked object IDs (object) or Purchased object IDs (object) or Added to cart 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. 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": "anonymous-user-1",
- "authenticatedUserToken": "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"
}
Delete user token.
Delete all events related to a certain user token from events metrics and analytics. To delete a personalization user profile, see Delete a user profile.
Authorizations:
path Parameters
userToken required | string [ 1 .. 129 ] characters [a-zA-Z0-9_=/+]{1,129} Example: test-user-1 The user token for which to delete all associated events. |
Responses
Response samples
- 422
- 429
{- "message": "string",
- "status": 0
}