Skip to main content
POST
/
api
/
v1
/
workspaces
/
{workspace_id}
/
schedules
Create Schedule
curl --request POST \
  --url https://api.example.com/api/v1/workspaces/{workspace_id}/schedules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Unnamed",
  "host": "ASKUI",
  "runner_ids": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ],
  "started_at": "2023-11-07T05:31:56Z",
  "ended_at": "2023-11-07T05:31:56Z",
  "ended_after": 123,
  "schedule": "<string>",
  "workflows": [
    "<string>"
  ],
  "data": {}
}
'
{
  "name": "<string>",
  "started_at": "2023-11-07T05:31:56Z",
  "run_template": {
    "workspace_id": "<string>",
    "runner_assignment": {
      "host": "SELF",
      "ids": [
        "<string>"
      ],
      "tags": [
        "<string>"
      ]
    },
    "workflows": [
      "<string>"
    ],
    "data": {}
  },
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "status": "ACTIVE",
  "ended_at": "2023-11-07T05:31:56Z",
  "schedule": "<string>",
  "ended_after": 123,
  "runs_count": 0
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
string<uuid4>
required

Body

application/json
name
string
default:Unnamed
Required string length: 1 - 63
host
enum<string>
default:ASKUI
Available options:
SELF,
ASKUI
runner_ids
string[]
tags
string[]
started_at
string<date-time>

Timestamp after which the schedule starts. If not specified, the schedule starts immediately.

ended_at
string<date-time> | null
ended_after
integer | null

Number of runs (more specifically, completions) after which the schedule ends, i.e., no more runs will be scheduled. If both ended_at and ended_after are specified, the schedule will end when either condition is met. If neither is specified, the schedule will run indefinitely.

schedule
string | null

Cron expression specifying the schedule. If not specified, the schedule will run once on when started_at is reached which is now by default. end_at and ended_after will be ignored if schedule is not specified.

workflows
string[] | null

List of paths (not starting with '/' but relative to root of workspace) of workflows to be executed. Each string is a syntactically valid s3 object key or prefix. Cannot be empty. Strings starting with '.' will be ignored.

data
Data · object

Arbitrary data to be stored with the schedule which is made available to the runner when executing AskUI workflows.

Response

Successful Response

name
string
required
started_at
string<date-time>
required
run_template
RunTemplate · object
required
id
string
created_at
string<date-time>
status
enum<string>
default:ACTIVE
Available options:
ACTIVE,
SUSPENDED,
ENDED
ended_at
string<date-time> | null
schedule
string | null
ended_after
integer | null
runs_count
integer
default:0