Scheduling
Job scheduling configuration and fire time preview.
GET /api/job-fire-times
Preview upcoming execution times for a given schedule configuration.
Authentication: Required
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
interval | string | Yes | Cron expression or simple interval |
intervalType | string | No | cron, simple, or once |
timezone | string | No | Timezone (e.g., America/New_York) |
startOn | date | No | Start date |
endOn | date | No | End date |
count | integer | No | Number of fire times to return (default: 10) |
Example:
GET /api/job-fire-times?interval=0 8 * * *&timezone=America/New_York&count=5
Response:
{
"fireTimes": [
"2024-02-10T13:00:00Z",
"2024-02-11T13:00:00Z",
"2024-02-12T13:00:00Z",
"2024-02-13T13:00:00Z",
"2024-02-14T13:00:00Z"
]
}
Schedule Validation
Use this endpoint before creating or updating a job to validate that the schedule configuration produces the expected execution times.
Job Scheduling Fields
When creating or updating a job via POST /api/jobs or PUT /api/jobs/{id}, use these fields:
| Field | Type | Description |
|---|---|---|
interval | string | Cron expression (e.g., "0 8 * * *") or simple interval (e.g., "1 hour", "30 minutes") |
intervalType | string | Type: cron, simple, or once |
timezone | string | Timezone for schedule interpretation (e.g., "America/New_York") |
startOn | date | Job won't run before this date |
endOn | date | Job won't run after this date |
enabled | boolean | Enable/disable job execution |
Cron Expression Format
Standard cron format: minute hour day month weekday
Examples:
| Expression | Description |
|---|---|
0 8 * * * | Daily at 8:00 AM |
0 */4 * * * | Every 4 hours |
0 9 * * 1 | Every Monday at 9:00 AM |
0 0 1 * * | First day of month at midnight |
*/15 * * * * | Every 15 minutes |
Simple Interval Format
Human-readable intervals: <number> <unit>
Examples:
| Interval | Description |
|---|---|
1 hour | Every hour |
30 minutes | Every 30 minutes |
1 day | Daily |
1 week | Weekly |
Schedule Examples
Daily Report at 8 AM Eastern
{
"interval": "0 8 * * *",
"intervalType": "cron",
"timezone": "America/New_York",
"enabled": true
}
Hourly Sync (Simple Interval)
{
"interval": "1 hour",
"intervalType": "simple",
"enabled": true
}
Run Once at Specific Time
{
"interval": null,
"intervalType": "once",
"startOn": "2024-03-01T12:00:00Z",
"enabled": true
}
Weekly on Fridays
{
"interval": "0 17 * * 5",
"intervalType": "cron",
"timezone": "America/Los_Angeles",
"enabled": true
}