Events
curl --request POST \
--url https://api.example.com/api/v1/eventsEvents
Ingest user behavior events for analytics and personalized recommendations
POST
/
api
/
v1
/
events
Events
curl --request POST \
--url https://api.example.com/api/v1/eventsAuthentication
All requests must include an API key via thex-api-key header or key query parameter.
curl -X POST https://alana.shopping/api/v1/events \
-H "Content-Type: application/json" \
-H "x-api-key: ak_your_api_key" \
-d '{
"events": [
{
"eventType": "detail-page-view",
"visitorId": "visitor-123",
"productId": "550e8400-e29b-41d4-a716-446655440000"
}
]
}'
Rate Limits
| Level | Limit | Window |
|---|---|---|
| Per API key | 1,000 requests | 1 minute |
| Per API key + IP | 100 requests | 1 minute |
Event Types
| Event Type | Required Fields | Description |
|---|---|---|
home-page-view | visitorId | User viewed the home page |
search | visitorId, query | User performed a search |
category-view | visitorId, categoryPath | User browsed a category page |
detail-page-view | visitorId, productId | User viewed a product detail page |
add-to-cart | visitorId, productId | User added a product to their cart |
shopping-cart-page-view | visitorId | User viewed their cart |
purchase-complete | visitorId, productIds, revenue, currency | User completed purchase |
Request Format
Send a batch of up to 100 events in a single request.{
"events": [
{
"eventType": "search",
"visitorId": "visitor-abc",
"userId": "user-123",
"query": "camiseta azul"
},
{
"eventType": "detail-page-view",
"visitorId": "visitor-abc",
"productId": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
Common Fields
| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | One of the 7 event types listed above |
visitorId | string | Yes | Anonymous visitor identifier |
userId | string | No | Authenticated user ID (for personalization) |
metadata | object | No | Additional context (free-form key/value) |
Response Format
{
"status": "ok",
"stored": 2,
"errors": 0
}
| Field | Type | Description |
|---|---|---|
status | string | Always "ok" on success |
stored | number | Number of events successfully stored |
errors | number | Number of events that failed validation |
Última modificação em 12 de março de 2026
⌘I