Skip to content

rules_test

POST
/v1/rules/test
curl --request POST \
--url https://example.com/v1/rules/test \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "title": "example", "tool": "example", "callback_url": "example", "summary": "example", "source": { "integration": null, "agent": null, "session": null, "session_title": null, "cwd": null, "repo": null, "branch": null, "host": null }, "kind": "command", "risk": "low", "previews": [ { "type": "text", "title": "example", "lang": "example", "inline": "example", "blob": "example", "mime": "example", "name": "example", "size": 1, "files": [ { "path": "example", "blob": "example", "mime": "example", "size": 1, "lang": "example" } ], "entry": "example", "command": { "shell": null, "argv": null, "cwd": null, "env_keys": [] }, "email": { "from": null, "to": [], "cc": [], "bcc": [], "reply_to": null, "subject": "", "date": null, "body": "", "body_html": null, "attachments": [], "in_reply_to": null }, "before_blob": "example", "after_blob": "example" } ], "options": [ { "id": "example", "label": "example", "outcome": "approve", "style": "example" } ], "input": { "feedback": "example", "fields": [ "example" ], "questions": [ { "id": "example", "header": "example", "question": "example", "multi": true, "recommended": 1, "allow_free_text": true, "options": [ { "label": "example", "description": "example", "preview": "example" } ] } ] }, "timeout": "example", "on_timeout": "deny", "dedupe_key": "example", "status": "pending", "content_hash": "example", "created_at": 1, "expires_at": 1, "decision": { "option": "example", "feedback": "example", "fields": { "answers": "example" }, "content_hash": "example", "decided_by": "example", "decided_at": 1, "outcome": "approve", "rule_id": "example", "scope": "example", "run_result": { "exit_code": 1, "stdout_tail": "example", "stderr_tail": "example", "duration_ms": 1, "truncated": true, "elevated": true, "error": "example" } }, "run": { "started_at": 1, "lease_until": 1, "elevated": true } }'
Media typeapplication/json
object
id
string
title
required
string
tool
string | null
callback_url

Terminal-event destination; requires the daemon callbacks.allowlist.

string | null
summary
string | null
source
object
integration

Server-verified integration token name; caller values are overwritten.

string | null
agent
string | null
session
string | null
session_title

Display-only session name; scoped rules always use the session ID.

string | null
cwd
string | null
repo
string | null
branch
string | null
host
string | null
kind
string
Allowed values: command edit review question custom
risk
string
Allowed values: low medium high
previews
Array<object>
object
type
required
string
Allowed values: text markdown code diff files command json html image video audio file pdf email
title
string | null
lang
string | null
inline
string | null
blob
string | null
mime
string | null
name
string | null
size
integer | null format: int64
files
Array<object> | null
object
path
required
string
blob
required
string
mime
required
string
size
required
integer format: int64
lang
string | null
entry
string | null
command
One of:
null
email
One of:
null
before_blob
string | null
after_blob
string | null
options
Array<object>
object
id
required
string
label
required
string
outcome
required
string
Allowed values: approve deny
style
string | null
input
One of:
null
timeout

Optional positive duration, at most one year. Absent uses config; null/none disables expiry.

string | null
on_timeout
string
Allowed values: deny approve expire
dedupe_key
string | null
status
string
Allowed values: pending approved denied answered expired cancelled
content_hash
string
created_at
integer format: int64
expires_at
integer | null format: int64
decision
One of:
null
run
One of:
null

First matching rule, or null