API keys and the public API
Authenticate, inspect monitors, and automate changes with complete request examples.
11 min readThis guide covers Premium features. Premium is in early access and cannot be bought yet.
Create a workspace key
API access requires the workspace owner’s Premium plan. Premium is in early access and cannot be bought yet. A workspace can hold up to 10 keys, including expired ones. A key belongs to its workspace and survives the departure of its creator.
A token starts with cm_ followed by 64 hexadecimal characters. Choose an expiry of 1–365 days, or no expiry. If a key is lost, remove it and create another. API keys cannot create or manage other API keys.
- As the workspace owner or an editor, open Workspace settings → API keys. Choose a workspace before creating the key.
- Give the key a recognizable name, choose Read or Read and write, and select an expiry. Start with Read for dashboards and inspection.
- Copy the token when it is shown. Cheapmonit shows it once; store it in your secret manager or a private environment variable.
Authentication and base URL
The production base URL is https://cheapmonit.com/api/v1. For a self-hosted installation, replace the origin with your domain. Local development uses http://localhost:8088/api/v1 unless you changed the port.
Send Authorization: Bearer <key> on every request. Browser sessions, email/password credentials, and keys in query strings are not accepted. REST requests use JSON; send Content-Type: application/json for JSON bodies. A key always selects its own workspace; no workspace selector is needed.
read -rs -p 'Cheapmonit API key: ' CHEAPMONIT_API_KEY
export CHEAPMONIT_API_KEY
printf '\n'The shell examples use Bash and curl 7.76 or newer for --fail-with-body. The prompt keeps the key out of the command itself. Use your CI secret store for automation.
Make your first request
After loading CHEAPMONIT_API_KEY, list the workspace’s monitors. A successful request returns HTTP 200 and a JSON array, which is empty when the workspace has no monitors. Each monitor includes its id, address, current state, latest check, and seven days of uptime.
Use the returned monitor id in detail and history requests. IDs are UUIDs; replace the MONITOR_ID placeholder below before running examples that need one.
The response example shows selected fields from a new monitor. The complete object also includes request settings, header names, certificate and domain observations, and daily history; header values are never returned.
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/monitors"[
{
"id": "019a0000-0000-7000-8000-000000000001",
"name": "Production health",
"url": "https://example.com/health",
"kind": "http",
"enabled": true,
"status": "pending",
"check_interval_seconds": 300,
"verify_ssl": true,
"uptime": null,
"last_check": null
}
]MONITOR_ID='replace-with-a-monitor-uuid'curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID"REST endpoint reference
All paths below are relative to /api/v1. Write keys also have every read permission. Successful routes in this table return HTTP 200; monitor creation returns an object containing the new id. List routes return arrays except the report, which returns an object.
| Method and path | Access | Result |
|---|---|---|
| GET /monitors | Read | Workspace monitor array with latest checks and seven-day uptime |
| GET /monitors/{id} | Read | One monitor object; 404 when unavailable |
| GET /monitors/{id}/checks?before= | Read | Latest 200 checks, newest first; before= a check ID returns the 200 before it; an unavailable monitor returns an empty array |
| GET /monitors/{id}/uptime?days=30 | Read | Overall uptime and daily history; days is 7, 30, or 90 (default 7) |
| GET /incidents | Read | Latest 200 workspace incidents, newest first |
| GET /reports?days=30 | Read | Availability, error budgets, MTTA, and MTTR; days is 7, 30, or 90 (default 30) |
| GET /status-pages | Read | Workspace status pages with sections and components; no password hashes |
| POST /monitors | Write | Create a monitor; returns {"id":"…"} |
| PATCH /monitors/{id} | Write | Change supplied settings while keeping omitted settings; returns id |
| DELETE /monitors/{id} | Write | Delete the monitor and its history; returns {"ok":true} |
| POST /incidents/{id}/acknowledge | Write | Acknowledge an open incident; returns {"ok":true} |
Members, alert channels, schedules, account settings, API key management, and status page editing are outside the public API. Use the dashboard for those operations.
OpenAPI specification
The public API is described by an OpenAPI 3.1 document at https://cheapmonit.com/openapi.json. It covers every route on this page and the MCP endpoint, with request fields, response objects, and error statuses. Downloading it needs no key.
Import it into Postman, Insomnia, or Bruno, or generate a typed client with a tool such as openapi-generator. Each operation’s security requirement names the key it needs: read or write. For a self-hosted installation, change the server URL to your own origin.
curl --fail-with-body --silent --show-error \
"https://cheapmonit.com/openapi.json" --output cheapmonit-openapi.jsonCreate a monitor
Creation requires name and url. Defaults are an enabled HTTP monitor, verified TLS certificates, GET requests, any 2xx response, and hourly checks. A newly created monitor begins with no observed uptime; creation does not wait for its first check.
Use an HTTP or HTTPS URL for an HTTP monitor, or a public host:port for TCP or UDP. Private, loopback, and reserved destinations are refused. The account-wide monitor limit includes paused monitors. Premium allows 100 monitors across the account’s owned workspaces, including paused ones.
curl --fail-with-body --silent --show-error \
--request POST \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"name":"Production health","url":"https://example.com/health","check_interval_seconds":300}' \
"https://cheapmonit.com/api/v1/monitors"{
"id": "019a0000-0000-7000-8000-000000000001"
}Monitor request fields
These fields are accepted when creating a monitor or changing it with PATCH. On PATCH, omit a setting to preserve it. A monitor’s kind is fixed at creation. HTTP request and certificate settings do not apply to TCP, UDP, DNS, ping, browser, or heartbeat monitors. Creating a heartbeat monitor answers its ping_url and ping_token once, next to its id.
| Field | Type | Behavior |
|---|---|---|
| name | string | Required on creation; up to 160 UTF-8 bytes |
| url | string | Required on creation; HTTP(S) address, host:port for TCP/UDP, or a host name for DNS and ping (ping also takes an IP address); empty for heartbeat |
| kind | string | http (default), tcp, udp, dns, ping, browser, or heartbeat; fixed after creation; Premium required for all but http |
| enabled | boolean | true by default; false pauses checks and keeps open incidents |
| check_interval_seconds | integer | 3600 (default) or 300; Premium required for 300 |
| verify_ssl | boolean | true by default for HTTPS; TLS verification |
| ssl_expiration_days | integer or null | 1, 2, 3, 7, 14, 30, or 60; null removes the HTTPS expiry alert |
| http_method | string | GET (default), HEAD, POST, PUT, or PATCH |
| request_headers | array | Up to 10 {name,value} objects; values are write-only; [] clears headers |
| expected_status | string | Codes or ranges such as 200-299,401; empty accepts any 2xx |
| keyword | string | Case-sensitive response keyword, up to 200 characters, with any method but HEAD; empty removes it |
| request_body | string | POST, PUT, and PATCH only; up to 8192 bytes, sent as JSON when it parses as JSON; switching to another method drops it |
| json_path | string | A value the JSON response must contain, such as data.status or checks[0].ok; not with HEAD; empty removes the check |
| json_expected | string | The value json_path must hold: text as written, or JSON such as true or 42; empty only requires the value to exist |
| dns_record_type | string | DNS only: A (default), AAAA, CNAME, MX, NS, or TXT |
| dns_expected | string | DNS only: an answer one record must equal (TXT: contain); empty accepts any answer |
| script | string | Browser only, required: a Playwright test file of up to 64 KB, run against url as its base address; workspace variables are process.env.NAME |
| browser_timeout_seconds | integer | Browser only: 5 to 120 seconds a scenario may take; default 60 |
| heartbeat_period_seconds | integer | Heartbeat only: how often the job pings, 60 to 2592000 in whole minutes; default 86400 |
| heartbeat_grace_seconds | integer | Heartbeat only: how late a ping may be, 60 to 604800 in whole minutes; default 3600 |
| slow_threshold_ms | integer | 100–10000 milliseconds; 0 disables slow-response alerts |
| group_id | UUID or null | A group in this workspace; null removes the assignment |
| muted_channel_ids | UUID array | Channels to mute for this monitor; [] restores alerts to all active channels |
| publish | boolean | On creation only: add a component to a status page |
| status_page_id | UUID | Used with publish; defaults to this workspace’s first page |
| port_payload | string | UDP only; hexadecimal payload of up to 512 bytes |
| domain_expiration_days | integer | 1, 2, 3, 7, 14, 30, or 60; 0 disables domain expiry and registrar monitoring |
| pagespeed_enabled | boolean | HTTP only; daily page-speed measurement; the server needs its PageSpeed key configured |
Premium features keep the same plan checks as the dashboard. Foreign workspace IDs never grant access. Header names are returned in reads, but saved header values are never returned.
Update, pause, or remove a monitor
PATCH applies only the fields in its body. Pausing with enabled false preserves the address, request headers, TLS settings, and other monitor options. Resume with enabled true. Paused monitors still count toward the account limit.
To update a saved request header without changing its credential, send its name without value. Send the complete desired header list when changing request_headers: omitted headers are removed. Deletion permanently removes the monitor’s check and incident history.
curl --fail-with-body --silent --show-error \
--request PATCH \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"enabled":false}' \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID"curl --fail-with-body --silent --show-error \
--request PATCH \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"name":"Production API","enabled":true}' \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID"curl --fail-with-body --silent --show-error \
--request DELETE \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID"Checks, incidents, and observed uptime
Check and incident history return the latest 200 records. These routes do not offer pagination. Uptime accepts 7, 30, or 90 days and is weighted by observed time; pending and paused periods are excluded. Missing data stays missing rather than becoming 100% uptime.
Read the incident id from GET /incidents to acknowledge an open outage. Acknowledgement is recorded as API key <name>; the first acknowledgement stands and stops further escalation. It does not resolve the outage or change monitoring results.
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID/checks"curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/monitors/$MONITOR_ID/uptime?days=30"curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/incidents"INCIDENT_ID='replace-with-an-incident-uuid'
curl --fail-with-body --silent --show-error \
--request POST \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/incidents/$INCIDENT_ID/acknowledge"Reports and CSV exports
Reports cover 7, 30, or 90 days, or a UTC calendar month. Use month=YYYY-MM for the current UTC month or one of the previous 12; omit days when choosing month. A report contains workspace totals and per-monitor availability, downtime, error budgets, MTTA, and MTTR.
Add format=csv to download the monitor rows from the same report query. CSV responses use text/csv rather than JSON. Error budgets count observed time only; burn rate is reported without creating alerts.
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/reports?days=7"curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
"https://cheapmonit.com/api/v1/reports?days=30&format=csv" --output cheapmonit-report.csvErrors, limits, and retries
REST errors return a JSON object with an error message. Handle the HTTP status before decoding a successful result. Each key shares a budget of 120 HTTP requests per minute across REST and MCP, in addition to the shared limit of 300 API requests per minute per client address.
For 429 responses, respect Retry-After and wait before retrying. Avoid automatically retrying monitor creation: a lost response does not prove that creation failed, and POST has no idempotency-key support. List the monitors and reconcile the result before trying again.
| Status | Meaning | Next step |
|---|---|---|
| 200 | Request succeeded | Decode the documented JSON response, or CSV when requested |
| 400 | Invalid body, setting, ID, query, or plan limit | Read error and correct the request |
| 401 | Missing, unknown, expired, or revoked key | Check the Bearer header or create a replacement key |
| 403 | A read key attempted a write, or the owner lacks Premium | Use the right scope and verify the owner’s plan |
| 404 | Resource not found or outside this workspace | Check the ID and which workspace owns the key |
| 429 | Key or client-address limit reached | Wait for Retry-After before retrying |
| 500 / 503 | Server failure or unavailable configuration | Retry reads with backoff; check server configuration for unavailable features |
{
"error": "Send a valid API key as Authorization: Bearer <key>"
}Rotate keys and keep credentials private
Create a replacement key, update the client’s secret, verify a read request, then remove the old key in Workspace settings. Removal takes effect on the next request. Expired keys still occupy one of the workspace’s 10 slots until removed.
Keys stop working while the owner is off Premium and remain removable after a downgrade. They never grant access to another workspace or to the account routes. The audit log records mutations under the key’s name, never its token. Keep API keys and monitor header values out of source control, chat, URLs, and logs.
Connect an agent through MCP
Use https://cheapmonit.com/api/v1/mcp for MCP clients and the same workspace key. The MCP guide includes Claude Code and Cursor configurations, the current ChatGPT compatibility limitation, resources, tools, and troubleshooting.