API reference

API reference · Recorder

Change an alert rule

PATCH/api/alerts/{id}Signed in session

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredintegerThe rule id.

Answer 200

The updated rule.

Fields of the 200 answer
FieldTypeWhat it is
ruleAlertRule
rule.idinteger
rule.namestring
rule.metricstringOne of "spend", "error_rate", "ttft_p95".
rule.thresholdintegerMicro USD, basis points, or milliseconds, by metric.
rule.windowMinutesinteger
rule.minSamplesintegerHow many requests the window needs before the number is believed.
rule.scopeModelstring or null
rule.scopeKeyIdinteger or null
rule.enabledboolean
rule.statestringOne of "ok", "firing".
rule.lastValueinteger or nullNull when the last check found nothing to measure.
rule.lastCheckedAtinteger or null
rule.lastTriggeredAtinteger or null
rule.createdAtinteger
rule.updatedAtinteger

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 404OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter