Enviar eventos por lote
curl --request POST \
--url https://api.bevits.com/v1/events/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"name": "back_in_stock",
"customer": {
"email": "ana@exemplo.com.br"
},
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"external_id": "stock_CAM-01_u_8842"
},
{
"name": "back_in_stock",
"customer": {
"email": "bruno@exemplo.com.br"
},
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"external_id": "stock_CAM-01_u_9120"
}
]
}
'import requests
url = "https://api.bevits.com/v1/events/bulk"
payload = { "events": [
{
"name": "back_in_stock",
"customer": { "email": "ana@exemplo.com.br" },
"properties": { "product": {
"sku": "CAM-01",
"name": "Camiseta"
} },
"external_id": "stock_CAM-01_u_8842"
},
{
"name": "back_in_stock",
"customer": { "email": "bruno@exemplo.com.br" },
"properties": { "product": {
"sku": "CAM-01",
"name": "Camiseta"
} },
"external_id": "stock_CAM-01_u_9120"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
name: 'back_in_stock',
customer: {email: 'ana@exemplo.com.br'},
properties: {product: {sku: 'CAM-01', name: 'Camiseta'}},
external_id: 'stock_CAM-01_u_8842'
},
{
name: 'back_in_stock',
customer: {email: 'bruno@exemplo.com.br'},
properties: {product: {sku: 'CAM-01', name: 'Camiseta'}},
external_id: 'stock_CAM-01_u_9120'
}
]
})
};
fetch('https://api.bevits.com/v1/events/bulk', 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.bevits.com/v1/events/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
[
'name' => 'back_in_stock',
'customer' => [
'email' => 'ana@exemplo.com.br'
],
'properties' => [
'product' => [
'sku' => 'CAM-01',
'name' => 'Camiseta'
]
],
'external_id' => 'stock_CAM-01_u_8842'
],
[
'name' => 'back_in_stock',
'customer' => [
'email' => 'bruno@exemplo.com.br'
],
'properties' => [
'product' => [
'sku' => 'CAM-01',
'name' => 'Camiseta'
]
],
'external_id' => 'stock_CAM-01_u_9120'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/events/bulk"
payload := strings.NewReader("{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.bevits.com/v1/events/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/events/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "event_batch",
"created": 1,
"duplicate": 0,
"failed": 1,
"results": [
{
"status": "created",
"event": {
"object": "event",
"id": "evt_01jd2v9k3m8q4r5s6t7u8v9w0x",
"name": "back_in_stock",
"external_id": "stock_CAM-01_u_8842",
"occurred_at": "2026-11-18T17:03:01.000Z",
"received_at": "2026-11-18T17:03:01.000Z",
"customer": {
"id": "cus_ckabc123",
"matched_by": "email",
"created": false
},
"flows": [],
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"backfill": false,
"livemode": true
}
},
{
"status": "error",
"error": {
"type": "validation_error",
"code": "invalid_event_name",
"message": "Event names use lowercase letters, digits and underscores, start with a letter and have at most 64 characters. Did you mean \"back_in_stock\"?",
"param": "events[1].name",
"suggestion": "back_in_stock"
}
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key needs one of these scopes: \"write\", \"events:write\".",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "validation_error",
"code": "batch_too_large",
"message": "A batch can have at most 1 MB. Split it into smaller batches.",
"param": "events",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}Referencia
Enviar eventos por lote
Envía hasta 100 eventos y 1 MB en una llamada, cada uno como en POST /v1/events. No es atómico: cada evento vale por sí mismo, y results tiene el mismo orden y el mismo tamaño que events, con created, duplicate o error en cada posición. Los eventos se guardan en el orden enviado; el orden de ejecución de los flows no está garantizado. El límite es de 2000 eventos por segundo por clave API, contado por evento y no por solicitud. Exige una clave API con el permiso write o events:write.
POST
/
v1
/
events
/
bulk
Enviar eventos por lote
curl --request POST \
--url https://api.bevits.com/v1/events/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"name": "back_in_stock",
"customer": {
"email": "ana@exemplo.com.br"
},
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"external_id": "stock_CAM-01_u_8842"
},
{
"name": "back_in_stock",
"customer": {
"email": "bruno@exemplo.com.br"
},
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"external_id": "stock_CAM-01_u_9120"
}
]
}
'import requests
url = "https://api.bevits.com/v1/events/bulk"
payload = { "events": [
{
"name": "back_in_stock",
"customer": { "email": "ana@exemplo.com.br" },
"properties": { "product": {
"sku": "CAM-01",
"name": "Camiseta"
} },
"external_id": "stock_CAM-01_u_8842"
},
{
"name": "back_in_stock",
"customer": { "email": "bruno@exemplo.com.br" },
"properties": { "product": {
"sku": "CAM-01",
"name": "Camiseta"
} },
"external_id": "stock_CAM-01_u_9120"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
name: 'back_in_stock',
customer: {email: 'ana@exemplo.com.br'},
properties: {product: {sku: 'CAM-01', name: 'Camiseta'}},
external_id: 'stock_CAM-01_u_8842'
},
{
name: 'back_in_stock',
customer: {email: 'bruno@exemplo.com.br'},
properties: {product: {sku: 'CAM-01', name: 'Camiseta'}},
external_id: 'stock_CAM-01_u_9120'
}
]
})
};
fetch('https://api.bevits.com/v1/events/bulk', 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.bevits.com/v1/events/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
[
'name' => 'back_in_stock',
'customer' => [
'email' => 'ana@exemplo.com.br'
],
'properties' => [
'product' => [
'sku' => 'CAM-01',
'name' => 'Camiseta'
]
],
'external_id' => 'stock_CAM-01_u_8842'
],
[
'name' => 'back_in_stock',
'customer' => [
'email' => 'bruno@exemplo.com.br'
],
'properties' => [
'product' => [
'sku' => 'CAM-01',
'name' => 'Camiseta'
]
],
'external_id' => 'stock_CAM-01_u_9120'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/events/bulk"
payload := strings.NewReader("{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.bevits.com/v1/events/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/events/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"ana@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_8842\"\n },\n {\n \"name\": \"back_in_stock\",\n \"customer\": {\n \"email\": \"bruno@exemplo.com.br\"\n },\n \"properties\": {\n \"product\": {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\"\n }\n },\n \"external_id\": \"stock_CAM-01_u_9120\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "event_batch",
"created": 1,
"duplicate": 0,
"failed": 1,
"results": [
{
"status": "created",
"event": {
"object": "event",
"id": "evt_01jd2v9k3m8q4r5s6t7u8v9w0x",
"name": "back_in_stock",
"external_id": "stock_CAM-01_u_8842",
"occurred_at": "2026-11-18T17:03:01.000Z",
"received_at": "2026-11-18T17:03:01.000Z",
"customer": {
"id": "cus_ckabc123",
"matched_by": "email",
"created": false
},
"flows": [],
"properties": {
"product": {
"sku": "CAM-01",
"name": "Camiseta"
}
},
"backfill": false,
"livemode": true
}
},
{
"status": "error",
"error": {
"type": "validation_error",
"code": "invalid_event_name",
"message": "Event names use lowercase letters, digits and underscores, start with a letter and have at most 64 characters. Did you mean \"back_in_stock\"?",
"param": "events[1].name",
"suggestion": "back_in_stock"
}
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key needs one of these scopes: \"write\", \"events:write\".",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "validation_error",
"code": "batch_too_large",
"message": "A batch can have at most 1 MB. Split it into smaller batches.",
"param": "events",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}Autorizaciones
Encabezados
Cuerpo
application/json
Respuesta
Resultado de cada evento, en el orden enviado.