Cron-Job.org Documentation
Comprehensive assistance with the Cron-Job.org REST API for programmatically managing scheduled HTTP jobs. This skill provides guidance on creating, updating, deleting, and monitoring cron jobs through the official API.
This skill should be triggered when:
Authorization headerA Job represents a scheduled HTTP request with:
Each job execution creates a HistoryItem containing:
Different endpoints have different rate limits:
# Set your API key as a bearer token in the Authorization header
Authorization: Bearer YOUR_API_KEY_HERE
Notes:
curl -X GET https://api.cron-job.org/jobs \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"jobs": [
{
"jobId": 12345,
"enabled": true,
"title": "Daily Backup",
"url": "https://example.com/backup",
"lastStatus": 200,
"lastExecution": 1699920000,
"nextExecution": 1700006400
}
],
"jobsPartialError": false
}
Rate Limit: 5 requests/second
import requests
API_KEY = "your_api_key_here"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
job_data = {
"job": {
"url": "https://example.com/api/health-check",
"enabled": True,
"title": "Health Check",
"saveResponses": True,
"schedule": {
"timezone": "America/New_York",
"hours": [-1], # Every hour
"mdays": [-1], # Every day of month
"minutes": [0], # At minute 0
"months": [-1], # Every month
"wdays": [-1] # Every day of week
}
}
}
response = requests.post(
"https://api.cron-job.org/jobs",
headers=headers,
json=job_data
)
print(f"Created job ID: {response.json()['jobId']}")
Rate Limit: 1 request/second, 5 requests/minute
import requests
API_KEY = "your_api_key_here"
JOB_ID = 12345
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Only include fields you want to change
update_data = {
"job": {
"enabled": False, # Disable the job
"title": "Updated Title"
}
}
response = requests.patch(
f"https://api.cron-job.org/jobs/{JOB_ID}",
headers=headers,
json=update_data
)
print("Job updated successfully" if response.status_code == 200 else "Update failed")
Rate Limit: 5 requests/second
{
"job": {
"url": "https://api.example.com/protected",
"enabled": true,
"title": "Protected Endpoint",
"auth": {
"enable": true,
"user": "api_user",
"password": "secret_password"
}
}
}
Notes:
{
"job": {
"url": "https://api.example.com/webhook",
"enabled": true,
"title": "Webhook with Headers",
"extendedData": {
"headers": {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
"User-Agent": "MyCronJob/1.0"
},
"body": "{\"event\": \"scheduled_check\"}"
},
"requestMethod": 1 // 0=GET, 1=POST, 2=PUT, 3=PATCH, 4=DELETE, etc.
}
}
{
"job": {
"url": "https://example.com/critical-task",
"enabled": true,
"title": "Critical Task",
"notifications": {
"onFailure": true,
"onSuccess": false,
"onDisable": true
}
}
}
Notification Options:
onFailure: Notify after job fails (set onFailureMinutes for threshold)onSuccess: Notify when job succeeds after previous failureonDisable: Notify when job is automatically disabledimport requests
API_KEY = "your_api_key_here"
JOB_ID = 12345
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get(
f"https://api.cron-job.org/jobs/{JOB_ID}/history",
headers=headers
)
data = response.json()
print(f"Last {len(data['history'])} executions:")
for item in data['history']:
print(f" {item['date']}: Status {item['httpStatus']} ({item['duration']}ms)")
print(f"\nNext executions: {data['predictions']}")
Rate Limit: 5 requests/second
Every day at 2:30 AM EST:
{
"schedule": {
"timezone": "America/New_York",
"hours": [2],
"mdays": [-1],
"minutes": [30],
"months": [-1],
"wdays": [-1]
}
}
Every Monday and Friday at 9 AM UTC:
{
"schedule": {
"timezone": "UTC",
"hours": [9],
"mdays": [-1],
"minutes": [0],
"months": [-1],
"wdays": [1, 5] // 0=Sunday, 1=Monday, ..., 6=Saturday
}
}
Every 15 minutes:
{
"schedule": {
"timezone": "UTC",
"hours": [-1],
"mdays": [-1],
"minutes": [0, 15, 30, 45],
"months": [-1],
"wdays": [-1]
}
}
import requests
API_KEY = "your_api_key_here"
JOB_ID = 12345
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.delete(
f"https://api.cron-job.org/jobs/{JOB_ID}",
headers=headers
)
print("Job deleted" if response.status_code == 200 else "Delete failed")
Rate Limit: 5 requests/second
This skill includes comprehensive documentation in references/:
Use the reference file for:
references/api.mdFocus on:
Explore:
references/api.md for complete endpoint documentationCreate a job that pings your service every 5 minutes and notifies on failure:
job = {
"url": "https://myapp.com/health",
"enabled": True,
"title": "App Health Check",
"saveResponses": False,
"schedule": {
"timezone": "UTC",
"hours": [-1],
"mdays": [-1],
"minutes": [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55],
"months": [-1],
"wdays": [-1]
},
"notifications": {
"onFailure": True,
"onSuccess": True,
"onDisable": True
}
}
Trigger a webhook at 3 AM daily with custom headers:
job = {
"url": "https://api.myapp.com/sync",
"enabled": True,
"title": "Daily Data Sync",
"requestMethod": 1, # POST
"extendedData": {
"headers": {
"X-Sync-Token": "secret",
"Content-Type": "application/json"
},
"body": '{"action": "daily_sync"}'
},
"schedule": {
"timezone": "America/Los_Angeles",
"hours": [3],
"mdays": [-1],
"minutes": [0],
"months": [-1],
"wdays": [-1]
}
}
Run a job every weekday at 9 AM and 5 PM:
job = {
"url": "https://example.com/business-task",
"enabled": True,
"title": "Business Hours Task",
"schedule": {
"timezone": "America/New_York",
"hours": [9, 17],
"mdays": [-1],
"minutes": [0],
"months": [-1],
"wdays": [1, 2, 3, 4, 5] # Monday-Friday
}
}
| Code | Description |
|---|---|
| 200 | OK - Request succeeded |
| 400 | Bad Request - Invalid request or input data |
| 401 | Unauthorized - Invalid API key |
| 403 | Forbidden - API key cannot be used from this origin |
| 404 | Not Found - Resource doesn't exist |
| 409 | Conflict - Resource already exists |
| 429 | Too Many Requests - Quota or rate limit exceeded |
| 500 | Internal Server Error |
saveResponses to store headers/body in historySee the official documentation for a complete list of supported timezone values (e.g., "UTC", "America/New_York", "Europe/London").
Authorization: Bearer YOUR_KEYnextExecution timestampsaveResponses is set to true[-1] means "all values" (every hour, every day, etc.)HistoryItem.jitterThis skill was generated from official Cron-Job.org documentation. For the latest API changes: