Skip to content
Get started

Create a worker schedule

POST/api/workers/{workerId}/schedules

Schedule a worker instruction for a future or recurring run.

Path ParametersExpand Collapse
workerId: string
Body ParametersJSONExpand Collapse
input: string
minLength1
when: object { date, type } or object { delayInSeconds, type } or object { cron, type } or object { intervalSeconds, type }
One of the following:
object { date, type }
date: string
formatdate-time
type: "scheduled"
object { delayInSeconds, type }
delayInSeconds: number
minimum1
maximum31536000
type: "delayed"
object { cron, type }
cron: string
minLength1
type: "cron"
object { intervalSeconds, type }
intervalSeconds: number
minimum1
maximum31536000
type: "interval"
budget: optional "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
ReturnsExpand Collapse
WorkerSchedule = object { id, budget, input, 2 more } or object { id, budget, delayInSeconds, 3 more } or object { id, budget, cron, 3 more } or object { id, budget, input, 3 more }
One of the following:
object { id, budget, input, 2 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
nextRunAt: string
formatdate-time
type: "scheduled"
object { id, budget, delayInSeconds, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
delayInSeconds: number
input: string
nextRunAt: string
formatdate-time
type: "delayed"
object { id, budget, cron, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
cron: string
input: string
nextRunAt: string
formatdate-time
type: "cron"
object { id, budget, input, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
intervalSeconds: number
nextRunAt: string
formatdate-time
type: "interval"

Create a worker schedule

curl https://v3.handinger.com/api/workers/$WORKER_ID/schedules \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $HANDINGER_API_KEY" \
    -d '{
          "input": "x",
          "when": {
            "date": "2019-12-27T18:11:19.117Z",
            "type": "scheduled"
          }
        }'
{
  "id": "id",
  "budget": "low",
  "input": "input",
  "nextRunAt": "2019-12-27T18:11:19.117Z",
  "type": "scheduled"
}
Returns Examples
{
  "id": "id",
  "budget": "low",
  "input": "input",
  "nextRunAt": "2019-12-27T18:11:19.117Z",
  "type": "scheduled"
}