Skip to main content
PUT
Error

Authorizations

Authorization
string
header
required

A scoped AgentEye API key. Mint one in the dashboard under Settings → API keys, or with POST /v1/keys. Each endpoint names the permission it requires; a key without it gets 403 and a required_permission field naming what was missing.

Path Parameters

id
string<uuid>
required

The audit's id.

Body

application/json
name
string
required
additional_context
any

NOT writable here — see PUT /audits/{id}/context.

Present ONLY so a client that sends it gets a loud 422 instead of serde's default of silently ignoring an unknown field, which is how a whole feature goes missing with a green test suite.

channels
any
context
null | object

Reference context to store WITH the definition. Create only — an update sending it gets the same 422 as the two fields above.

It lives here for one reason, and the reason is a race, not convenience: the insert trigger queues an eval job whose next_attempt_at defaults to now(), so a new enabled audit is due the instant its row commits. A client that created the audit and then wrote its context in a second request could be overtaken by the dispatcher, and the first run — the one an operator watches — would argue without the brief they just typed. Writing both in one transaction removes the window rather than narrowing it: the job row and the context rows become visible together.

Why an update must NOT accept it: _audit_to_body (CLI) and auditToInput (dashboard) rebuild this whole body from an allowlist before every save, so a context field on the update path would be wiped by any unrelated edit — 200 OK, no error, brief gone. Create has no read-merge step and therefore no such hazard. See the module comment in routes/audit_context.rs.

control_sample_rate
number<float> | null
description
string | null
enabled
boolean | null
ignore_error_types
string[] | null
llm_budget
any
llm_enabled
boolean | null
llm_spec
any
lookback_window_secs
integer<int32> | null
min_count
integer<int32> | null
min_rate
number<float> | null
reference_urls
any

NOT writable here — see PUT /audits/{id}/context.

schedule_anchor
string<date-time> | null

Fixed phase for the schedule: runs land on anchor + N * interval. Omitted on create → default_schedule_anchor() (next 09:00 UTC, matching the 09:00 backfill in 20260721000200). Omitted on update → unchanged. NULL in the DB is still tolerated by the dispatcher (legacy drift path) but nothing this route writes can produce it any more.

schedule_interval_secs
integer<int32> | null
scope
any
sensitivity
string | null
signals
any
top_k
integer<int32> | null
window_mode
string | null

Response

Audit updated.