Skip to content

Examples

The target hostname must resolve at creation time. The snippets below use https://example.com/ because it actually resolves and returns 200 — fine for a smoke test. In real use, point at your own service (e.g. https://api.your-domain.com/healthz).

Create a monitor from any terminal:

Terminal window
curl -X POST https://api.uptimemonitoring.com/api/v1/monitors \
-H "Authorization: Bearer $UPTIMEMONITORING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "api-prod",
"url": "https://example.com",
"type": "http"
}'
const res = await fetch("https://api.uptimemonitoring.com/api/v1/monitors", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.UPTIMEMONITORING_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "api-prod",
url: "https://example.com",
type: "http",
}),
});
const data = await res.json();
console.log(`Monitor ${data.monitor.id} created, status: ${data.state.status}`);
import os
import requests
resp = requests.post(
"https://api.uptimemonitoring.com/api/v1/monitors",
headers={"Authorization": f"Bearer {os.environ['UPTIMEMONITORING_API_KEY']}"},
json={
"name": "api-prod",
"url": "https://example.com",
"type": "http",
},
)
data = resp.json()
print(f"Monitor {data['monitor']['id']} created, status: {data['state']['status']}")
name: Deploy and verify
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./deploy.sh
- name: Verify deploy health
uses: uptimemonitoring/assert-healthy@v1
with:
api-key: ${{ secrets.UPTIMEMONITORING_API_KEY }}
monitor-ids: ${{ vars.MONITOR_ID }}
Add UptimeMonitoring as an MCP server
Create a monitor for https://example.com/
Assert that it is healthy after deploy

MCP configuration:

{
"mcpServers": {
"uptimemonitoring": {
"url": "https://api.uptimemonitoring.com/mcp",
"headers": {
"Authorization": "Bearer umk_live_..."
}
}
}
}

Add to .cursor/mcp.json:

{
"mcpServers": {
"uptimemonitoring": {
"url": "https://api.uptimemonitoring.com/mcp",
"headers": {
"Authorization": "Bearer umk_live_..."
}
}
}
}

Then use natural language:

Create a monitor for https://example.com/
and tell me if it is healthy

Webhooks are monitor-scoped — set or replace with PUT:

Terminal window
# Set the webhook on monitor 1287 to post to Slack
curl -X PUT https://api.uptimemonitoring.com/api/v1/monitors/1287/webhook \
-H "Authorization: Bearer $UPTIMEMONITORING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://hooks.slack.com/services/T.../B.../xxx"}'

The webhook payload is JSON — Slack will render it as a message attachment automatically. The HMAC secret is returned on the initial PUT; store it for signature verification.