Skip to main content

Create schedule

POST 

/v2/schedules

Creates a new schedule with settings provided by the schedule object passed as JSON in the payload. The response is the created schedule object.

The request needs to specify the Content-Type: application/json HTTP header!

When providing your API authentication token, we recommend using the request's Authorization header, rather than the URL. (More info).

Request

Bodyrequired

  • name string | null nullable
    Example: my-schedule
  • isEnabled boolean | null nullable
    Example: true
  • isExclusive boolean | null nullable
    Example: true
  • cronExpression string | null nullable
    Example: * * * * *
  • timezone string | null nullable
    Example: UTC
  • description string | null nullable
    Example: Schedule of actor ...
  • actions object[]
    • type ScheduleActionType (string) required

      Type of action to perform when the schedule triggers.

      Possible values: [RUN_ACTOR, RUN_ACTOR_TASK]

    • actorId string required
      Example: jF8GGEvbEg4Au3NLA
    • runInput object
        anyOf
      • body string | null nullable
        Example: {\n "foo": "actor"\n}
      • contentType string | null nullable
        Example: application/json; charset=utf-8
    • runOptions object
        anyOf
      • build string | null nullable
        Example: latest
      • timeoutSecs integer | null nullable
        Example: 60
      • memoryMbytes integer | null nullable
        Example: 1024
      • restartOnError boolean | null nullable
        Example: false

Status 201

Response Headers
  • Location
{
"data": {
"id": "asdLZtadYvn4mBZmm",
"userId": "wRsJZtadYvn4mBZmm",
"name": "my-schedule",
"cronExpression": "* * * * *",
"timezone": "UTC",
"isEnabled": true,
"isExclusive": true,
"description": "Schedule of actor ...",
"createdAt": "2019-12-12T07:34:14.202Z",
"modifiedAt": "2019-12-20T06:33:11.202Z",
"nextRunAt": "2019-04-12T07:34:10.202Z",
"lastRunAt": "2019-04-12T07:33:10.202Z",
"actions": [
{
"id": "c6KfSgoQzFhMk3etc",
"type": "RUN_ACTOR",
"actorId": "jF8GGEvbEg4Au3NLA",
"runInput": {
"body": "{\\n \"foo\": \"actor\"\\n}",
"contentType": "application/json; charset=utf-8"
},
"runOptions": {
"build": "latest",
"timeoutSecs": 60,
"memoryMbytes": 1024,
"restartOnError": false
}
}
]
}
}