POST
/
schedules
curl --request POST \
--url https://cronho.st/api/v1/schedules \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"name": "Daily Health Check",
"description": "Check API health every day at 9 AM",
"cronExpression": "0 9 * * *",
"timezone": "America/New_York",
"endpoint": "https://api.example.com/health",
"httpMethod": "GET",
"headers": "{\"User-Agent\": \"Cronhost-Monitor\"}",
"maxRetries": 3,
"timeoutSeconds": 30
}'
{
"data": {
"id": "schedule_123",
"name": "Daily Health Check",
"description": "Check API health every day at 9 AM",
"cronExpression": "0 9 * * *",
"timezone": "America/New_York",
"endpoint": "https://api.example.com/health",
"httpMethod": "GET",
"body": "{\"key\": \"value\"}",
"headers": "{\"User-Agent\": \"Cronhost-Monitor\", \"Content-Type\": \"application/json\"}",
"isEnabled": true,
"nextRunAtUtc": "2024-01-15T14:00:00.000Z",
"lastRunAtUtc": "2024-01-14T14:00:00.000Z",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-14T14:00:00.000Z",
"maxRetries": 3,
"timeoutSeconds": 30
},
"success": true
}

Authorizations

x-api-key
string
header
required

API key for authentication. Get your API key from the Cronhost dashboard.

Body

application/json
name
string
required

Human-readable schedule name

Required string length: 1 - 255
Example:

"Daily Health Check"

cronExpression
string
required

Valid cron expression defining when to run

Example:

"0 9 * * *"

timezone
string
required

IANA timezone identifier

Example:

"America/New_York"

endpoint
string<uri>
required

Target HTTP endpoint URL

Example:

"https://api.example.com/health"

httpMethod
enum<string>
required

HTTP method to use for the request

Available options:
GET,
POST,
PUT,
DELETE,
PATCH
Example:

"GET"

description
string

Optional description of what the schedule does

Maximum length: 1000
Example:

"Check API health every day at 9 AM"

body
string

Request body for POST/PUT/PATCH requests

Example:

"{\"key\": \"value\"}"

headers
string

HTTP headers as JSON string

Example:

"{\"User-Agent\": \"Cronhost-Monitor\", \"Content-Type\": \"application/json\"}"

maxRetries
integer
default:3

Maximum number of retry attempts

Required range: 0 <= x <= 10
Example:

3

timeoutSeconds
integer
default:30

Request timeout in seconds

Required range: 1 <= x <= 300
Example:

30

Response

Schedule created successfully

data
object
required
success
boolean
required
Example:

true