cURL Examples
All Sentro API endpoints can be called directly from the command line with cURL. These examples use $API_KEY as a placeholder -- set it in your shell first:
export API_KEY="sentro_sk_live_your_key_here"
Monitors
List All Monitors
curl -s https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY" | jq
Get a Single Monitor
curl -s https://api.sentro.dev/v1/monitors/MONITOR_ID \
-H "Authorization: Bearer $API_KEY" | jq
Create a Monitor
curl -s -X POST https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"expectedStatusCode": 200,
"followRedirects": true,
"headers": {
"Accept": "application/json"
}
}' | jq
Update a Monitor
curl -s -X PATCH https://api.sentro.dev/v1/monitors/MONITOR_ID \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API (v2)",
"intervalSeconds": 30
}' | jq
Delete a Monitor
curl -s -X DELETE https://api.sentro.dev/v1/monitors/MONITOR_ID \
-H "Authorization: Bearer $API_KEY" | jq
Checks
List Checks for a Monitor
curl -s "https://api.sentro.dev/v1/monitors/MONITOR_ID/checks?limit=10&offset=0" \
-H "Authorization: Bearer $API_KEY" | jq
Get the Latest Check
curl -s "https://api.sentro.dev/v1/monitors/MONITOR_ID/checks?limit=1" \
-H "Authorization: Bearer $API_KEY" | jq '.data[0]'
Paginate Through Checks
# Page 1
curl -s "https://api.sentro.dev/v1/monitors/MONITOR_ID/checks?limit=50&offset=0" \
-H "Authorization: Bearer $API_KEY" | jq
# Page 2
curl -s "https://api.sentro.dev/v1/monitors/MONITOR_ID/checks?limit=50&offset=50" \
-H "Authorization: Bearer $API_KEY" | jq
Incidents
List All Incidents
curl -s https://api.sentro.dev/v1/incidents \
-H "Authorization: Bearer $API_KEY" | jq
List Incidents for a Specific Monitor
curl -s "https://api.sentro.dev/v1/incidents?monitorId=MONITOR_ID" \
-H "Authorization: Bearer $API_KEY" | jq
List Incidents with Pagination
curl -s "https://api.sentro.dev/v1/incidents?limit=5&offset=0" \
-H "Authorization: Bearer $API_KEY" | jq
Get a Single Incident (with Updates)
curl -s https://api.sentro.dev/v1/incidents/INCIDENT_ID \
-H "Authorization: Bearer $API_KEY" | jq
Alert Channels
List Alert Channels
curl -s https://api.sentro.dev/v1/alert-channels \
-H "Authorization: Bearer $API_KEY" | jq
Create an Email Alert Channel
curl -s -X POST https://api.sentro.dev/v1/alert-channels \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "EMAIL",
"name": "Team Alerts",
"config": {
"recipients": ["oncall@example.com", "team@example.com"]
}
}' | jq
Create a Slack Alert Channel
curl -s -X POST https://api.sentro.dev/v1/alert-channels \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "SLACK",
"name": "Engineering Alerts",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T00/B00/xxx"
}
}' | jq
Create a Webhook Alert Channel
curl -s -X POST https://api.sentro.dev/v1/alert-channels \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "WEBHOOK",
"name": "Custom Integration",
"config": {
"url": "https://example.com/webhooks/sentro",
"secret": "whsec_your_signing_secret"
}
}' | jq
Delete an Alert Channel
curl -s -X DELETE https://api.sentro.dev/v1/alert-channels/CHANNEL_ID \
-H "Authorization: Bearer $API_KEY" | jq
Health Check
The health endpoint does not require authentication:
curl -s https://api.sentro.dev/health | jq
{
"status": "healthy",
"version": "1.0.0",
"uptime": 86400.123,
"timestamp": "2026-05-01T09:30:00.000Z"
}
Tips
Pretty-Print JSON
Pipe output through jq for formatted output:
curl -s ... | jq
Extract Specific Fields
Use jq to pull out just what you need:
# Get just monitor names and URLs
curl -s https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY" \
| jq '.data[] | {name, url}'
# Count active monitors
curl -s https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY" \
| jq '[.data[] | select(.status == "ACTIVE")] | length'
Check Response Headers
Use -i to see response headers including rate limit info:
curl -si https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY"
Save API Key Securely
Rather than exporting your key in the shell, read it from a file:
API_KEY=$(cat ~/.sentro/api_key)
curl -s https://api.sentro.dev/v1/monitors \
-H "Authorization: Bearer $API_KEY" | jq