Retrieves a billing alert given an ID
Parameters
No parameters.
Returns
Returns the alert
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 valuesusage_
threshold Use
usage_
if you intend for an alert to fire when a usage threshold on a meter is crossed.threshold - 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
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.
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.
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.
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"}