POST/api/orgs/{org_id}/spend-alerts

Create a spend alert

org_monthly_spend emails when the organization's spend this month reaches threshold_nano_usd; budget_fraction emails when a budget reaches threshold_fraction of its limit. Each kind takes only its own fields. Org admin or the provisioning key.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

Request body

  • kindenumrequired
    "org_monthly_spend""budget_fraction"
  • threshold_nano_usdinteger | null

    Integer nano-USD.

  • budget_idstring | null
  • threshold_fractionnumber | null

    Share of the budget's limit; 0.8 is 80%.

  • notify_emailstringrequired

Responses

  • 201

    The alert.

    Response
    • alert_idstringrequired
    • kindenumrequired
      "org_monthly_spend""budget_fraction"
    • threshold_nano_usdinteger | nullrequired
    • budget_idstring | nullrequired
    • threshold_fractionnumber | nullrequired
    • notify_emailstringrequired
    • created_atstringrequired
    • last_eventobject | nullrequired
      One of

      object

      • periodstringrequired

        YYYY-MM.

      • fired_atstringrequired
      • measured_nano_usdintegerrequired
      • threshold_nano_usdintegerrequired
      • delivered_atstring | nullrequired
      • delivery_errorstring | nullrequired
  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is not a provisioning key (inference keys are refused, reads included), or it is a customer-plan key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    Unknown organization or budget.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 409

    An identical alert exists.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    Fields that do not match the kind, or body validation.

Request

curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend-alerts' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "budget_fraction",
  "budget_id": "c4a2e8f1-7b3d-4e9a-8c15-3f0d6b2a9e71",
  "threshold_fraction": 0.8,
  "notify_email": "finance@acme.example"
}'

Response

{
  "alert_id": "3c5e7a9c-1e3b-4d5f-8a0c-2e4a6c8e0b69",
  "kind": "budget_fraction",
  "threshold_nano_usd": null,
  "budget_id": "c4a2e8f1-7b3d-4e9a-8c15-3f0d6b2a9e71",
  "threshold_fraction": 0.8,
  "notify_email": "finance@acme.example",
  "created_at": "2026-11-22T16:10:03Z",
  "last_event": null
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend-alerts