Create customer alert
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.
Path Parameters
Request Body required
- Array [
- ]
Possible values: [usage_exceeded
, cost_exceeded
, credit_balance_depleted
, credit_balance_dropped
, credit_balance_recovered
]
The type of alert to create. This must be a valid alert type.
thresholds object[] nullable
The thresholds that define the values at which the alert will be triggered.
The value at which an alert will fire. For credit balance alerts, the alert will fire at or below this value. For usage and cost alerts, the alert will fire at or above this value.
The case sensitive currency or custom pricing unit to use for this alert.
- 201
- 400
- 401
- 404
- 409
- 413
- 429
- 500
Created
Response Headers
Schema
- Array [
- ]
Also referred to as alert_id in this documentation.
Possible values: [usage_exceeded
, cost_exceeded
, credit_balance_depleted
, credit_balance_dropped
, credit_balance_recovered
]
The type of alert. This must be a valid alert type.
The creation time of the resource in Orb.
Whether the alert is enabled or disabled.
thresholds object[] nullable required
The thresholds that define the conditions under which the alert will be triggered.
The value at which an alert will fire. For credit balance alerts, the alert will fire at or below this value. For usage and cost alerts, the alert will fire at or above this value.
customer object nullable required
The customer the alert applies to.
plan object nullable required
The plan the alert applies to.
subscription object nullable required
The subscription the alert applies to.
metric object nullable required
The metric the alert applies to.
The name of the currency the credit balance or invoice cost is denominated in.
{
"id": "XuxCbt7x9L82yyeF",
"type": "\"usage_exceeded\", \"cost_exceeded\", \"credit_balance_depleted\", credit_balance_recovered\", or \"credit_balance_dropped\"",
"created_at": "2024-12-25T20:37:49.964Z",
"enabled": true,
"thresholds": [
{
"value": 0
}
],
"customer": {},
"plan": {},
"subscription": {},
"metric": {},
"currency": "string"
}
Bad Request
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#400-constraint-violation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-request-validation-errors
]
Possible values: [400
]
{}
Unauthorized
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#401-authentication-error
]
Possible values: [401
]
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "string",
"title": "string"
}
Not Found
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#404-feature-not-available
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-resource-not-found
]
Possible values: [404
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-url-not-found
]
Possible values: [404
]
{}
Conflict
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#409-resource-conflict
]
Possible values: [409
]
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "string",
"title": "string"
}
Request Entity Too Large
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#413-request-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-resource-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-too-many-results
]
Possible values: [413
]
{}
Too Many Requests
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#429-too-many-requests
]
Possible values: [429
]
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "string",
"title": "string"
}
Internal Server Error
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#500-internal-server-error
]
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 0,
"detail": "string",
"title": "string"
}