Skip to article
Team & accountPremium · early access

API keys and the public API

Authenticate, inspect monitors, and automate changes with complete request examples.

11 min read

This 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.

  1. As the workspace owner or an editor, open Workspace settings → API keys. Choose a workspace before creating the key.
  2. Give the key a recognizable name, choose Read or Read and write, and select an expiry. Start with Read for dashboards and inspection.
  3. 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.

Load a key without adding its value to Bash history
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.

List monitors
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
  "https://cheapmonit.com/api/v1/monitors"
Monitor list response — selected fields
[
  {
    "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
  }
]
Select an existing monitor
MONITOR_ID='replace-with-a-monitor-uuid'
Read one monitor
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.

Public API routes
Method and pathAccessResult
GET /monitorsReadWorkspace monitor array with latest checks and seven-day uptime
GET /monitors/{id}ReadOne monitor object; 404 when unavailable
GET /monitors/{id}/checks?before=ReadLatest 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=30ReadOverall uptime and daily history; days is 7, 30, or 90 (default 7)
GET /incidentsReadLatest 200 workspace incidents, newest first
GET /reports?days=30ReadAvailability, error budgets, MTTA, and MTTR; days is 7, 30, or 90 (default 30)
GET /status-pagesReadWorkspace status pages with sections and components; no password hashes
POST /monitorsWriteCreate a monitor; returns {"id":"…"}
PATCH /monitors/{id}WriteChange supplied settings while keeping omitted settings; returns id
DELETE /monitors/{id}WriteDelete the monitor and its history; returns {"ok":true}
POST /incidents/{id}/acknowledgeWriteAcknowledge 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.

Download the specification
curl --fail-with-body --silent --show-error \
  "https://cheapmonit.com/openapi.json" --output cheapmonit-openapi.json

Create 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.

Create an HTTP monitor — write key required
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"
Creation response
{
  "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.

Monitor fields
FieldTypeBehavior
namestringRequired on creation; up to 160 UTF-8 bytes
urlstringRequired 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
kindstringhttp (default), tcp, udp, dns, ping, browser, or heartbeat; fixed after creation; Premium required for all but http
enabledbooleantrue by default; false pauses checks and keeps open incidents
check_interval_secondsinteger3600 (default) or 300; Premium required for 300
verify_sslbooleantrue by default for HTTPS; TLS verification
ssl_expiration_daysinteger or null1, 2, 3, 7, 14, 30, or 60; null removes the HTTPS expiry alert
http_methodstringGET (default), HEAD, POST, PUT, or PATCH
request_headersarrayUp to 10 {name,value} objects; values are write-only; [] clears headers
expected_statusstringCodes or ranges such as 200-299,401; empty accepts any 2xx
keywordstringCase-sensitive response keyword, up to 200 characters, with any method but HEAD; empty removes it
request_bodystringPOST, PUT, and PATCH only; up to 8192 bytes, sent as JSON when it parses as JSON; switching to another method drops it
json_pathstringA value the JSON response must contain, such as data.status or checks[0].ok; not with HEAD; empty removes the check
json_expectedstringThe value json_path must hold: text as written, or JSON such as true or 42; empty only requires the value to exist
dns_record_typestringDNS only: A (default), AAAA, CNAME, MX, NS, or TXT
dns_expectedstringDNS only: an answer one record must equal (TXT: contain); empty accepts any answer
scriptstringBrowser 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_secondsintegerBrowser only: 5 to 120 seconds a scenario may take; default 60
heartbeat_period_secondsintegerHeartbeat only: how often the job pings, 60 to 2592000 in whole minutes; default 86400
heartbeat_grace_secondsintegerHeartbeat only: how late a ping may be, 60 to 604800 in whole minutes; default 3600
slow_threshold_msinteger100–10000 milliseconds; 0 disables slow-response alerts
group_idUUID or nullA group in this workspace; null removes the assignment
muted_channel_idsUUID arrayChannels to mute for this monitor; [] restores alerts to all active channels
publishbooleanOn creation only: add a component to a status page
status_page_idUUIDUsed with publish; defaults to this workspace’s first page
port_payloadstringUDP only; hexadecimal payload of up to 512 bytes
domain_expiration_daysinteger1, 2, 3, 7, 14, 30, or 60; 0 disables domain expiry and registrar monitoring
pagespeed_enabledbooleanHTTP 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.

Pause a monitor — write key required
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"
Rename and resume a monitor — write key required
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"
Delete a monitor and its history — write key required
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.

Read check history
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
  "https://cheapmonit.com/api/v1/monitors/$MONITOR_ID/checks"
Read 30 days of uptime
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
  "https://cheapmonit.com/api/v1/monitors/$MONITOR_ID/uptime?days=30"
List incidents
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
  "https://cheapmonit.com/api/v1/incidents"
Acknowledge an incident — write key required
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.

Read a seven-day reliability report
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $CHEAPMONIT_API_KEY" \
  "https://cheapmonit.com/api/v1/reports?days=7"
Download a 30-day report as CSV
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.csv

Errors, 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.

REST response handling
StatusMeaningNext step
200Request succeededDecode the documented JSON response, or CSV when requested
400Invalid body, setting, ID, query, or plan limitRead error and correct the request
401Missing, unknown, expired, or revoked keyCheck the Bearer header or create a replacement key
403A read key attempted a write, or the owner lacks PremiumUse the right scope and verify the owner’s plan
404Resource not found or outside this workspaceCheck the ID and which workspace owns the key
429Key or client-address limit reachedWait for Retry-After before retrying
500 / 503Server failure or unavailable configurationRetry reads with backoff; check server configuration for unavailable features
Example authentication error — HTTP 401
{
  "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.