POST
/
alerts
/
customer_id
/
{customer_id}
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": "usage_exceeded",
  "thresholds": [
    {
      "value": 123
    }
  ],
  "currency": "<string>"
}'
{
  "id": "XuxCbt7x9L82yyeF",
  "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": "VDGsT23osdLb84KD"
  },
  "metric": {
    "id": "<string>"
  },
  "currency": "<string>"
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Path Parameters

customer_id
string | null
required

Body

application/json
type
enum<string>
required

The type of alert to create. This must be a valid alert type.

Available options:
usage_exceeded,
cost_exceeded,
credit_balance_depleted,
credit_balance_dropped,
credit_balance_recovered
currency
string
required

The case sensitive currency or custom pricing unit to use for this alert.

thresholds
object[] | null

The thresholds that define the values at which the alert will be triggered.

Thresholds are used to define the conditions under which an alert will be triggered.

Response

201
application/json
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.

id
string
required

Also referred to as alert_id in this documentation.

type
enum<string>
required

The type of alert. This must be a valid alert type.

Available options:
usage_exceeded,
cost_exceeded,
credit_balance_depleted,
credit_balance_dropped,
credit_balance_recovered
created_at
string
required

The creation time of the resource in Orb.

enabled
boolean
required

Whether the alert is enabled or disabled.

thresholds
object[] | null
required

The thresholds that define the conditions under which the alert will be triggered.

Thresholds are used to define the conditions under which an alert will be triggered.

customer
object | null
required

The customer the alert applies to.

plan
object | null
required

The plan the alert applies to.

subscription
object | null
required

The subscription the alert applies to.

metric
object | null
required

The metric the alert applies to.

currency
string | null
required

The name of the currency the credit balance or invoice cost is denominated in.