Alerts
A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
Was this section helpful? Yes No
Create a billing alert
POST / v1 / billing / alerts
Retrieve a billing alert
GET / v1 / billing / alerts /:id
List billing alert notifications
GET / v1 / billing / alerts /:id / notifications
List billing alerts
GET / v1 / billing / alerts
Activate a billing alert
POST / v1 / billing / alerts /:id / activate
Archive a billing alert
POST / v1 / billing / alerts /:id / archive
Deactivate a billing alert
POST / v1 / billing / alerts /:id / deactivate
The Alert object
Attributes
- id string Unique identifier for the object.
- object string, value is "billing.alert" String representing the object’s type. Objects of the same type share the same value.
- alert _ type enum Defines the type of the alert. Possible enum values
usage_thresholdUseusage_thresholdif you intend for an alert to fire when a usage threshold on a meter is crossed. - livemode boolean If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - status nullable enum Status of the alert. This can be active, inactive or archived.
- title string Title of the alert.
- usage _ threshold nullable object Encapsulates configuration of the alert to monitor usage on a specific Billing Meter.
The Alert object
{ "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"}
Create a billing alert
POST / v1 / billing / alerts
Creates a billing alert
Parameters
- alert _ type enum Required The type of alert to create. Possible enum values
usage_thresholdUseusage_thresholdif you intend for an alert to fire when a usage threshold on a meter is crossed. - title string Required The title of the alert. The maximum length is 256 characters.
- usage _ threshold object The configuration of the usage threshold.
Returns
Returns a billing 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"}
