curl --request POST \
--url https://api.getenso.ai/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": {
"source": "billing-job"
},
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}
'import requests
url = "https://api.getenso.ai/events"
payload = {
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": { "source": "billing-job" },
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}
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({
CustomerEntityId: 'ent_6CsgzAdRgTlzT_9O',
metric: 'api_calls',
value: 42,
timestamp: '2026-04-01T12:00:00Z',
metadata: {source: 'billing-job'},
eventId: 'evt_123',
JobId: 'job_xI_wWRvcLpZzhiJF',
jobId: 'job_xI_wWRvcLpZzhiJF'
})
};
fetch('https://api.getenso.ai/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.getenso.ai/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([
'CustomerEntityId' => 'ent_6CsgzAdRgTlzT_9O',
'metric' => 'api_calls',
'value' => 42,
'timestamp' => '2026-04-01T12:00:00Z',
'metadata' => [
'source' => 'billing-job'
],
'eventId' => 'evt_123',
'JobId' => 'job_xI_wWRvcLpZzhiJF',
'jobId' => 'job_xI_wWRvcLpZzhiJF'
]),
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.getenso.ai/events"
payload := strings.NewReader("{\n \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\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.getenso.ai/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getenso.ai/events")
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 \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\n}"
response = http.request(request)
puts response.read_body{
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": {
"source": "billing-job"
},
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}{
"status": "error",
"message": "Error",
"errors": [
"CustomerEntityId is required"
],
"code": 2001
}Create events
API to create an event
curl --request POST \
--url https://api.getenso.ai/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": {
"source": "billing-job"
},
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}
'import requests
url = "https://api.getenso.ai/events"
payload = {
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": { "source": "billing-job" },
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}
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({
CustomerEntityId: 'ent_6CsgzAdRgTlzT_9O',
metric: 'api_calls',
value: 42,
timestamp: '2026-04-01T12:00:00Z',
metadata: {source: 'billing-job'},
eventId: 'evt_123',
JobId: 'job_xI_wWRvcLpZzhiJF',
jobId: 'job_xI_wWRvcLpZzhiJF'
})
};
fetch('https://api.getenso.ai/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.getenso.ai/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([
'CustomerEntityId' => 'ent_6CsgzAdRgTlzT_9O',
'metric' => 'api_calls',
'value' => 42,
'timestamp' => '2026-04-01T12:00:00Z',
'metadata' => [
'source' => 'billing-job'
],
'eventId' => 'evt_123',
'JobId' => 'job_xI_wWRvcLpZzhiJF',
'jobId' => 'job_xI_wWRvcLpZzhiJF'
]),
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.getenso.ai/events"
payload := strings.NewReader("{\n \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\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.getenso.ai/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getenso.ai/events")
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 \"CustomerEntityId\": \"ent_6CsgzAdRgTlzT_9O\",\n \"metric\": \"api_calls\",\n \"value\": 42,\n \"timestamp\": \"2026-04-01T12:00:00Z\",\n \"metadata\": {\n \"source\": \"billing-job\"\n },\n \"eventId\": \"evt_123\",\n \"JobId\": \"job_xI_wWRvcLpZzhiJF\",\n \"jobId\": \"job_xI_wWRvcLpZzhiJF\"\n}"
response = http.request(request)
puts response.read_body{
"CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
"metric": "api_calls",
"value": 42,
"timestamp": "2026-04-01T12:00:00Z",
"metadata": {
"source": "billing-job"
},
"eventId": "evt_123",
"JobId": "job_xI_wWRvcLpZzhiJF",
"jobId": "job_xI_wWRvcLpZzhiJF"
}{
"status": "error",
"message": "Error",
"errors": [
"CustomerEntityId is required"
],
"code": 2001
}EntityService:getEntityByIdentifier, EventService:createEvent, MeterService:createUsageByMeterAuthorizations
JWT bearer token obtained from POST /auth/system-login using your client credentials.
Body
Event object that needs to be created
Enso ID of the customer entity associated with the event. If Enso ID is not known, you can pass any unique identifier of the customer entity instead.
"ent_6CsgzAdRgTlzT_9O"
Metric name
"api_calls"
Value of the metric
42
Timestamp of the event
"2026-04-01T12:00:00Z"
Additional metadata for the event
{ "source": "billing-job" }
Unique identifier for the event. If not passed, an event ID may be generated from metric, value, timestamp, and CustomerEntityId.
"evt_123"
Job identifier for the event import or batch
"job_xI_wWRvcLpZzhiJF"
Job identifier for the event import or batch
"job_xI_wWRvcLpZzhiJF"
Response
Event created
Enso ID of the customer entity associated with the event. If Enso ID is not known, you can pass any unique identifier of the customer entity instead.
"ent_6CsgzAdRgTlzT_9O"
Metric name
"api_calls"
Value of the metric
42
Timestamp of the event
"2026-04-01T12:00:00Z"
Additional metadata for the event
{ "source": "billing-job" }
Unique identifier for the event. If not passed, an event ID may be generated from metric, value, timestamp, and CustomerEntityId.
"evt_123"
Job identifier for the event import or batch
"job_xI_wWRvcLpZzhiJF"
Job identifier for the event import or batch
"job_xI_wWRvcLpZzhiJF"

