Skip to content

Usage Alerts & Thresholds

BoxBilling provides two mechanisms for monitoring usage: usage alerts track consumption against billable metrics, while usage thresholds track spending against monetary amounts. Both can trigger notifications and, in the case of thresholds, automatic mid-cycle invoicing.

Usage alertsUsage thresholds
TracksBillable metric consumptionMonetary spend (amount in cents)
ScopePer subscription + metricPer plan or subscription
TriggerUsage reaches threshold valueSpend reaches amount in cents
RecurringOptional — can re-trigger each periodOptional — can re-trigger each period
Use case”Alert when API calls hit 10,000""Invoice when spend reaches $500”
Create alert ──► subscription + metric + threshold
Usage accumulates during billing period
Usage reaches threshold_value
Alert triggers ──► webhook notification
(If recurring) ──► resets for next period
FieldTypeDescription
iduuidUnique alert identifier
organization_iduuidOrganization that owns the alert
subscription_iduuidSubscription being monitored
billable_metric_iduuidMetric being tracked
threshold_valuedecimalValue that triggers the alert
recurringbooleanWhether the alert resets each billing period (default: false)
namestring?Optional display name (max 255 chars)
times_triggeredintegerTotal number of times the alert has fired
triggered_atdatetime?When the alert last triggered
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp
Terminal window
curl -X POST /v1/usage_alerts/ \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subscription_id": "subscription-uuid",
"billable_metric_id": "metric-uuid",
"threshold_value": 10000,
"recurring": true,
"name": "API calls warning"
}'

Response (201):

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "org-uuid",
"subscription_id": "subscription-uuid",
"billable_metric_id": "metric-uuid",
"threshold_value": "10000",
"recurring": true,
"name": "API calls warning",
"times_triggered": 0,
"triggered_at": null,
"created_at": "2026-03-08T10:00:00Z",
"updated_at": "2026-03-08T10:00:00Z"
}

Set recurring to true for alerts that should fire every billing period when the threshold is reached. Non-recurring alerts fire once and then remain inactive.

Terminal window
curl -X PATCH /v1/usage_alerts/{alert_id} \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"threshold_value": 15000,
"name": "API calls warning (updated)"
}'

You can update threshold_value, name, and recurring. Changes take effect immediately.

Terminal window
curl /v1/usage_alerts/{alert_id} \
-H "Authorization: Bearer $API_KEY"
Terminal window
curl -X DELETE /v1/usage_alerts/{alert_id} \
-H "Authorization: Bearer $API_KEY"

Returns 204 No Content on success.

Terminal window
curl /v1/usage_alerts/ \
-H "Authorization: Bearer $API_KEY"

Supports pagination with skip and limit query parameters. Filter by subscription using subscription_id query parameter.

Get the current usage level relative to the alert threshold.

Terminal window
curl /v1/usage_alerts/{alert_id}/status \
-H "Authorization: Bearer $API_KEY"

Response (200):

{
"alert_id": "550e8400-e29b-41d4-a716-446655440000",
"current_usage": "7500",
"threshold_value": "10000",
"usage_percentage": "75.0",
"billing_period_start": "2026-03-01T00:00:00Z",
"billing_period_end": "2026-03-31T23:59:59Z"
}

The usage_percentage shows how close the subscription is to triggering the alert. Use this to build dashboards or proactive notifications.

Terminal window
curl /v1/usage_alerts/{alert_id}/triggers \
-H "Authorization: Bearer $API_KEY"

Response (200):

[
{
"id": "trigger-uuid",
"usage_alert_id": "550e8400-e29b-41d4-a716-446655440000",
"current_usage": "10250",
"threshold_value": "10000",
"metric_code": "api_calls",
"triggered_at": "2026-03-15T14:30:00Z"
}
]

Each trigger records the usage level and metric code at the moment the alert fired.

Check whether an alert would trigger based on current usage without actually firing it.

Terminal window
curl -X POST /v1/usage_alerts/{alert_id}/test \
-H "Authorization: Bearer $API_KEY"

Use this during setup to verify alert configuration before going live.

Usage thresholds monitor monetary spend and can trigger automatic mid-cycle invoicing when a spending limit is reached.

FieldTypeDescription
iduuidUnique threshold identifier
plan_iduuid?Plan this threshold belongs to (if plan-level)
subscription_iduuid?Subscription this threshold belongs to (if subscription-level)
amount_centsdecimalSpending amount that triggers the threshold
currencystringThree-letter currency code (default: USD)
recurringbooleanWhether the threshold resets each billing period (default: false)
threshold_display_namestring?Custom label (max 255 chars)
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp

Thresholds created on a plan apply to all subscriptions using that plan.

Terminal window
curl -X POST /v1/plans/pro_monthly/usage_thresholds \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_cents": 50000,
"currency": "USD",
"recurring": true,
"threshold_display_name": "Mid-cycle invoice at $500"
}'

Response (201):

{
"id": "660e8400-e29b-41d4-a716-446655440000",
"plan_id": "plan-uuid",
"subscription_id": null,
"amount_cents": "50000",
"currency": "USD",
"recurring": true,
"threshold_display_name": "Mid-cycle invoice at $500",
"created_at": "2026-03-08T10:00:00Z",
"updated_at": "2026-03-08T10:00:00Z"
}

For more granular control, create thresholds on individual subscriptions.

Terminal window
curl -X POST /v1/subscriptions/{subscription_id}/usage_thresholds \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_cents": 100000,
"currency": "USD",
"recurring": false
}'
Terminal window
# Plan-level thresholds
curl /v1/plans/pro_monthly/usage_thresholds \
-H "Authorization: Bearer $API_KEY"
# Subscription-level thresholds
curl /v1/subscriptions/{subscription_id}/usage_thresholds \
-H "Authorization: Bearer $API_KEY"
Terminal window
curl -X DELETE /v1/usage_thresholds/{threshold_id} \
-H "Authorization: Bearer $API_KEY"

Returns 204 No Content on success.

  • Subscriptions — usage alerts monitor a subscription’s metric consumption; thresholds can be set per subscription
  • Plans — usage thresholds can be defined at the plan level, applying to all subscriptions
  • Billable metrics — usage alerts track a specific metric’s accumulation
  • Invoices — usage thresholds can trigger mid-cycle invoice generation when spending limits are reached
MethodPathDescription
POST/v1/usage_alerts/Create a usage alert
GET/v1/usage_alerts/List usage alerts
GET/v1/usage_alerts/{alert_id}Get a usage alert
PATCH/v1/usage_alerts/{alert_id}Update a usage alert
DELETE/v1/usage_alerts/{alert_id}Delete a usage alert
GET/v1/usage_alerts/{alert_id}/statusGet alert status with current usage
GET/v1/usage_alerts/{alert_id}/triggersList alert trigger history
POST/v1/usage_alerts/{alert_id}/testTest alert against current usage
MethodPathDescription
POST/v1/plans/{plan_code}/usage_thresholdsCreate a plan-level threshold
GET/v1/plans/{plan_code}/usage_thresholdsList plan thresholds
POST/v1/subscriptions/{subscription_id}/usage_thresholdsCreate a subscription-level threshold
GET/v1/subscriptions/{subscription_id}/usage_thresholdsList subscription thresholds
DELETE/v1/usage_thresholds/{threshold_id}Delete a threshold