Skip to main content
POST
/
customers
/
{external_customer_id}
/
wallets
/
{wallet_code}
/
alerts
Create wallet alert(s)
curl --request POST \
  --url https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "alert": {
    "code": "wallet_balance_alert",
    "thresholds": [
      {
        "value": 99,
        "code": "warn",
        "recurring": false
      }
    ],
    "alert_type": "wallet_balance_amount",
    "name": "Wallet Balance Alert"
  }
}
'
{
  "alert": {
    "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "external_subscription_id": "sub_1234567890",
    "external_customer_id": "cus_0987654321",
    "billable_metric": {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "name": "Storage",
      "code": "storage",
      "recurring": false,
      "created_at": "2022-09-14T16:35:31Z",
      "aggregation_type": "sum_agg",
      "description": "GB of storage used in my application",
      "rounding_function": "round",
      "rounding_precision": 2,
      "expression": "round((ended_at - started_at) * units)",
      "field_name": "gb",
      "weighted_interval": "seconds",
      "filters": [
        {
          "key": "region",
          "values": [
            "us-east-1"
          ]
        }
      ]
    },
    "alert_type": "billable_metric_current_usage_amount",
    "code": "storage_threshold_alert",
    "name": "Storage Usage Alert",
    "previous_value": 1000,
    "last_processed_at": "2025-05-19T10:04:21Z",
    "thresholds": [
      {
        "code": "warn",
        "recurring": false,
        "value": "99.0"
      }
    ],
    "created_at": "2025-03-20T10:00:00Z",
    "lago_wallet_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "wallet_code": "wallet_code",
    "direction": "increasing"
  }
}

Documentation Index

Fetch the complete documentation index at: https://getlago.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

You can also create multiple wallet alerts at once.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

external_customer_id
string
required

The customer external unique identifier (provided by your own application)

Example:

"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"

wallet_code
string
required

A unique wallet identifier within a customer. It is either set by the user at creation or auto-generated by Lago if not provided.

Example:

"wallet-code"

Body

application/json

Create a new alert for a wallet

alert
object
required

Response

Wallet alert(s) created

alert
object
required