# API Checks (CLI)

Source: https://www.observeone.com/docs/cli/api-checks

- [Docs](/docs)
- [CLI](/docs/cli)
- API Checks (CLI)

# API Checks (CLI)

Copy Markdown

Manage API health checks from the obs CLI. Custom methods, headers, and assertions, plus runs, pause, mute, and delete.

Manage complex API health checks.

Copy

obs check create --name "Auth API" --url "https://api.example.com/auth" --method POST \

 --description "Signup endpoint" \

 --interval "*/5 * * * *" \

 --alert-channel-id 12 \

 --header "Authorization=Bearer test" --header "X-Trace=ci" \

 --assertion &#x27;{"type":"status_code","operator":"equals","value":"200"}&#x27; \

 --assertion &#x27;{"type":"json_path","operator":"equals","path":"$.ok","value":"true"}&#x27;

obs check list

obs check get <id>

obs check update <id> --description "Signup v2" --header "X-Trace=ci-v2"

obs check runs <id> --limit 10 # Recent executions

obs check run <id> # Trigger a manual run

obs check toggle <id> # Pause or resume execution

obs check toggle-muted <id> # Mute or unmute alerts without pausing

obs check delete <id> -y

obs check create --name "Auth API" --url "https://api.example.com/auth" --method POST \

 --description "Signup endpoint" \

 --interval "*/5 * * * *" \

 --alert-channel-id 12 \

 --header "Authorization=Bearer test" --header "X-Trace=ci" \

 --assertion &#x27;{"type":"status_code","operator":"equals","value":"200"}&#x27; \

 --assertion &#x27;{"type":"json_path","operator":"equals","path":"$.ok","value":"true"}&#x27;

obs check list

obs check get <id>

obs check update <id> --description "Signup v2" --header "X-Trace=ci-v2"

obs check runs <id> --limit 10 # Recent executions

obs check run <id> # Trigger a manual run

obs check toggle <id> # Pause or resume execution

obs check toggle-muted <id> # Mute or unmute alerts without pausing

obs check delete <id> -y

Flags: -d, --description, -i, --interval <cron>, --alert-channel-id <id> (repeatable), --no-alerts, --header KEY=VALUE (repeatable), --assertion <json> (repeatable).

Assertion JSON supports these type values: status_code, response_time, json_path (uses path), text_contains, header (uses path). Operators: equals, not_equals, greater_than, less_than, contains, not_contains, exists, regex_match.

See also: the [CLI reference overview](/docs/cli/reference).

Was this page helpful?
