Available since CLI v8.3.0.
checkly api command makes authenticated HTTP requests to the Checkly API. It handles authentication automatically using your current login credentials, so you can query or update your account without manually managing API keys in request headers. For available endpoints, refer to the API reference or the OpenAPI spec.
Prerequisites
Prerequisites
Before using
checkly api, ensure you have:- Checkly CLI installed
- Valid Checkly account authentication (run
npx checkly loginif needed)
Usage
The basic command takes an API endpoint path and optional flags.Terminal
application/json or a +json media type) are formatted as JSON. Attachments and other response bodies are streamed unchanged, without adding a trailing newline. If you use --jq, the response is parsed as JSON regardless of its content type. A non-JSON body produces an error.
Arguments
The command takes a single required argument.Options
All flags are optional.Examples
List all checks
Returns all checks in your account as JSON.Terminal
Extract specific fields with jq
Use--jq to filter or reshape the JSON response inline.
--jq requires jq to be installed on your system.Terminal
Paginate results
Use-F to pass query parameters. The API returns 10 results per page by default. Set -X GET explicitly, since the command otherwise switches to POST when fields are present.
Terminal
Get a single resource
Append the resource ID to the endpoint path to fetch a specific item.Terminal
List alert channels
Use--jq to extract only the fields you need from the response.
Terminal
Update a resource via stdin
Pipe JSON directly into the command using--input -:
Terminal
Terminal
Add custom request headers
Use-H to pass additional HTTP headers with the request. You can repeat the flag for multiple headers.
Terminal
Download a file
Redirect the response to a file. Replace/path/to/file with the relative API endpoint that returns your file. The command follows redirects and preserves the bytes of ZIP archives and other downloads.
Terminal
--include when saving a file because it adds HTTP headers to the output. Attachments, including JSON files, retain their original bytes unless you use --jq.
Inspect response headers
Use-i to include the HTTP status and headers in the output:
Terminal
content-range header tells you the total number of results (0-9/11 means items 0–9 of 11 total).
Debug a request
Use--verbose to print request and response headers to stderr:
Terminal
Related Commands
These commands are commonly used alongsidecheckly api.
checkly login- Sign in to your Checkly accountcheckly whoami- Display current account and user information