# Organization API: Customer Portal: Schedules

> The 11 Organization API operations for schedules.

Source: https://www.coritan.com/docs/api/reference/organizations/customer-portal/servers-schedules/

Part of [Customer Portal](/docs/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules) | List schedules |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules) | Create schedule |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid) | Get schedule |
| PUT | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`](#op-put-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid) | Update schedule |
| DELETE | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`](#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid) | Delete schedule |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/execute`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-execute) | Queue a run now |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/runs`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-runs) | Recent runs of a schedule, newest first, with the outcome of every step |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks) | Add schedule task |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/reorder`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-reor) | Reorder schedule tasks |
| PUT | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/{task_id}`](#op-put-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-task) | Update schedule task |
| DELETE | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/{task_id}`](#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-ta) | Delete schedule task |

### List schedules {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

A `200` response is a list; each item has these fields:

| Field | Type |
| --- | --- |
| `[].id` | integer |
| `[].uuid` | string |
| `[].server_id` | integer |
| `[].name` | string |
| `[].cron_minute` | string |
| `[].cron_hour` | string |
| `[].cron_day_of_month` | string |
| `[].cron_month` | string |
| `[].cron_day_of_week` | string |
| `[].is_active` | boolean |
| `[].only_when_online` | boolean |
| `[].is_processing` | boolean |
| `[].timezone` | string |
| `[].catch_up` | boolean |
| `[].revision` | integer |
| `[].current_run_id` | string or null |
| `[].last_run_status` | string or null |
| `[].next_run_at` | string (date-time) or null |
| `[].last_run_at` | string (date-time) or null |
| `[].last_run_failed` | boolean |
| `[].last_failure_message` | string or null |
| `[].created_at` | string (date-time) |
| `[].updated_at` | string (date-time) or null |
| `[].tasks` | array of TaskResponse |
| `[].tasks[].id` | integer |
| `[].tasks[].sequence_id` | integer |
| `[].tasks[].action` | string |
| `[].tasks[].payload` | Payload |
| `[].tasks[].time_offset` | integer |
| `[].tasks[].continue_on_failure` | boolean |
| `[].tasks[].is_queued` | boolean |

### Create schedule {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `name` | string | yes |
| `cron_minute` | string | yes |
| `cron_hour` | string | yes |
| `cron_day_of_month` | string | yes |
| `cron_month` | string | yes |
| `cron_day_of_week` | string | yes |
| `is_active` | boolean | no |
| `only_when_online` | boolean | no |
| `timezone` | string | no |
| `catch_up` | boolean | no |
| `tasks` | array of TaskCreate or null | no |
| `tasks[].action` | string | yes |
| `tasks[].payload` | object or null | no |
| `tasks[].time_offset` | integer | no |
| `tasks[].sequence_id` | integer or null | no |
| `tasks[].continue_on_failure` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `201` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `uuid` | string |
| `server_id` | integer |
| `name` | string |
| `cron_minute` | string |
| `cron_hour` | string |
| `cron_day_of_month` | string |
| `cron_month` | string |
| `cron_day_of_week` | string |
| `is_active` | boolean |
| `only_when_online` | boolean |
| `is_processing` | boolean |
| `timezone` | string |
| `catch_up` | boolean |
| `revision` | integer |
| `current_run_id` | string or null |
| `last_run_status` | string or null |
| `next_run_at` | string (date-time) or null |
| `last_run_at` | string (date-time) or null |
| `last_run_failed` | boolean |
| `last_failure_message` | string or null |
| `created_at` | string (date-time) |
| `updated_at` | string (date-time) or null |
| `tasks` | array of TaskResponse |
| `tasks[].id` | integer |
| `tasks[].sequence_id` | integer |
| `tasks[].action` | string |
| `tasks[].payload` | Payload |
| `tasks[].time_offset` | integer |
| `tasks[].continue_on_failure` | boolean |
| `tasks[].is_queued` | boolean |

### Get schedule {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `uuid` | string |
| `server_id` | integer |
| `name` | string |
| `cron_minute` | string |
| `cron_hour` | string |
| `cron_day_of_month` | string |
| `cron_month` | string |
| `cron_day_of_week` | string |
| `is_active` | boolean |
| `only_when_online` | boolean |
| `is_processing` | boolean |
| `timezone` | string |
| `catch_up` | boolean |
| `revision` | integer |
| `current_run_id` | string or null |
| `last_run_status` | string or null |
| `next_run_at` | string (date-time) or null |
| `last_run_at` | string (date-time) or null |
| `last_run_failed` | boolean |
| `last_failure_message` | string or null |
| `created_at` | string (date-time) |
| `updated_at` | string (date-time) or null |
| `tasks` | array of TaskResponse |
| `tasks[].id` | integer |
| `tasks[].sequence_id` | integer |
| `tasks[].action` | string |
| `tasks[].payload` | Payload |
| `tasks[].time_offset` | integer |
| `tasks[].continue_on_failure` | boolean |
| `tasks[].is_queued` | boolean |

### Update schedule {#op-put-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid}

`PUT /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `name` | string or null | no |
| `cron_minute` | string or null | no |
| `cron_hour` | string or null | no |
| `cron_day_of_month` | string or null | no |
| `cron_month` | string or null | no |
| `cron_day_of_week` | string or null | no |
| `is_active` | boolean or null | no |
| `only_when_online` | boolean or null | no |
| `timezone` | string or null | no |
| `catch_up` | boolean or null | no |
| `revision` | integer or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `uuid` | string |
| `server_id` | integer |
| `name` | string |
| `cron_minute` | string |
| `cron_hour` | string |
| `cron_day_of_month` | string |
| `cron_month` | string |
| `cron_day_of_week` | string |
| `is_active` | boolean |
| `only_when_online` | boolean |
| `is_processing` | boolean |
| `timezone` | string |
| `catch_up` | boolean |
| `revision` | integer |
| `current_run_id` | string or null |
| `last_run_status` | string or null |
| `next_run_at` | string (date-time) or null |
| `last_run_at` | string (date-time) or null |
| `last_run_failed` | boolean |
| `last_failure_message` | string or null |
| `created_at` | string (date-time) |
| `updated_at` | string (date-time) or null |
| `tasks` | array of TaskResponse |
| `tasks[].id` | integer |
| `tasks[].sequence_id` | integer |
| `tasks[].action` | string |
| `tasks[].payload` | Payload |
| `tasks[].time_offset` | integer |
| `tasks[].continue_on_failure` | boolean |
| `tasks[].is_queued` | boolean |

### Delete schedule {#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid}

`DELETE /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Queue a run now {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-execute}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/execute`

Queue a run now. The next scheduled run is left where it was.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json`

| Field | Type | Required |
| --- | --- | --- |
| `revision` | integer or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Recent runs of a schedule, newest first, with the outcome of every step {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-runs}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/runs`

Recent runs of a schedule, newest first, with the outcome of every step.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |
| `schedule_uuid` | path | string | yes |  |
| `org_slug` | path | string | yes |  |
| `limit` | query | integer | no | Default: `20`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

A `200` response is a list; each item has these fields:

| Field | Type |
| --- | --- |
| `[].uuid` | string |
| `[].trigger` | string |
| `[].status` | string |
| `[].started_at` | string (date-time) or null |
| `[].finished_at` | string (date-time) or null |
| `[].failure_message` | string or null |
| `[].created_at` | string (date-time) or null |
| `[].steps` | array of ScheduleRunStepResponse |
| `[].steps[].task_id` | integer |
| `[].steps[].sequence_id` | integer |
| `[].steps[].action` | string |
| `[].steps[].payload` | Payload |
| `[].steps[].time_offset` | integer |
| `[].steps[].continue_on_failure` | boolean |
| `[].steps[].status` | string |
| `[].steps[].started_at` | string (date-time) or null |
| `[].steps[].finished_at` | string (date-time) or null |
| `[].steps[].error` | string or null |

### Add schedule task {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `action` | string | yes |
| `payload` | object or null | no |
| `time_offset` | integer | no |
| `sequence_id` | integer or null | no |
| `continue_on_failure` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `201` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `sequence_id` | integer |
| `action` | string |
| `payload` | Payload |
| `time_offset` | integer |
| `continue_on_failure` | boolean |
| `is_queued` | boolean |

### Reorder schedule tasks {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-reor}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/reorder`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `task_ids` | array of integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

A `200` response is a list; each item has these fields:

| Field | Type |
| --- | --- |
| `[].id` | integer |
| `[].sequence_id` | integer |
| `[].action` | string |
| `[].payload` | Payload |
| `[].time_offset` | integer |
| `[].continue_on_failure` | boolean |
| `[].is_queued` | boolean |

### Update schedule task {#op-put-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-task}

`PUT /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/{task_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `task_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `action` | string or null | no |
| `payload` | object or null | no |
| `time_offset` | integer or null | no |
| `sequence_id` | integer or null | no |
| `continue_on_failure` | boolean or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `sequence_id` | integer |
| `action` | string |
| `payload` | Payload |
| `time_offset` | integer |
| `continue_on_failure` | boolean |
| `is_queued` | boolean |

### Delete schedule task {#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-schedules-schedule-uuid-tasks-ta}

`DELETE /api/v1/orgs/{org_slug}/portal/servers/{uuid}/schedules/{schedule_uuid}/tasks/{task_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `schedule_uuid` | path | string | yes |
| `task_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
