Billing Events and Metrics
Ingest billable events
Ingests a batch of usage events for metering. Accepts up to 100 events per request. Each event must carry a unique unique_id for idempotency and may include arbitrary properties used by metric filters and aggregations.
POST
/
events
Ingest billable events
curl --request POST \
--url https://api.alguna.io/events \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"account": "cust_01H1VECT",
"event_name": "api_call",
"unique_id": "evt_abc123",
"properties": {},
"timestamp": "2026-04-01T10:00:00Z"
}
]
}
'import requests
url = "https://api.alguna.io/events"
payload = { "events": [
{
"account": "cust_01H1VECT",
"event_name": "api_call",
"unique_id": "evt_abc123",
"properties": {},
"timestamp": "2026-04-01T10:00:00Z"
}
] }
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: [
{
account: 'cust_01H1VECT',
event_name: 'api_call',
unique_id: 'evt_abc123',
properties: {},
timestamp: '2026-04-01T10:00:00Z'
}
]
})
};
fetch('https://api.alguna.io/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.alguna.io/events",
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' => [
[
'account' => 'cust_01H1VECT',
'event_name' => 'api_call',
'unique_id' => 'evt_abc123',
'properties' => [
],
'timestamp' => '2026-04-01T10:00:00Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"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.alguna.io/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
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.alguna.io/events")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
"<string>"
],
"ingested": [
"<string>"
]
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
Available options:
2026-04-01 Body
application/json
Array of events to ingest. Maximum 100 events per request
Show child attributes
Show child attributes
Previous
List billable metricsReturns a paginated list of billable metrics. Supports filtering by event name, aggregation method, aggregation field, and tag IDs. Results can be sorted by name.
Next
⌘I
Ingest billable events
curl --request POST \
--url https://api.alguna.io/events \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"account": "cust_01H1VECT",
"event_name": "api_call",
"unique_id": "evt_abc123",
"properties": {},
"timestamp": "2026-04-01T10:00:00Z"
}
]
}
'import requests
url = "https://api.alguna.io/events"
payload = { "events": [
{
"account": "cust_01H1VECT",
"event_name": "api_call",
"unique_id": "evt_abc123",
"properties": {},
"timestamp": "2026-04-01T10:00:00Z"
}
] }
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: [
{
account: 'cust_01H1VECT',
event_name: 'api_call',
unique_id: 'evt_abc123',
properties: {},
timestamp: '2026-04-01T10:00:00Z'
}
]
})
};
fetch('https://api.alguna.io/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.alguna.io/events",
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' => [
[
'account' => 'cust_01H1VECT',
'event_name' => 'api_call',
'unique_id' => 'evt_abc123',
'properties' => [
],
'timestamp' => '2026-04-01T10:00:00Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"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.alguna.io/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
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.alguna.io/events")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"account\": \"cust_01H1VECT\",\n \"event_name\": \"api_call\",\n \"unique_id\": \"evt_abc123\",\n \"properties\": {},\n \"timestamp\": \"2026-04-01T10:00:00Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
"<string>"
],
"ingested": [
"<string>"
]
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}