curl --request POST \
--url https://api.trieve.ai/api/analytics/events/all \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"filter": {
"date_range": {
"gt": "2021-08-10T00:00:00Z",
"lt": "2021-08-11T00:00:00Z"
},
"event_type": "view",
"is_conversion": true,
"metadata_filter": "path = \"value\"",
"user_id": "user1"
},
"page": 1
}'{
"events": [
{
"created_at": "2021-08-10T00:00:00Z",
"dataset_id": "00000000-0000-0000-0000-000000000000",
"event_name": "Viewed Home Page",
"event_type": "view",
"is_conversion": true,
"items": [
"item1",
"item2"
],
"metadata": "metadata",
"request_id": "00000000-0000-0000-0000-000000000000",
"updated_at": "2021-08-10T00:00:00Z",
"user_id": "user1"
}
]
}This route allows you to view all user events.
curl --request POST \
--url https://api.trieve.ai/api/analytics/events/all \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"filter": {
"date_range": {
"gt": "2021-08-10T00:00:00Z",
"lt": "2021-08-11T00:00:00Z"
},
"event_type": "view",
"is_conversion": true,
"metadata_filter": "path = \"value\"",
"user_id": "user1"
},
"page": 1
}'{
"events": [
{
"created_at": "2021-08-10T00:00:00Z",
"dataset_id": "00000000-0000-0000-0000-000000000000",
"event_name": "Viewed Home Page",
"event_type": "view",
"is_conversion": true,
"items": [
"item1",
"item2"
],
"metadata": "metadata",
"request_id": "00000000-0000-0000-0000-000000000000",
"updated_at": "2021-08-10T00:00:00Z",
"user_id": "user1"
}
]
}JSON request payload to filter the events
Filter to apply to the events when querying for them
Show child attributes
DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
{
"gt": "2021-01-01 00:00:00.000",
"gte": "2021-01-01 00:00:00.000",
"lt": "2021-01-01 00:00:00.000",
"lte": "2021-01-01 00:00:00.000"
}view, filter_clicked, click, add_to_cart, purchase Filter by conversions
Filter by metadata path i.e. path.attribute = "value"
Filter by user ID
{
"date_range": {
"gt": "2021-08-10T00:00:00Z",
"lt": "2021-08-11T00:00:00Z"
},
"event_type": "view",
"is_conversion": true,
"metadata_filter": "path = \"value\"",
"user_id": "user1"
}Page of results to return
x >= 0The events for the request
Response body for the GetEvents endpoint
Show child attributes
The time the event was created.
The unique identifier for the dataset the event is associated with.
The name of the event, e.g. "Added to Cart", "Purchased", "Viewed Home Page", "Clicked", "Filter Clicked", "Followup Query".
The type of event, "add_to_cart", "purchase", "view", "click", "filter_clicked", "followup_query"
The unique identifier for the event
The items associated with the event. This could be a list of stringified json chunks for search events, or a list of items for add_to_cart, purchase, view, and click events.
The time the event was last updated.
Whether the event is a conversion event.
Additional metadata associated with the event. This can be custom data that is specific to the event.
The unique identifier for the request the event is associated with.
The type of request the event is associated with.
The user identifier associated with the event.
Was this page helpful?