Events
curl --request POST \
--url https://api.example.com/api/v1/eventsimport requests
url = "https://api.example.com/api/v1/events"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/events"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEvents
Ingest user behavior events for analytics and personalized recommendations
POST
/
api
/
v1
/
events
Events
curl --request POST \
--url https://api.example.com/api/v1/eventsimport requests
url = "https://api.example.com/api/v1/events"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/events"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
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