API Documentation
Integrate CronUptime into your applications with our REST API. Manage monitors, cron jobs, and incidents programmatically.
Getting Started
The CronUptime API allows you to programmatically manage monitors, cron jobs, and incidents. All API requests should be made to the base URL:
https://www.cronuptime.com/apiTo use the API, you'll need to create an API token from your dashboard. Include this token in the Authorization header of every request.
Quick Start: Create an API token, then make your first request using any of the code examples below.
Authentication
All API requests require authentication using a Bearer token. Include your API token in theAuthorization header:
Authorization: Bearer YOUR_API_TOKENResponse Format
All responses are in JSON format. Successful requests return the data directly, while errors return an object with an error field.
Example error response:
{
"error": "Insufficient permissions. Required scope: monitors:read"
}Monitors
Monitor endpoints allow you to manage uptime monitors for your websites and APIs.
/api/monitorsList all monitors
Required scope: monitors:read
curl -X GET https://www.cronuptime.com/api/monitors \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"/api/monitorsCreate a new monitor
Required scope: monitors:write
curl -X POST https://www.cronuptime.com/api/monitors \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My API Monitor",
"url": "https://api.example.com/health",
"interval_sec": 300,
"timeout_ms": 5000
}'/api/monitors/[id]Get monitor details
Required scope: monitors:read
/api/monitors/[id]Update a monitor
Required scope: monitors:write
/api/monitors/[id]Delete a monitor
Required scope: monitors:write
Cron Jobs
Cron job endpoints allow you to manage scheduled HTTP requests.
/api/cron-jobsList all cron jobs
Required scope: cron-jobs:read
/api/cron-jobsCreate a new cron job
Required scope: cron-jobs:write
curl -X POST https://www.cronuptime.com/api/cron-jobs \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Backup",
"url": "https://api.example.com/backup",
"method": "POST",
"cron_expr": "0 2 * * *",
"timeout_ms": 30000
}'/api/cron-jobs/[id]Get cron job details
Required scope: cron-jobs:read
/api/cron-jobs/[id]Update a cron job
Required scope: cron-jobs:write
/api/cron-jobs/[id]Delete a cron job
Required scope: cron-jobs:write
Incidents
Incident endpoints allow you to view and manage incidents for your monitors and cron jobs.
/api/incidentsList incidents
Required scope: incidents:read
/api/incidents/[id]Get incident details
Required scope: incidents:read
/api/incidents/[id]Update incident (resolve/reopen)
Required scope: incidents:write
Scopes & Permissions
Scopes control what actions an API token can perform. When creating a token, select only the scopes you need.
Scope Format
Scopes follow the format resource:action. You can also use wildcards for broader permissions.
Available Scopes
monitors:readRead access to monitors
monitors:writeWrite access to monitors
cron-jobs:readRead access to cron jobs
cron-jobs:writeWrite access to cron jobs
incidents:readRead access to incidents
incidents:writeWrite access to incidents
Wildcard Scopes
monitors:*Full access to all monitor operations (read and write)
*Full access to all resources and operations
Security Note: Always follow the principle of least privilege. Only grant the minimum scopes necessary for your use case.
Code Examples
Here are complete examples for different programming languages and tools.
cURL
curl -X GET https://www.cronuptime.com/api/monitors \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"JavaScript (Fetch API)
// Using fetch
const response = await fetch('https://www.cronuptime.com/api/monitors', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const monitors = await response.json();
console.log(monitors);Python
import requests
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(
'https://www.cronuptime.com/api/monitors',
headers=headers
)
monitors = response.json()
print(monitors)Node.js (Axios)
const axios = require('axios');
const response = await axios.get('https://www.cronuptime.com/api/monitors', {
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
console.log(response.data);Ready to get started?
Create your first API token and start integrating CronUptime into your applications.
Create API Token