Creates a billing alert
Parameters
- alert_
typeenumRequired The type of alert to create.
Possible enum valuesusage_
threshold Use
usage_
if you intend for an alert to fire when a usage threshold on a meter is crossed.threshold - titlestringRequired
The title of the alert.
- usage_
thresholdobject The configuration of the usage threshold.
- usage_threshold.
gteintegerRequired Defines at which value the alert will fire.
- usage_threshold.
meterstringRequired The Billing Meter ID whose usage is monitored.
- usage_threshold.
recurrenceenumRequired Defines how the alert will behave.
Possible enum valuesone_
time Use
one_
if you intend for an alert to only fire once in the lifetime of a customer.time - usage_threshold.
filtersarray of objects The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time.
- usage_threshold.
filters. typeenumRequired What type of filter is being applied to this usage alert.
Possible enum valuescustomer
Use
customer
if you intend to filter this alert to a customer. - usage_threshold.
filters. customerstring Limit the scope to this usage alert only to this customer.
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"}