Skip to content

Jobs API

A job calls a URL once, now or up to 365 days later. Its queue decides the timeout and retries. These endpoints schedule, list, read and cancel jobs. Authentication, headers and pagination are on the API overview.

Terminal window
curl -X POST https://app.delay.run/api/v1/jobs \
-H "Authorization: Bearer $DELAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://api.yourapp.com/send-welcome", "payload": {"user_id": 42}, "delay": 900}'

This sends POST https://api.yourapp.com/send-welcome with the body {"user_id":42} in 15 minutes, through the queue named default.

EndpointWhat it does
POST /api/v1/jobsSchedule a job
GET /api/v1/jobsList jobs
GET /api/v1/jobs/{id}Get a job with all its attempts
POST /api/v1/jobs/{id}/cancelCancel a job that hasn’t run yet

One job, several attempts

When an attempt fails and its queue has retries left, Delay tries again later. In the dashboard each attempt is its own row with its own ID (why). The API shows them as one job:

  • id is the ID of the first attempt, the one POST /api/v1/jobs returned.
  • status is the status of the latest attempt.
  • attempts lists every attempt, first to last.
  • GET /api/v1/jobs/{id} finds the job by the ID of any of its attempts, and returns it under the first attempt’s ID.

The job object

{
"object": "job",
"id": "01a1f3c2-8d4e-7b1a-a2c3-4d5e6f7a8b9c",
"status": "retrying",
"status_label": "Retrying",
"summary": "Attempt 2 of 4 is scheduled for 2026-11-05T10:16:30+00:00 (1 minute from now) after earlier attempts failed.",
"queue": { "id": "01a1e0b7-3c5d-7e6f-8a9b-0c1d2e3f4a5b", "name": "emails" },
"url": "https://api.yourapp.com/send-welcome",
"method": "POST",
"headers": { "Authorization": "[hidden]" },
"payload": { "user_id": 42 },
"callback_url": null,
"scheduled_for": "2026-11-05T10:15:00+00:00",
"attempt_count": 2,
"max_attempts": 4,
"next_attempt_at": "2026-11-05T10:16:30+00:00",
"in_dead_letter_queue": false,
"explanation": {
"summary": "Your server said it is unavailable (503 Service Unavailable): down, overloaded or in maintenance mode.",
"fix": "Check that the app is up. If this was a deploy or maintenance, the next run should work."
},
"attempts": [
{
"attempt": 1,
"status": "failed",
"scheduled_for": "2026-11-05T10:15:00+00:00",
"started_at": "2026-11-05T10:15:29+00:00",
"duration_ms": 734,
"response_status": 503,
"error": "HTTP 503 error",
"failure_reason": "http_server_error",
"explanation": {
"summary": "Your server said it is unavailable (503 Service Unavailable): down, overloaded or in maintenance mode.",
"fix": "Check that the app is up. If this was a deploy or maintenance, the next run should work."
},
"response_body": "Service Unavailable"
},
{
"attempt": 2,
"status": "retrying",
"scheduled_for": "2026-11-05T10:16:30+00:00",
"started_at": null,
"duration_ms": null,
"response_status": null,
"error": null,
"failure_reason": null,
"explanation": null
}
],
"created_via": "api",
"created_by_token": "Signup service",
"created_at": "2026-11-05T10:00:00+00:00",
"dashboard_url": "https://app.delay.run/jobs/01a1f3c2-8d4e-7b1a-a2c3-4d5e6f7a8b9c"
}
FieldMeaning
status, status_labelscheduled, running, retrying, succeeded or failed (what they mean), and the same word capitalised.
summaryOne sentence on where the job stands, for example “Succeeded on attempt 2.” or “Failed after 4 attempts. It is in the dead letter queue, where it can be replayed from the dashboard.”
queueThe queue’s ID and name.
url, method, headers, payload, callback_urlThe request, with secret header values hidden.
scheduled_forWhen the first attempt was due, in UTC.
attempt_count, max_attemptsAttempts so far, and the most the queue allows: 1 plus its retries, or 1 when retries are off.
next_attempt_atWhen the waiting retry is due. null unless the job is retrying with a retry scheduled.
in_dead_letter_queuetrue when the job ran out of retries and is under Dead letters (replay failed jobs).
explanationFor a failed or retrying job, what went wrong on the latest attempt that ran, and what to do. null otherwise.
attemptsEvery attempt: its status (failed for an attempt that failed and was retried), times, response status, error, failure reason and explanation. response_body (cut at 2,000 characters) is only included when you get one job.
created_via, created_by_tokenWhere the job was made (dashboard, api or mcp, or null for older jobs) and the name of the team token that made it.
dashboard_urlThe job’s page in the dashboard.

