“I need to call an endpoint 24 hours from now and a setTimeout won't survive a deploy”
Delay a job by N hours (a reliable setTimeout)
Set scheduled_at to a future timestamp and Fliq fires the HTTP call then — minutes or weeks out. It's setTimeout that survives restarts, with retries and a record of every fire.
A user starts a trial and you want to nudge them in 24 hours. Or a payment fails and you want to retry the charge in 6 hours. An in-memory setTimeout evaporates on the next deploy or crash. A Fliq job with a future scheduled_at is durable: the fire time is in Postgres, so it survives anything your process does.
The request
Compute a future ISO 8601 timestamp and pass it as scheduled_at.
curl -X POST https://api.fliq.sh/jobs \
-H "Authorization: Bearer fliq_sk_your_token" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/api/trials/nudge",
"http_method": "POST",
"scheduled_at": "2026-06-13T10:00:00Z",
"headers": { "Content-Type": "application/json" },
"body": "{\"user_id\":\"usr_42\"}",
"max_retries": 3
}' // 24 hours from now
const scheduledAt = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString();
const res = await fetch("https://api.fliq.sh/jobs", {
method: "POST",
headers: {
"Authorization": "Bearer fliq_sk_your_token",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://yourapp.com/api/trials/nudge",
http_method: "POST",
scheduled_at: scheduledAt,
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user_id: "usr_42" }),
max_retries: 3,
}),
});
const job = await res.json();
console.log(job.id); // save it if you might cancel Changed your mind before it fires? DELETE /jobs/{job_id} cancels it (a 409 means it already ran).
What Fliq handles for you
- Durable delay. The fire time lives in Postgres, not in your process memory — deploys, restarts, and crashes don’t drop it.
- Any horizon. Minutes to weeks out; it’s the same
scheduled_atfield. No queue visibility-timeout ceilings. - Retries at fire time. When the job fires, a failing endpoint gets retried with backoff — the delay and the reliability come together.
- Cancellable. Cancel before it fires; once it has executed, the attempt is preserved in history.
Related
- Jobs & Schedules — the job object and
scheduled_at - Getting started — your first job end to end
Reference: /docs/jobs-and-schedules