Skip to content

Schedules

How to schedule recurring HTTP requests

Run a report or maintenance task on a local-time schedule and make each HTTP invocation safe to retry.

By SendMQ 1 min read

When should you use an HTTP schedule?

Use an HTTP schedule when the time controls when your endpoint runs. Pick a cron expression for a wall-clock time, a rate expression for a fixed interval, or a one-time schedule for a single future run.

For a daily report at 09:00 in Jakarta, pair cron(0 9 * * ? *) with the Asia/Jakarta time zone. SendMQ accepts IANA time zone names and an EventBridge-style cron expression with six fields.

How do you create a daily report schedule?

Send this JSON to POST /v1/schedules with a workspace API key that has schedules:write. Point the request at a public HTTPS handler you control. Before relying on the schedule, check its sync status and verify that the first invocation reaches your endpoint.

Daily schedule request body
{
  "schedule_type": "cron",
  "expression": "cron(0 9 * * ? *)",
  "timezone": "Asia/Jakarta",
  "url": "https://api.example.com/tasks/daily-report",
  "method": "POST"
}

How should the report handler handle retries?

Deduplicate attempts of the same delivery with X-SendMQ-Delivery-Id. You can also enforce a unique report key for each report period so a manual rerun or a second schedule cannot send another copy. Derive the report period consistently if retries can cross midnight.

Read the Schedules API reference