Skip to content
cloudhostDocs
API reference

Alerts

Alert rules on app and function metrics.

GET/v1/alerts

Rules and recent events#

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

  • rulesAlertRule[]required
    • idstring (uuid)required
    • projectstringrequired
    • kindstring
    • metricstringrequired
    • opstringrequired
    • thresholdnumberrequired
    • window_mininteger
    • channelsAlertChannels
    • statestringrequired

      one of ok, firing

    • last_valuenumber | null
    • changed_atstring (date-time) | null
  • eventsAlertEvent[]required
    • rule_idstring (uuid)
    • statestring
    • valuenumber
    • sentobject
    • atstring (date-time)
    • namestring
    • metricstring

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/alerts" \
  -H "Authorization: Bearer $KEY"
POST/v1/alerts

Create a rule#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Request bodyapplication/json

  • projectstringrequired
  • kindstring

    one of function, app · default "function"

  • metricstringrequired

    one of error_rate, p95_ms, p99_ms, requests

  • opstringrequired

    one of >, <

  • thresholdnumber | stringrequired
  • window_mininteger

    1–60 · default 5

  • channelsAlertChannelsrequired

Response

201object

  • idstring (uuid)required

Errors

StatusDescription
400Bad request: bad_metric, bad_op, bad_threshold, bad_window, bad_webhook, no_channel, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/alerts" \
  -H "Authorization: Bearer $KEY" \
  -d '{"project":"my-api","metric":"error_rate","op":">","threshold":1,"channels":{"email":true,"sms":true,"webhook":"https://example.com","bale":{"token":"…","chat":"…"},"eitaa":{"token":"…","chat":"…"}}}'
DELETE/v1/alerts/{id}

Delete a rule#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • idstring (uuid)pathrequired

    rule id

Response

200object

  • deletedboolean

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/alerts/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
  -H "Authorization: Bearer $KEY"
POST/v1/alerts/{id}/test

Send a test notification#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • idstring (uuid)pathrequired

    rule id

Response

200object

  • sentobjectrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/alerts/88e2fe1d-6d75-4de5-8c8f-27380ec66903/test" \
  -H "Authorization: Bearer $KEY"