Cron
Standard · 1 creditParse and validate cron expressions, get human-readable explanations, compute upcoming run times, or generate expressions from natural descriptions.
POST /api/cron
Section titled “POST /api/cron”Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | parse, explain, next_runs, or generate |
expression | string | No | Cron expression — required for parse, explain, next_runs |
count | integer | No | Number of next runs to compute (default 5, max 25) |
timezone | string | No | IANA timezone for next_runs (e.g. America/Chicago) |
every | string | No | Interval for generate: minute, hour, day, week, month |
at | string | No | Time in HH:MM format (for generate with day/week/month) |
weekday | string | No | Day of week (for generate with week) |
day_of_month | integer | No | Day 1–31 (for generate with month) |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
valid | boolean | Whether the expression is valid |
expression | string | The cron expression (returned by generate) |
explanation | string | Human-readable description |
fields | object | Parsed cron fields |
fields.minute | string | Minute field |
fields.hour | string | Hour field |
fields.day_of_month | string | Day of month field |
fields.month | string | Month field |
fields.day_of_week | string | Day of week field |
next_runs | array | Upcoming run times as RFC 3339 strings |
Examples
Section titled “Examples”Explain a cron expression
Section titled “Explain a cron expression”curl -X POST https://morso.dev/api/cron \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"action": "explain", "expression": "0 9 * * 1-5"}'{ "valid": true, "explanation": "At 09:00 on every day-of-week from Monday through Friday", "fields": { "minute": "0", "hour": "9", "day_of_month": "*", "month": "*", "day_of_week": "1-5" }}Get next runs
Section titled “Get next runs”curl -X POST https://morso.dev/api/cron \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"action": "next_runs", "expression": "*/15 * * * *", "count": 3, "timezone": "Europe/London"}'{ "valid": true, "next_runs": [ "2026-05-06T15:00:00+01:00", "2026-05-06T15:15:00+01:00", "2026-05-06T15:30:00+01:00" ]}Generate an expression
Section titled “Generate an expression”curl -X POST https://morso.dev/api/cron \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"action": "generate", "every": "week", "weekday": "monday", "at": "09:00"}'{ "valid": true, "expression": "0 9 * * 1", "explanation": "At 09:00 on Monday"}Errors
Section titled “Errors”- 400 — Invalid cron expression, unknown timezone, or unsupported interval.
See Errors for the standard error shape.