Skip to main content
POST
Create a detector

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body for creating a detector in a project.

name
string
required
project_id
string
required
template
string
required
detection_model
string | null
detection_provider
string | null
detection_source
string | null
enable_rca
boolean | null
enabled
boolean | null
output_schema
any[] | null
prompt
string | null

Detector instructions. Omit to adopt the canonical instructions of a standard template; required for any other template.

sample_rate
integer | null
trigger_conditions
any[] | null

Conditions gating WHICH completed traces the detector evaluates; omit or pass [] to evaluate every completed trace. Each condition is {field, op, value} (metadata also takes key): model_name/environment take =, !=; cost/total_tokens/duration_ms/errors take >, >=, <, <=, =; metadata takes =, contains. A condition is a deterministic pre-filter, not the flag decision - the prompt still judges every trace that passes.

Response

Successful Response

The created (or idempotently matched) detector.

created
boolean
required
enabled
boolean
required
id
string
required
name
string
required
project_id
string
required
sample_rate
integer
required