Events
Ingest events
Ingest usage events for metering and billing purposes.
Events are deduplicated by (event_id, customer_id) — re-sending the same pair will not be
double-counted. The first copy received is kept and later copies are ignored, whatever they change.
By default, any invalid event rejects the entire batch. Set allow_partial_failures to true to ingest valid events and receive per-event failure details in the response body.
POST
/
api
/
v1
/
events
/
ingest
Ingest events
curl --request POST \
--url https://api.example.com/api/v1/events/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"code": "<string>",
"customer_id": "<string>",
"event_id": "<string>",
"properties": {
"region": "us-east-1",
"tier": "pro",
"bytes": "1048576"
},
"timestamp": "2026-01-15T10:30:00Z"
}
],
"allow_backfilling": true,
"allow_partial_failures": true
}
'import requests
url = "https://api.example.com/api/v1/events/ingest"
payload = {
"events": [
{
"code": "<string>",
"customer_id": "<string>",
"event_id": "<string>",
"properties": {
"region": "us-east-1",
"tier": "pro",
"bytes": "1048576"
},
"timestamp": "2026-01-15T10:30:00Z"
}
],
"allow_backfilling": True,
"allow_partial_failures": True
}
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: [
{
code: '<string>',
customer_id: '<string>',
event_id: '<string>',
properties: {region: 'us-east-1', tier: 'pro', bytes: '1048576'},
timestamp: '2026-01-15T10:30:00Z'
}
],
allow_backfilling: true,
allow_partial_failures: true
})
};
fetch('https://api.example.com/api/v1/events/ingest', 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/ingest",
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' => [
[
'code' => '<string>',
'customer_id' => '<string>',
'event_id' => '<string>',
'properties' => [
'region' => 'us-east-1',
'tier' => 'pro',
'bytes' => '1048576'
],
'timestamp' => '2026-01-15T10:30:00Z'
]
],
'allow_backfilling' => true,
'allow_partial_failures' => true
]),
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.example.com/api/v1/events/ingest"
payload := strings.NewReader("{\n \"events\": [\n {\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\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.example.com/api/v1/events/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/events/ingest")
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 \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\n}"
response = http.request(request)
puts response.read_body{
"failures": [
{
"event_id": "<string>",
"reason": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}Authorizations
Body
application/json
⌘I
Ingest events
curl --request POST \
--url https://api.example.com/api/v1/events/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"code": "<string>",
"customer_id": "<string>",
"event_id": "<string>",
"properties": {
"region": "us-east-1",
"tier": "pro",
"bytes": "1048576"
},
"timestamp": "2026-01-15T10:30:00Z"
}
],
"allow_backfilling": true,
"allow_partial_failures": true
}
'import requests
url = "https://api.example.com/api/v1/events/ingest"
payload = {
"events": [
{
"code": "<string>",
"customer_id": "<string>",
"event_id": "<string>",
"properties": {
"region": "us-east-1",
"tier": "pro",
"bytes": "1048576"
},
"timestamp": "2026-01-15T10:30:00Z"
}
],
"allow_backfilling": True,
"allow_partial_failures": True
}
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: [
{
code: '<string>',
customer_id: '<string>',
event_id: '<string>',
properties: {region: 'us-east-1', tier: 'pro', bytes: '1048576'},
timestamp: '2026-01-15T10:30:00Z'
}
],
allow_backfilling: true,
allow_partial_failures: true
})
};
fetch('https://api.example.com/api/v1/events/ingest', 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/ingest",
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' => [
[
'code' => '<string>',
'customer_id' => '<string>',
'event_id' => '<string>',
'properties' => [
'region' => 'us-east-1',
'tier' => 'pro',
'bytes' => '1048576'
],
'timestamp' => '2026-01-15T10:30:00Z'
]
],
'allow_backfilling' => true,
'allow_partial_failures' => true
]),
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.example.com/api/v1/events/ingest"
payload := strings.NewReader("{\n \"events\": [\n {\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\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.example.com/api/v1/events/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/events/ingest")
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 \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"properties\": {\n \"region\": \"us-east-1\",\n \"tier\": \"pro\",\n \"bytes\": \"1048576\"\n },\n \"timestamp\": \"2026-01-15T10:30:00Z\"\n }\n ],\n \"allow_backfilling\": true,\n \"allow_partial_failures\": true\n}"
response = http.request(request)
puts response.read_body{
"failures": [
{
"event_id": "<string>",
"reason": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}