API reference · Monitoring

Get alert rules

GET/v1/bots/{bot_id}/alerts

A bot's alert rules, where alerts go, and its open and recent incidents.

On this page

Auth. An account token (Authorization: Bearer lb_…) or a signed-in web session. A report-only token (lbr_…) is refused here with 403 scope_denied.

Limits. Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

Parameters

Path parameters

NameTypeRequiredDescription
bot_idstringyesThe bot id (bot_…).

Request

Terminal
curl "https://api.langbot.ai/v1/bots/bot_01M6G72RFQRQ8JGNG8T1447GGP/alerts" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"

Response

200 OK

JSON
{
  "rules": {
    "heartbeat_missing_min": 5,
    "daily_loss_usd": 50.0,
    "drift": {
      "metric": "pnl_per_contract",
      "min_fills": 30,
      "threshold": 0.05
    },
    "halted": true
  },
  "channels": {
    "email": {
      "enabled": true,
      "to": "docs-1163406543@example.com"
    },
    "webhook": {
      "url": "https://example.com/langbot-alerts",
      "secret_set": true
    }
  },
  "incidents": []
}

Errors

StatuscodeWhen
404not_foundNo bot with that id on your account (or it was deleted).
401auth_requiredNo token was sent.
401token_invalidThe token was not recognised (mistyped, revoked or expired).
422validation_errorA parameter failed validation; detail[].loc names it.
429rate_limitedOver your request budget; wait Retry-After seconds.

Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.