curl --request POST \
--url https://api.stigg.io/api/v2/usage \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"usages": [
{
"value": -9007199254740990,
"featureId": "<string>",
"customerId": "<string>",
"resourceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updateBehavior": "DELTA",
"dimensions": {},
"idempotencyKey": "<string>"
}
]
}
'import requests
url = "https://api.stigg.io/api/v2/usage"
payload = { "usages": [
{
"value": -9007199254740990,
"featureId": "<string>",
"customerId": "<string>",
"resourceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updateBehavior": "DELTA",
"dimensions": {},
"idempotencyKey": "<string>"
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
usages: [
{
value: -9007199254740990,
featureId: '<string>',
customerId: '<string>',
resourceId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updateBehavior: 'DELTA',
dimensions: {},
idempotencyKey: '<string>'
}
]
})
};
fetch('https://api.stigg.io/api/v2/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://api.stigg.io/api/v2/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([
'usages' => [
[
'value' => -9007199254740990,
'featureId' => '<string>',
'customerId' => '<string>',
'resourceId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updateBehavior' => 'DELTA',
'dimensions' => [
],
'idempotencyKey' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://api.stigg.io/api/v2/usage"
payload := strings.NewReader("{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://api.stigg.io/api/v2/usage")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"usages": [
{
"id": "<string>",
"value": -9007199254740990,
"timestamp": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"customerId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentUsage": 123,
"credit": {
"currencyId": "<string>",
"consumed": 123
},
"usagePeriodStart": "2023-11-07T05:31:56Z",
"usagePeriodEnd": "2023-11-07T05:31:56Z",
"nextResetDate": "2023-11-07T05:31:56Z",
"resourceId": "<string>"
}
],
"credits": [
{
"currencyId": "<string>",
"currentUsage": 123,
"usageLimit": 123,
"timestamp": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"resourceId": "<string>",
"usagePeriodEnd": "2023-11-07T05:31:56Z"
}
],
"entities": [
{
"customerId": "<string>",
"resourceId": "<string>",
"entityId": "<string>",
"entitlementId": "<string>",
"scopeEntityIds": [
"<string>"
],
"currentUsage": 123,
"usageUpdatedAt": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"currencyId": "<string>"
}
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Report usage measurements (v2)
Reports usage measurements for metered features. The reported usage is used to track, limit, and bill customer consumption. Credit balances are returned once per wallet in credits, not on each measurement.
curl --request POST \
--url https://api.stigg.io/api/v2/usage \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"usages": [
{
"value": -9007199254740990,
"featureId": "<string>",
"customerId": "<string>",
"resourceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updateBehavior": "DELTA",
"dimensions": {},
"idempotencyKey": "<string>"
}
]
}
'import requests
url = "https://api.stigg.io/api/v2/usage"
payload = { "usages": [
{
"value": -9007199254740990,
"featureId": "<string>",
"customerId": "<string>",
"resourceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updateBehavior": "DELTA",
"dimensions": {},
"idempotencyKey": "<string>"
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
usages: [
{
value: -9007199254740990,
featureId: '<string>',
customerId: '<string>',
resourceId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updateBehavior: 'DELTA',
dimensions: {},
idempotencyKey: '<string>'
}
]
})
};
fetch('https://api.stigg.io/api/v2/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://api.stigg.io/api/v2/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([
'usages' => [
[
'value' => -9007199254740990,
'featureId' => '<string>',
'customerId' => '<string>',
'resourceId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updateBehavior' => 'DELTA',
'dimensions' => [
],
'idempotencyKey' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://api.stigg.io/api/v2/usage"
payload := strings.NewReader("{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://api.stigg.io/api/v2/usage")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"usages\": [\n {\n \"value\": -9007199254740990,\n \"featureId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updateBehavior\": \"DELTA\",\n \"dimensions\": {},\n \"idempotencyKey\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"usages": [
{
"id": "<string>",
"value": -9007199254740990,
"timestamp": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"customerId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentUsage": 123,
"credit": {
"currencyId": "<string>",
"consumed": 123
},
"usagePeriodStart": "2023-11-07T05:31:56Z",
"usagePeriodEnd": "2023-11-07T05:31:56Z",
"nextResetDate": "2023-11-07T05:31:56Z",
"resourceId": "<string>"
}
],
"credits": [
{
"currencyId": "<string>",
"currentUsage": 123,
"usageLimit": 123,
"timestamp": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"resourceId": "<string>",
"usagePeriodEnd": "2023-11-07T05:31:56Z"
}
],
"entities": [
{
"customerId": "<string>",
"resourceId": "<string>",
"entityId": "<string>",
"entitlementId": "<string>",
"scopeEntityIds": [
"<string>"
],
"currentUsage": 123,
"usageUpdatedAt": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"currencyId": "<string>"
}
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Body
Report usage for metered features. Batch up to 100 records.
A list of usage reports to be submitted in bulk
1 - 100 elementsShow child attributes
Show child attributes
Response
The recorded usage measurements and the balance of each credit wallet they drew from.
Response containing reported usage measurements with current usage values, period information and reset dates, plus the balance of each credit wallet they drew from.
Reported usage measurements and the credit balances they drew from
Show child attributes
Show child attributes