Events
Batch usage events
This endpoint is deprecated. It is used for transmitting usage measurement events to multiple subscriptions belonging to the same customer.
POST
/
events
/
batch
Authorization
Body
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/events/batch" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"event": {
"transaction_id": "__UNIQUE_ID__",
"external_subscription_ids": ["__SUBSCRIPTION_ID_1__", "__SUBSCRIPTION_ID_2__"],
"code": "__BILLABLE_METRIC_CODE__",
"timestamp": $(date +%s),
"properties": {
"custom_field": 12
}
}
}'
This response has no body data.
This endpoint is deprecated and will be removed on November 30, 2023.
In addition, please note that you cannot use the batch endpoint for charges that are paid in advance.
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
event
object
requiredWas this page helpful?
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/events/batch" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"event": {
"transaction_id": "__UNIQUE_ID__",
"external_subscription_ids": ["__SUBSCRIPTION_ID_1__", "__SUBSCRIPTION_ID_2__"],
"code": "__BILLABLE_METRIC_CODE__",
"timestamp": $(date +%s),
"properties": {
"custom_field": 12
}
}
}'
This response has no body data.