Push cell usage
curl --request POST \
--url https://control.api.niadra.com/v1/usage \
--header 'Content-Type: application/json' \
--header 'X-Niadra-Cell-Token: <api-key>' \
--data '
{
"cell_id": "cell-1",
"items": [
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "session_billable",
"quantity": 182340,
"cost_micros": 0
},
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "event_ingested",
"quantity": 4120775,
"cost_micros": 0
}
]
}
'import requests
url = "https://control.api.niadra.com/v1/usage"
payload = {
"cell_id": "cell-1",
"items": [
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "session_billable",
"quantity": 182340,
"cost_micros": 0
},
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "event_ingested",
"quantity": 4120775,
"cost_micros": 0
}
]
}
headers = {
"X-Niadra-Cell-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Niadra-Cell-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cell_id: 'cell-1',
items: [
{
space_id: '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
period_start: '2026-09-01T00:00:00Z',
metric: 'session_billable',
quantity: 182340,
cost_micros: 0
},
{
space_id: '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
period_start: '2026-09-01T00:00:00Z',
metric: 'event_ingested',
quantity: 4120775,
cost_micros: 0
}
]
})
};
fetch('https://control.api.niadra.com/v1/usage', 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://control.api.niadra.com/v1/usage",
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([
'cell_id' => 'cell-1',
'items' => [
[
'space_id' => '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
'period_start' => '2026-09-01T00:00:00Z',
'metric' => 'session_billable',
'quantity' => 182340,
'cost_micros' => 0
],
[
'space_id' => '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
'period_start' => '2026-09-01T00:00:00Z',
'metric' => 'event_ingested',
'quantity' => 4120775,
'cost_micros' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Niadra-Cell-Token: <api-key>"
],
]);
$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://control.api.niadra.com/v1/usage"
payload := strings.NewReader("{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Niadra-Cell-Token", "<api-key>")
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://control.api.niadra.com/v1/usage")
.header("X-Niadra-Cell-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.api.niadra.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Niadra-Cell-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 2
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Control: platform operations
Push cell usage
Cells send their usage aggregates for billing.
POST
/
v1
/
usage
Push cell usage
curl --request POST \
--url https://control.api.niadra.com/v1/usage \
--header 'Content-Type: application/json' \
--header 'X-Niadra-Cell-Token: <api-key>' \
--data '
{
"cell_id": "cell-1",
"items": [
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "session_billable",
"quantity": 182340,
"cost_micros": 0
},
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "event_ingested",
"quantity": 4120775,
"cost_micros": 0
}
]
}
'import requests
url = "https://control.api.niadra.com/v1/usage"
payload = {
"cell_id": "cell-1",
"items": [
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "session_billable",
"quantity": 182340,
"cost_micros": 0
},
{
"space_id": "0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23",
"period_start": "2026-09-01T00:00:00Z",
"metric": "event_ingested",
"quantity": 4120775,
"cost_micros": 0
}
]
}
headers = {
"X-Niadra-Cell-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Niadra-Cell-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cell_id: 'cell-1',
items: [
{
space_id: '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
period_start: '2026-09-01T00:00:00Z',
metric: 'session_billable',
quantity: 182340,
cost_micros: 0
},
{
space_id: '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
period_start: '2026-09-01T00:00:00Z',
metric: 'event_ingested',
quantity: 4120775,
cost_micros: 0
}
]
})
};
fetch('https://control.api.niadra.com/v1/usage', 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://control.api.niadra.com/v1/usage",
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([
'cell_id' => 'cell-1',
'items' => [
[
'space_id' => '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
'period_start' => '2026-09-01T00:00:00Z',
'metric' => 'session_billable',
'quantity' => 182340,
'cost_micros' => 0
],
[
'space_id' => '0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23',
'period_start' => '2026-09-01T00:00:00Z',
'metric' => 'event_ingested',
'quantity' => 4120775,
'cost_micros' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Niadra-Cell-Token: <api-key>"
],
]);
$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://control.api.niadra.com/v1/usage"
payload := strings.NewReader("{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Niadra-Cell-Token", "<api-key>")
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://control.api.niadra.com/v1/usage")
.header("X-Niadra-Cell-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.api.niadra.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Niadra-Cell-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cell_id\": \"cell-1\",\n \"items\": [\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"session_billable\",\n \"quantity\": 182340,\n \"cost_micros\": 0\n },\n {\n \"space_id\": \"0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23\",\n \"period_start\": \"2026-09-01T00:00:00Z\",\n \"metric\": \"event_ingested\",\n \"quantity\": 4120775,\n \"cost_micros\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 2
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}