Schedule a job

POST /api/v1/jobs returns 201 Created with the new job, plus warnings.

FieldTypeRequiredDefaultLimits and notes
urlstringYesA full https:// or http:// URL, up to 2,048 characters. It must be publicly reachable when the job runs.
queuestringNodefaultA queue name, up to 255 characters. Created with default settings if your team has no queue with that name.
methodstringNoPOSTGET, POST, PUT, PATCH or DELETE, in any letter case.
headersobjectNoNoneHeader names with string values, each up to 1,024 characters.
payloadobject or arrayNoNoneSent as a JSON body, or as query parameters for GET (how the payload is sent). A string or number is rejected.
callback_urlstringNoNoneA full URL. Delay POSTs the result when the job succeeds or is dead-lettered (callbacks).
delayintegerNo0Seconds from now, 0 to 31,536,000 (365 days).
run_atstringNoWhen to send it, as ISO 8601 with an offset, such as 2026-11-05T14:30:00+01:00. From now to 365 days ahead.

Send delay or run_at, not both. With neither, the job runs now. The timeout, retries, concurrency and assertions come from the queue: see them with GET /api/v1/queues and change them in the dashboard.

Terminal window
curl -X POST https://app.delay.run/api/v1/jobs \
-H "Authorization: Bearer $DELAY_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reminder-rem_8812" \
-d '{
"queue": "reminders",
"url": "https://api.yourapp.com/reminders/send",
"payload": {"reminder_id": "rem_8812"},
"run_at": "2026-11-06T09:00:00+01:00",
"callback_url": "https://api.yourapp.com/webhooks/delay?reminder=rem_8812"
}'

The response is the job object, with "status": "scheduled", one attempt, and a summary such as “Scheduled for 2026-11-06T08:00:00+00:00 (22 hours from now).” It ends with warnings, a list of sentences that’s usually empty. It warns when the team is near or over its monthly request limit, and when the queue is paused: “The queue “reminders” is paused, so this job will wait until it is resumed in the dashboard.”

A time more than 365 days ahead is rejected with “run_at can be at most 365 days from now. For repeating requests, create a cron.” For a later date, store it on your side and let a daily cron pick up what’s due. The original POST /api/jobs still stops at 24 hours.

List jobs

GET /api/v1/jobs returns the team’s jobs, newest first, as a list. Each job appears once, however many attempts it has. Lists leave out response_body.

Query parameterValues
statusscheduled, running, retrying, succeeded or failed, matched against the latest attempt
queueA queue name. An unknown name gives an empty list.
page, per_pagePage number, and 1 to 100 per page (default 25)
Terminal window
curl "https://app.delay.run/api/v1/jobs?status=failed&queue=emails" \
-H "Authorization: Bearer $DELAY_TOKEN"

Get a job

GET /api/v1/jobs/{id} returns one job object, with every attempt and its response body. Any attempt’s ID works.

Cancel a job

POST /api/v1/jobs/{id}/cancel removes a job that hasn’t started, so it never runs. It can’t be undone.

Terminal window
curl -X POST https://app.delay.run/api/v1/jobs/01a1f3c2-8d4e-7b1a-a2c3-4d5e6f7a8b9c/cancel \
-H "Authorization: Bearer $DELAY_TOKEN"

The answer is the job as it was, with "status": "cancelled", "status_label": "Cancelled" and the summary “Cancelled. It was removed and will not run.” This is the only place the API uses cancelled: afterwards the job is gone, and getting it returns not_found.

Only a scheduled job can be cancelled. Any other status gets 409 job_not_cancellable. A retrying job can’t be cancelled either: to hold its retries, pause its queue in the dashboard.

Next steps