REST API
Authenticate with a SutramX API key and call the REST API to manage monitors, incidents and status pages, with rate limits, pagination and errors.
The SutramX REST API lets you manage monitors, incidents, status pages and alert channels from your own scripts, CI pipelines and internal tools. It is the same API the dashboard uses, so anything you create through it shows up in the dashboard straight away.
This page covers how to authenticate and how the API behaves. For every endpoint, see the API reference.
Base URL#
All requests go to:
https://api.sutramx.comPaths are appended to the base URL. Every path on this page and in the API reference also works with a /v1 prefix, so the monitor list is both https://api.sutramx.com/monitors and https://api.sutramx.com/v1/monitors. The two behave the same; answers under /v1 carry the header X-API-Version: v1. Paths without the prefix keep working. You can also copy the base URL from the API documentation tab of Alerts → Channels & API.
Requests and responses use JSON. Send Content-Type: application/json on any request that has a body.
Create an API key#
API keys belong to a workspace. Only the workspace owner can create or delete them, and the owner's email address must be verified first.
To create a key:
- Open Account settings → API keys.
- Click Create API key.
- Enter a Key name (up to 100 characters) that tells you where it is used, for example
ci-deployorterraform-prod. - Under Access, choose an access level: Read-only (the default), Standard or Automation. Pick the lowest level that does the job (see Access levels). You can't change it later.
- Click Create key.
- Copy the key from the banner. It starts with
sk_and is shown only once.
SutramX stores only a hash of the key. If you lose it, delete it and create a new one.
The key list shows each key's name, a Read-only or Automation label (standard keys have no label), its first characters, when it was created and when it was last used.
Delete a key#
Click Delete next to the key and confirm. Anything using the key stops working immediately, and this can't be undone.
If your plan's API key limit goes down (for example after a downgrade), keys over the new limit are disabled and marked Disabled — plan limit. A disabled key is rejected with 401. Delete it, or upgrade to re-enable it.
Authentication#
Send the key as a bearer token in the Authorization header on every request:
Authorization: Bearer sk_your_api_keyFor example:
export SUTRAMX_API_KEY="sk_..."
curl -s "https://api.sutramx.com/monitors" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"The word Bearer is not case-sensitive. A request without a usable key gets 401 with code AUTH_MISSING; a key that doesn't exist or was deleted gets 401 with code API_KEY_INVALID. Both come with a WWW-Authenticate: Bearer header.
A key always acts on the workspace it was created in. You don't need to send a workspace header. If you do send X-Workspace-Id, it must match the key's workspace, or the request is rejected with 403 and code WORKSPACE_ACCESS_DENIED.
Keep keys secret. Store them in your CI secret store or a secrets manager, never in source code or browser JavaScript.
Access levels#
Every key has one of three access levels, chosen when you create it. The dashboard selects Read-only by default.
| Access level | What it can do | What it can't do |
|---|---|---|
| Read-only (dashboard default) | Read everything a workspace viewer can see: monitors, check history, stats, incidents, status pages, alert channels and settings. It can also preview a monitoring-as-code change (POST /automation/monitors/plan), which writes nothing. | Create, change, pause or delete anything. Every other write is refused with 403 and code READ_ONLY_ACCESS. |
| Standard | Everything a workspace member can do: create, edit, pause and delete monitors and monitor groups; acknowledge, resolve and annotate incidents; manage status pages; record deploys; apply monitoring-as-code changes. | Manage alert channels, the OpenTelemetry export, maintenance windows, alert recipients, escalation policies, on-call schedules, team, billing, API keys or account settings. |
| Automation | Everything a standard key can do, plus create, edit, delete and route alert channels (including webhooks), set per-monitor alert recipients through monitoring-as-code, and manage the OpenTelemetry export. | Team, billing, workspace, API keys and account settings. |
Which level to pick:
| Use | Level |
|---|---|
| Dashboards, reporting scripts, AI assistants that only answer questions | Read-only |
| CI jobs and scripts that create or pause monitors, record deploys, or apply monitoring-as-code changes | Standard |
| Automation that also manages alert channels, webhooks or per-monitor alert recipients | Automation |
Some things stay owner-only for every key, because they change where alerts go or silence them:
- Creating, editing or deleting maintenance windows.
- Snoozing an incident (unsnoozing is allowed).
- Setting per-monitor alert recipients through
POST /monitorsorPUT /monitors/:id: aconfig.notification_emailsvalue sent there with an API key is ignored. Automation keys can set it through the monitoring-as-code endpoints; other keys get403. - A monitor group's
notification_emails. Changing it with an API key is rejected with403. - Status page access settings (who can view a private page), custom status page domains, monitor dependencies, webhook signing-secret rotation and one-click "Connect with…" flows.
Endpoints that act on the human account (profile, password, two-factor, sessions, workspaces, subscription and checkout) never accept API keys. They answer 403 with code SESSION_AUTH_REQUIRED. Owner-only endpoints answer an API key with 403 and code API_KEY_NOT_ALLOWED; details.legacy_code is WORKSPACE_OWNER_REQUIRED, the code they sent before. Check for both if your code looks at it.
Rate limits#
Every API key can make up to 1,200 requests per minute. Separately, an IP address that sends more than 100 requests with an invalid API key in 15 minutes is blocked for the rest of that window. On top of that, endpoints that do heavy or outbound work have their own limits, listed below.
When you exceed a limit, the API answers 429 Too Many Requests with a Retry-After header (in seconds), the standard RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers, and a JSON body with code RATE_LIMITED:
{ "error": "Too many requests; wait and retry", "code": "RATE_LIMITED" }A request refused for an invalid key carries the RateLimit-* headers of the invalid-key budget below.
| Endpoints | Limit | Counted per |
|---|---|---|
| Every request made with an API key | 1,200 requests per minute | API key |
| Requests with an invalid API key | 100 per 15 minutes | IP address |
| Monitor create, update, pause, resume, reset stats, bulk actions, region changes, heartbeat URL rotation | 600 requests per 15 minutes with an API key, 120 when signed in to the dashboard | API key or account |
| Monitor delete | 1,500 requests per 15 minutes with an API key, 120 when signed in to the dashboard | API key or account |
Run a check now (/monitors/test, /monitors/:id/run-check and its aliases) | 30 requests per 5 minutes | Account |
Send a test notification (/monitors/:id/test-notification) | 10 requests per 15 minutes | Account |
| Subdomain discovery, domain/SSL refresh, check-history CSV export, incident export | 20 requests per 15 minutes each | Account |
Stats endpoints (/stats/...) | 1,000 requests per minute | IP address |
| Test an alert channel | 30 per hour per account, 60 per hour per IP | Account and IP |
| Accept DNS record changes | 120 requests per 15 minutes | IP address |
Monitoring-as-code apply (/automation/monitors/apply) | 30 requests per 15 minutes | Workspace |
Monitoring-as-code plan (/automation/monitors/plan) | 120 requests per 15 minutes | Workspace |
Keyed monitor writes (/automation/monitors/:key) | 600 requests per 15 minutes | Workspace |
| AI incident drafts (summary, postmortem, status update, translation) | 30 requests per 10 minutes | Workspace |
| Website health "run now" | 20 requests per hour | Account |
Heartbeat pings (/heartbeat/:token) | 60 per minute per heartbeat URL; 600 failed requests per minute per IP | Token and IP |
| Public status page endpoints | 60 requests per minute | IP address |
Plan limits (number of monitors, minimum check interval, status pages and so on) are separate from rate limits. Exceeding a plan limit returns 403 (or 400 for a check interval below your plan's minimum) with category: "PLAN_LIMIT", not 429. See Plan limits.
To stay within the limits:
- Wait for the number of seconds in
Retry-Afterbefore retrying a429. - Use exponential backoff with jitter for repeated failures.
- Use the bulk endpoint (
POST /monitors/bulk) instead of many single updates. - Cache read results such as the monitor list rather than polling them every second.
Pagination#
Most list endpoints return the full list in one response. A few large collections are paginated:
| Endpoint | Style | Parameters | Response |
|---|---|---|---|
GET /incidents | Page number | page (default 1), page_size (default 25, max 100) | items, total, page, page_size, counts |
GET /monitors/:id/checks | Cursor | limit (default 50, 1–500), before (UTC timestamp YYYY-MM-DDTHH:MM:SS[.ffffff][Z]) | items, next_before |
GET /incidents/deploy-events | Limit only | limit (default 20, max 100) | events |
GET /maintenance | Offset | limit (1–1,000; omit it to get every window) and offset (default 0) | An array, newest first, with X-Total-Count and X-Has-More headers |
For cursor pagination, pass the next_before value from one response as before in the next request, unchanged. Check timestamps have microsecond precision (for example 2026-10-01T09:12:30.123456Z), so don't round them. When next_before is null, there are no more results.
# First page of checks
curl -s "https://api.sutramx.com/monitors/$MONITOR_ID/checks?limit=100" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"
# Next page
curl -s "https://api.sutramx.com/monitors/$MONITOR_ID/checks?limit=100&before=2026-10-01T09:12:30.123456Z" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"GET /monitors is not paginated. It returns every monitor in the workspace, newest first. You can filter it with ?tag=<tag>.
Errors#
The API uses standard HTTP status codes. Every error response has the same JSON shape: error is a human-readable string and code is a machine-readable code. details and errors are added where useful. Branch on code, not on the wording of error.
{
"error": "Invalid API key",
"code": "API_KEY_INVALID"
}Request bodies that fail validation return 400 with code: "VALIDATION_ERROR" and a list of the fields that are wrong:
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"errors": [
{ "field": "interval_seconds", "message": "Too small: expected number to be >=15" }
]
}Plan limits#
When your plan doesn't allow something, the answer keeps its specific code (ENTITLEMENT_LIMIT_REACHED, FEATURE_NOT_AVAILABLE and so on) and adds category: "PLAN_LIMIT" and resource, which names what ran out (feature for a feature your plan doesn't include). A limit on a count, such as ENTITLEMENT_LIMIT_REACHED, also has resource, current and limit in details. Retrying doesn't help; upgrade or free up room first.
{
"error": "Feature not available on your plan",
"code": "FEATURE_NOT_AVAILABLE",
"category": "PLAN_LIMIT",
"resource": "feature",
"details": "SLO tracking is not available on the Starter plan. Upgrade to Growth to use it.",
"feature": "sloTracking",
"plan": "starter",
"required_plan": "growth",
"upgradePath": "/subscription"
}Warnings#
A create or update that succeeded but ignored part of the body says so in warnings, a list of strings, for example "warnings": ["Ignored unknown field: colour"]. Check it in scripts to catch a misspelt field name.
Status codes#
| Status | Meaning |
|---|---|
200, 201 | Success. 201 means a resource was created. |
204 | Success with no body (for example, deleting a monitor). |
207 | Partial success from a monitoring-as-code apply. Check each result. |
400 | The request is invalid: bad JSON, a failed validation, or a value the service rejects. |
401 | No key (AUTH_MISSING), an invalid or deleted key (API_KEY_INVALID) or a disabled key (API_KEY_DISABLED). |
403 | The key isn't allowed to do this (for example, a read-only key making a change), or your plan doesn't include it. |
404 | The resource doesn't exist in this workspace. IDs from another workspace also return 404. |
409 | Conflict, for example resolving an incident that is already resolved, a monitoring-as-code apply whose plan changed since you reviewed it, or a request with the same Idempotency-Key that is still running. |
413 | The request body is too large. |
422 | An Idempotency-Key was reused with a different request. |
428 | A monitoring-as-code apply would delete or replace monitors without confirming the reviewed plan. |
429 | Rate limited. Wait for Retry-After seconds. |
500, 503 | An error on our side (500) or the API is briefly unavailable (503). Retry with backoff. |
Error codes#
| Code | Status | What it means |
|---|---|---|
VALIDATION_ERROR | 400 | A field or query parameter value was rejected. errors says which and why. |
BAD_REQUEST | 400 | The body isn't valid JSON. |
PAYLOAD_TOO_LARGE | 413 | The body is over the size limit (100 KB for most endpoints, 2 MB for /automation/monitors/plan and /apply). |
NOT_FOUND | 404 | The resource wasn't found. |
AUTH_MISSING | 401 | No Authorization: Bearer header, or it is empty. |
API_KEY_INVALID | 401 | The key doesn't exist or was deleted. |
TOKEN_INVALID | 401 | A dashboard or OAuth token that isn't valid (not an sk_ key). |
UNAUTHORIZED | 401 | The request isn't authenticated for another reason. |
API_KEY_DISABLED | 401 | The key was disabled because your plan's API key limit went down. Delete it, or upgrade to re-enable it. |
SESSION_AUTH_REQUIRED | 403 | The endpoint only accepts a signed-in dashboard session, not an API key. |
API_KEY_NOT_ALLOWED | 403 | An owner-only endpoint was called with an API key. API keys never have owner rights: the owner does it signed in to the dashboard. details.legacy_code is WORKSPACE_OWNER_REQUIRED. |
WORKSPACE_OWNER_REQUIRED | 403 | Only the workspace owner can do this. Sent to signed-in members, and to API keys on a few owner-only actions inside other endpoints (for example a group's alert recipients). |
READ_ONLY_ACCESS | 403 | The key is read-only and the request would change something. Use a standard or automation key. |
AUTOMATION_KEY_REQUIRED | 403 | The endpoint needs a key with the Automation access level. |
ALERT_ROUTING_NOT_ALLOWED | 403 | A monitoring-as-code spec sets config.notification_emails, which needs an automation key. |
WORKSPACE_ACCESS_DENIED | 403 | X-Workspace-Id doesn't match the key's workspace. |
FEATURE_NOT_AVAILABLE | 403 | Your plan doesn't include this feature. required_plan names the cheapest plan that does. category is PLAN_LIMIT. |
ENTITLEMENT_LIMIT_REACHED | 403 | You've reached a plan limit (for example, the number of monitors). details has resource, current and limit. category is PLAN_LIMIT. |
ENTITLEMENT_INTERVAL_TOO_SHORT | 400 | The check interval is shorter than your plan allows. category is PLAN_LIMIT and resource is minIntervalSeconds. |
EMAIL_VERIFICATION_REQUIRED | 403 | The workspace owner must verify their email address before monitors can be created. |
INCIDENT_RESOLVED | 409 | The incident is already resolved. |
PLAN_CHANGED | 409 | A monitoring-as-code apply sent an expected_fingerprint that no longer matches. Run plan again. |
PRUNE_CONFIRMATION_REQUIRED | 428 | A monitoring-as-code apply would delete or replace monitors, but sent neither expected_fingerprint nor allow_prune_without_fingerprint. |
CONNECTION_LIMIT_REACHED | 409 | You already have 10 connections of this alert channel type. category is PLAN_LIMIT. |
STATUS_PAGE_EMPTY | 400 | A status page with no monitor or service on it can't be published. Signed-in dashboard requests only; API keys can still create a page as public and add its monitors afterwards. |
IDEMPOTENCY_KEY_INVALID | 400 | The Idempotency-Key header isn't 1 to 255 printable ASCII characters. |
IDEMPOTENCY_KEY_REUSED | 422 | The key was already used with a different path or body. Use a new key for a new request. |
IDEMPOTENCY_REQUEST_IN_PROGRESS | 409 | The first request with this key hasn't finished. Wait for Retry-After and send the same request again. |
IDEMPOTENT_RESPONSE_WITHHELD | 409 | The first request with this key succeeded, but its answer contained a secret that is shown only once (a webhook signing secret). The body has the created resource without the secret. |
CHANNEL_UNAVAILABLE | 503 | The alert channel is temporarily unavailable. |
RATE_LIMITED | 429 | Too many requests. Wait for Retry-After seconds. |
CORS_REJECTED | 403 | A browser request came from an origin that isn't allowed. See CORS. |
INTERNAL_ERROR | 500 | An unexpected error. Retry later, and contact support if it continues. |
Retries and idempotency#
A request that times out may still have run. Creates accept an Idempotency-Key header so that a retry can never create the same thing twice.
Idempotency keys#
Send a unique value (a UUID is a good choice) in Idempotency-Key on a POST that creates something, and send the same value again when you retry that request:
curl -s -X POST "https://api.sutramx.com/v1/monitors" \
-H "Authorization: Bearer $SUTRAMX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6a1f0c3e-2b7d-4f4e-9a51-0d3c8e7b2f19" \
-d '{ "name": "Marketing site", "type": "http", "url": "https://www.example.com" }'| What happens | Answer |
|---|---|
| First request with the key | Runs normally. The answer is kept for 24 hours. |
| Same key, same path and body, after the first one finished | The kept answer is sent again with the header Idempotent-Replayed: true. Nothing is created twice. |
| Same key while the first request is still running | 409 with code IDEMPOTENCY_REQUEST_IN_PROGRESS and Retry-After. Wait, then send the same request again. |
| Same key with a different path or body | 422 with code IDEMPOTENCY_KEY_REUSED. |
| The first answer contained a secret shown only once (a webhook signing secret) | 409 with code IDEMPOTENT_RESPONSE_WITHHELD and the created resource without the secret. |
Answers that are errors on our side (5xx), and 401, 403, 408, 409, 425 and 429, are not kept: a retry with the same key runs the request again. A key is scoped to your API key (or dashboard session) and workspace, is 1 to 255 printable ASCII characters, and is checked again against your credentials on every replay, so a revoked key can't read an earlier answer.
These creates accept the header:
| Endpoint | Creates |
|---|---|
POST /monitors, POST /monitors/bulk, POST /monitors/detect/apply | Monitors |
POST /monitor-groups | A monitor group |
POST /status/pages, POST /status/pages/:id/monitors | A status page, or a monitor on it |
POST /integrations/:type/connections, POST /integrations/:type/connect | An alert channel connection |
POST /incidents, POST /incidents/runbooks, POST /incidents/:id/notes | An incident, a runbook or an incident note |
POST /maintenance | A maintenance window (owner session only) |
POST /automation/monitors/apply | A monitoring-as-code apply |
On any other request the header is ignored.
What to retry#
GET,PUTandDELETErequests are safe to retry. Repeating aPUTsets the same values again, and deleting something twice returns404the second time.- Creates in the table above are safe to retry with the same
Idempotency-Key. Without one, a retried create may create a duplicate; a keyed upsert (PUT /automation/monitors/:key) is another way to avoid that. See the API reference. - Other
POSTrequests are actions (acknowledge, resolve, pause, resume, run a check, send a test). Retry them after a429, which means the request did not run. After a timeout or a5xx, check the result before sending it again. Some protect themselves: resolving a resolved incident returns409withINCIDENT_RESOLVED, and opening a manual incident for a monitor that already has one returns409.
Retry 429 after Retry-After and 5xx errors with exponential backoff. Don't retry 400, 401, 403, 404 or 422 without changing the request.
CORS#
The API is meant to be called from servers, scripts and CI jobs, not from web pages on your own domain. Requests without an Origin header (curl, server-side code, CI runners) are always allowed. Browser requests from other websites are rejected with 403 and code CORS_REJECTED.
If you need SutramX data on a web page, call the API from your backend and pass the result to the browser. Never put an API key in front-end code.
Examples#
List monitors that are down#
curl -s "https://api.sutramx.com/monitors" \
-H "Authorization: Bearer $SUTRAMX_API_KEY" \
| jq '.[] | select(.current_status == "down") | {id, name, url}'Create an HTTP monitor#
curl -s -X POST "https://api.sutramx.com/monitors" \
-H "Authorization: Bearer $SUTRAMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing site",
"type": "http",
"url": "https://www.example.com",
"interval_seconds": 60,
"tags": ["web", "prod"],
"config": { "method": "GET", "timeout": 10000, "keyword": "Welcome" }
}'Pause a monitor during a deploy#
curl -s -X POST "https://api.sutramx.com/monitors/$MONITOR_ID/pause" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"
# ... deploy ...
curl -s -X POST "https://api.sutramx.com/monitors/$MONITOR_ID/resume" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"Record a deployment#
curl -s -X POST "https://api.sutramx.com/incidents/deploy-events" \
-H "Authorization: Bearer $SUTRAMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "service_name": "checkout-api", "environment": "production", "version": "v2.14.0" }'Deploy events need a plan that includes deployment correlation. See Deployment correlation.
List open incidents#
curl -s "https://api.sutramx.com/incidents?status=ongoing&page_size=50" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"Check who a key belongs to#
curl -s "https://api.sutramx.com/automation/whoami" \
-H "Authorization: Bearer $SUTRAMX_API_KEY"The response shows the workspace, the key's access level, your plan and its main limits. It's a quick way to test a key in CI.
Common questions#
Why do I get 401 "Invalid API key"?#
The key is wrong or was deleted. (A key disabled because your plan's key limit went down returns 401 with code API_KEY_DISABLED instead.) Check that the header is exactly Authorization: Bearer sk_... with no extra spaces or quotes.
Why do I get 403 with API_KEY_NOT_ALLOWED or WORKSPACE_OWNER_REQUIRED?#
The endpoint is owner-only, and API keys never have owner rights. Do it in the dashboard as the owner instead. For alert channels, create a key with the Automation access level.
Why do I get 403 with READ_ONLY_ACCESS?#
The key was created as Read-only, which is the dashboard default. Access levels can't be changed, so create a new key with the Standard or Automation level for scripts that make changes.
Can a key access more than one workspace?#
No. Create a separate key in each workspace.
Is there a sandbox?#
No. Every request acts on your real workspace, so test against monitors you create for that purpose, and pause or delete them afterwards.
Related
- API reference
- Developer overview
- Webhooks
- Plans & limits
- Team members & roles
- Features: API Monitoring
- Free tools: Unix Timestamp Converter
- Integrations: Webhooks alerts setup
- Use cases: Monitoring for Developers & Indie Hackers
- More from SutramX: Developers & API
Last updated . Something unclear or missing on this page? Tell us at support@sutramx.com.