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. For details, see Authentication.

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 ...
  • title string | null nullable
  • notifications object

    Notification settings for this schedule.

    • email boolean
      Example: true
  • actions object[]
      oneOf
    • type required
      Constant value: RUN_ACTOR
    • 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: 300
      • memoryMbytes integer | null nullable
        Example: 1024
      • maxItems integer | null nullable
        Example: 1000
      • maxTotalChargeUsd number | null nullable
        Example: 5
      • restartOnError boolean | null nullable
        Example: false
      • isMaxTotalChargeUsdSetByUser boolean | null nullable

        Whether the user explicitly set maxTotalChargeUsd. Returned only in schedule action runOptions, and only if it was provided.


        Example: true
      • forcePermissionLevel object

        Permission level to run the Actor with, overriding the Actor's own setting. Returned only in schedule action runOptions, and only if it was provided.

          anyOf
        • ActorPermissionLevel (string)

          Determines the permission level that the Actor requires to run. For details, see Actor permissions.

          Possible values: [LIMITED_PERMISSIONS, FULL_PERMISSIONS]


          Example: LIMITED_PERMISSIONS

Status 201

Response Headers
  • Location
{
"data": {
"id": "asdLZtadYvn4mBZmm",
"userId": "wRsJZtadYvn4mBZmm",
"name": "my-schedule",
"cronExpression": "* * * * *",
"timezone": "UTC",
"isEnabled": true,
"isExclusive": true,
"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",
"description": "Schedule of actor ...",
"title": "string",
"notifications": {
"email": true
},
"uiState": {
"version": 1,
"data": {
"cronExpression": "0 8 * * *",
"timezone": "UTC"
}
},
"integrationTracking": {
"platform": "zapier",
"appId": "string",
"isAiTool": false
},
"actions": [
{
"id": "c6KfSgoQzFhMk3etc",
"actorId": "jF8GGEvbEg4Au3NLA",
"runInput": {
"body": "{\\n \"foo\": \"actor\"\\n}",
"contentType": "application/json; charset=utf-8"
},
"runOptions": {
"build": "latest",
"timeoutSecs": 300,
"memoryMbytes": 1024,
"maxItems": 1000,
"maxTotalChargeUsd": 5,
"restartOnError": false,
"isMaxTotalChargeUsdSetByUser": true,
"forcePermissionLevel": "LIMITED_PERMISSIONS"
}
},
{
"id": "c6KfSgoQzFhMk3etc",
"actorTaskId": "jF8GGEvbEg4Au3NLA",
"input": {}
}
]
}
}