Skip to content

POST /api/jobs

Push a one-off HTTP job to a named queue. The queue is created automatically if it doesn’t exist.

Endpoint

POST /api/jobs

Authentication

Pass your API token as a Bearer token. Generate one from Settings → API.

Authorization: Bearer YOUR_API_TOKEN

Request body

{
"queue": "emails",
"url": "https://api.yourapp.com/send",
"method": "POST",
"headers": {
"X-Custom-Header": "value"
},
"payload": {
"subject": "Welcome!"
},
"delay": 300
}

Parameters

FieldTypeRequiredDescription
queuestringYesQueue name — created automatically if it doesn’t exist
urlstringYesThe URL to send the HTTP request to
methodstringNoHTTP method: GET, POST, PUT, PATCH, DELETE. Defaults to POST
headersobjectNoKey-value pairs sent as request headers
payloadobjectNoJSON body sent with the request
delayintegerNoSeconds to wait before running the job (0–86400). Defaults to 0

Response

201 Created

{
"success": true,
"queue_id": 12,
"job_id": 847,
"scheduled_at": "2026-02-27T14:10:00+00:00",
"message": "Scheduled successfully"
}
FieldTypeDescription
successbooleanAlways true on success
queue_idintegerID of the queue the job was added to
job_idintegerID of the created job
scheduled_atstringISO 8601 timestamp of when the job will run
messagestringHuman-readable confirmation

Error responses

401 Unauthorized — missing or invalid token

{ "error": "Missing authorization token" }

422 Unprocessable Entity — validation error

{
"message": "The queue field is required.",
"errors": {
"queue": ["The queue field is required."]
}
}

Examples

Basic job

Terminal window
curl -X POST https://app.recurohq.com/api/jobs \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"queue": "emails",
"url": "https://api.yourapp.com/send",
"payload": { "to": "[email protected]" }
}'

Delayed job

Run the job 30 minutes from now:

Terminal window
curl -X POST https://app.recurohq.com/api/jobs \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"queue": "notifications",
"url": "https://api.yourapp.com/notify",
"delay": 1800,
"payload": { "event": "user_signup" }
}'

With custom headers

Terminal window
curl -X POST https://app.recurohq.com/api/jobs \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"queue": "webhooks",
"url": "https://partner.example.com/webhook",
"method": "POST",
"headers": { "X-Webhook-Secret": "abc123" },
"payload": { "event": "order.completed", "order_id": 99 }
}'