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/api

To 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_TOKEN

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

GET/api/monitors

List 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"
POST/api/monitors

Create 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
  }'
GET/api/monitors/[id]

Get monitor details

Required scope: monitors:read

PUT/api/monitors/[id]

Update a monitor

Required scope: monitors:write

DELETE/api/monitors/[id]

Delete a monitor

Required scope: monitors:write

Cron Jobs

Cron job endpoints allow you to manage scheduled HTTP requests.

GET/api/cron-jobs

List all cron jobs

Required scope: cron-jobs:read

POST/api/cron-jobs

Create 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
  }'
GET/api/cron-jobs/[id]

Get cron job details

Required scope: cron-jobs:read

PUT/api/cron-jobs/[id]

Update a cron job

Required scope: cron-jobs:write

DELETE/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.

GET/api/incidents

List incidents

Required scope: incidents:read

GET/api/incidents/[id]

Get incident details

Required scope: incidents:read

PATCH/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:read

Read access to monitors

monitors:write

Write access to monitors

cron-jobs:read

Read access to cron jobs

cron-jobs:write

Write access to cron jobs

incidents:read

Read access to incidents

incidents:write

Write 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