curl --request POST \
--url https://api.withorb.com/v1/alerts/customer_id/{customer_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "credit_balance_depleted",
"currency": "<string>",
"thresholds": [
{
"value": 123
}
]
}
'{
"id": "<string>",
"type": "\"usage_exceeded\", \"cost_exceeded\", \"credit_balance_depleted\", \"credit_balance_recovered\", or \"credit_balance_dropped\"",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"thresholds": [
{
"value": 123
}
],
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"plan": {
"id": "m2t5akQeh2obwxeU",
"external_plan_id": "m2t5akQeh2obwxeU",
"name": "Example plan",
"plan_version": "<string>"
},
"subscription": {
"id": "<string>"
},
"metric": {
"id": "<string>"
},
"currency": "<string>",
"license_type": {
"id": "<string>"
},
"grouping_keys": [
"<string>"
],
"balance_alert_status": [
{
"threshold_value": 123,
"in_alert": true
}
]
}This endpoint creates a new alert to monitor a customer’s credit balance. There are three types of alerts that can be scoped to
customers: credit_balance_depleted, credit_balance_dropped, and credit_balance_recovered. Customers can have a maximum
of one of each type of alert per credit balance currency.
credit_balance_dropped alerts require a list of thresholds to be provided while credit_balance_depleted
and credit_balance_recovered alerts do not require thresholds.
curl --request POST \
--url https://api.withorb.com/v1/alerts/customer_id/{customer_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "credit_balance_depleted",
"currency": "<string>",
"thresholds": [
{
"value": 123
}
]
}
'{
"id": "<string>",
"type": "\"usage_exceeded\", \"cost_exceeded\", \"credit_balance_depleted\", \"credit_balance_recovered\", or \"credit_balance_dropped\"",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"thresholds": [
{
"value": 123
}
],
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"plan": {
"id": "m2t5akQeh2obwxeU",
"external_plan_id": "m2t5akQeh2obwxeU",
"name": "Example plan",
"plan_version": "<string>"
},
"subscription": {
"id": "<string>"
},
"metric": {
"id": "<string>"
},
"currency": "<string>",
"license_type": {
"id": "<string>"
},
"grouping_keys": [
"<string>"
],
"balance_alert_status": [
{
"threshold_value": 123,
"in_alert": true
}
]
}API Keys can be issued in the Orb's web application.
The type of alert to create. This must be a valid alert type.
credit_balance_depleted, credit_balance_dropped, credit_balance_recovered The case sensitive currency or custom pricing unit to use for this alert.
The thresholds that define the values at which the alert will be triggered.
Show child attributes
Created
Alerts within Orb monitor spending, usage, or credit balance and trigger webhooks when a threshold is exceeded.
Alerts created through the API can be scoped to either customers or subscriptions.
Also referred to as alert_id in this documentation.
"XuxCbt7x9L82yyeF"
The type of alert. This must be a valid alert type.
credit_balance_depleted, credit_balance_dropped, credit_balance_recovered "\"usage_exceeded\", \"cost_exceeded\", \"credit_balance_depleted\", \"credit_balance_recovered\", or \"credit_balance_dropped\""
The creation time of the resource in Orb.
Whether the alert is enabled or disabled.
The thresholds that define the conditions under which the alert will be triggered.
Show child attributes
The customer the alert applies to.
Show child attributes
The plan the alert applies to.
Show child attributes
The subscription the alert applies to.
Show child attributes
The metric the alert applies to.
Show child attributes
The name of the currency the credit balance or invoice cost is denominated in.
The license type the alert applies to. Only present for license alerts.
Show child attributes
The property keys to group cost alerts by. Only present for cost alerts with grouping enabled.
The current status of the alert. This field is only present for credit balance alerts.
Show child attributes
Was this page helpful?