Retrieves a billing alert given an ID

Parameters

No parameters.

Returns

Returns the alert

GET /v1/billing/alerts/:id
cURL
curl https://api.stripe.com/v1/billing/alerts/alrt_12345 \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "alrt_12345",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 10000,
"meter": "mtr_12345",
"recurrence": "one_time"
},
"status": "active"
}

Lists billing active and inactive alerts

Parameters

  • alert_typeenum

    Filter results to only include this type of alert.

    Possible enum values
    usage_threshold

    Use usage_threshold if you intend for an alert to fire when a usage threshold on a meter is crossed.

  • meterstring

    Filter results to only include alerts with the given meter.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

Returns a list of billing alerts

GET /v1/billing/alerts
curl https://api.stripe.com/v1/billing/alerts \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"data": [
{
"id": "alrt_12345",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 10000,
"meter": "mtr_12345",
"recurrence": "one_time"
},
"status": "active"
},
{
"id": "alrt_67890",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 120,
"meter": "mtr_67890",
"recurrence": "one_time"
},
"status": "active"
}
]
}

Reactivates this alert, allowing it to trigger again.

Parameters

No parameters.

Returns

Returns the alert with its updated status.

POST /v1/billing/alerts/:id/activate
cURL
curl -X POST https://api.stripe.com/v1/billing/alerts/alrt_12345/activate \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "alrt_12345",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 10000,
"meter": "mtr_12345",
"recurrence": "one_time"
},
"status": "active"
}

Archives this alert, removing it from the list view and APIs. This is non-reversible.

Parameters

No parameters.

Returns

Returns the alert with its updated status.

POST /v1/billing/alerts/:id/archive
cURL
curl -X POST https://api.stripe.com/v1/billing/alerts/alrt_12345/archive \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "alrt_12345",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 10000,
"meter": "mtr_12345",
"recurrence": "one_time"
},
"status": "archived"
}

Deactivates this alert, preventing it from triggering.

Parameters

No parameters.

Returns

Returns the alert with its updated status.

POST /v1/billing/alerts/:id/deactivate
cURL
curl -X POST https://api.stripe.com/v1/billing/alerts/alrt_12345/deactivate \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "alrt_12345",
"object": "billing.alert",
"title": "API Request usage alert",
"livemode": true,
"alert_type": "usage_threshold",
"usage_threshold": {
"gte": 10000,
"meter": "mtr_12345",
"recurrence": "one_time"
},
"status": "inactive"
}