---
title: "Schedules REST API | Grafana Cloud documentation"
description: "Schedules REST API Note The documentation for this API is also available as an OpenAPI description. Get the load test schedule GET /cloud/v6/load_tests/{id}/schedule"
---

# Schedules REST API

> Note
> 
> The documentation for this API is also available as an [OpenAPI description](https://editor-next.swagger.io/?url=https%3A%2F%2Fapi.k6.io%2Fcloud%2Fv6%2Fopenapi).

## Get the load test schedule

`GET /cloud/v6/load_tests/{id}/schedule`

Get the load test schedule.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the load test.`path``true``integer`

#### `200` response

OK.

##### Content types: `application/json`

`ScheduleApiModel` properties:

| Name              | Description                                                                                                                                                                  | Required | Type                                     |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `created_by`      | The email of the user who created the schedule if applicable.                                                                                                                | `true`   | `string` \| `null`                       |
| `cron`            | The cron schedule to trigger the test periodically. If null, the test runs only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.              | `true`   | `ScheduleCron` \| `null`                 |
| `deactivated`     | Whether the schedule is deactivated. A deactivated schedule will not trigger new test runs, but the schedule recurrence rule and expiration is not affected.                 | `true`   | `boolean`                                |
| `id`              | ID of the schedule.                                                                                                                                                          | `true`   | `integer`                                |
| `load_test_id`    | ID of the test to run.                                                                                                                                                       | `true`   | `integer`                                |
| `next_run`        | The date of the next scheduled test run. The value is `null` if the schedule is expired and no more occurrences are expected in the future according to the recurrence rule. | `true`   | `string` \| `null` , format: `date-time` |
| `recurrence_rule` | The schedule recurrence settings. If null, the test will run only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.                            | `true`   | `ScheduleRecurrenceRule` \| `null`       |
| `starts`          | The date on which the schedule will start running the test.                                                                                                                  | `true`   | `string` , format: `date-time`           |

`ScheduleCron` properties:

| Name        | Description                                                                                                                             | Required | Type     |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `schedule`  | A cron expression with exactly 5 entries, or an alias. The allowed aliases are: @yearly, @annually, @monthly, @weekly, @daily, @hourly. | `true`   | `string` |
| `time_zone` | The timezone of the cron expression.                                                                                                    | `true`   | `string` |

`ScheduleRecurrenceRule` properties:

| Name        | Description                                                                                                                    | Required | Type                                     |
|-------------|--------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `byday`     | The weekdays when the ‘WEEKLY’ recurrence will be applied. Cannot be set for other frequencies.                                | `false`  | `array` \| `null`                        |
| `count`     | Determines how many times the recurrence will repeat.                                                                          | `false`  | `integer` \| `null`                      |
| `frequency` |                                                                                                                                | `true`   | `Frequency`                              |
| `interval`  | The interval between each frequency iteration. An interval of 2 with ‘HOURLY’ frequency makes the test run once every 2 hours. | `false`  | `integer`                                |
| `until`     | A datetime instance specifying the upper-bound time limit of the recurrence.                                                   | `false`  | `string` \| `null` , format: `date-time` |

The unit type of the recurrence interval.

##### 7amOnMonday example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 7 * * 1",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-22T07:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Deactivated example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": true,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "days": [],
    "ends": null,
    "frequency": "HOURLY",
    "interval": 2
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### EveryTwoHours example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "byday": null,
    "count": null,
    "frequency": "HOURLY",
    "interval": 2,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Hourly example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 0 * * *",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T00:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### TriggeredOnceInThePast example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": null,
  "recurrence_rule": null,
  "starts": "2023-08-01T12:00:00.000Z"
}
```

##### WeeklyOnWeekendsStopsAfter10Runs example

```json
{
  "created_by": null,
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T08:46:04.021Z",
  "recurrence_rule": {
    "byday": [
      "SA",
      "SU"
    ],
    "count": 10,
    "frequency": "WEEKLY",
    "interval": 1,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## Set a schedule for the load test

`POST /cloud/v6/load_tests/{id}/schedule`

Set a schedule for the load test.

This operation overwrites any existing test schedule.

Monthly schedules running on days 29-31 are adjusted to run on the last day of the month if the target day doesn’t exist in a given month (for example, March 31 -&gt; April 30).

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the load test.`path``true``integer`

#### Request body

##### Content types: `application/json`

`CreateScheduleRequest` properties:

| Name              | Description                                                                                                                                                     | Required | Type                               |
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------|
| `cron`            | The cron schedule to trigger the test periodically. If null, the test runs only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set. | `false`  | `ScheduleCron` \| `null`           |
| `recurrence_rule` | The schedule recurrence settings. If null, the test will run only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.               | `false`  | `ScheduleRecurrenceRule` \| `null` |
| `starts`          | The timezone-aware date on which the schedule will start running the test.                                                                                      | `true`   | `string` , format: `date-time`     |

`ScheduleCron` properties:

| Name        | Description                                                                                                                             | Required | Type     |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `schedule`  | A cron expression with exactly 5 entries, or an alias. The allowed aliases are: @yearly, @annually, @monthly, @weekly, @daily, @hourly. | `true`   | `string` |
| `time_zone` | The timezone of the cron expression.                                                                                                    | `true`   | `string` |

`ScheduleRecurrenceRule` properties:

| Name        | Description                                                                                                                    | Required | Type                                     |
|-------------|--------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `byday`     | The weekdays when the ‘WEEKLY’ recurrence will be applied. Cannot be set for other frequencies.                                | `false`  | `array` \| `null`                        |
| `count`     | Determines how many times the recurrence will repeat.                                                                          | `false`  | `integer` \| `null`                      |
| `frequency` |                                                                                                                                | `true`   | `Frequency`                              |
| `interval`  | The interval between each frequency iteration. An interval of 2 with ‘HOURLY’ frequency makes the test run once every 2 hours. | `false`  | `integer`                                |
| `until`     | A datetime instance specifying the upper-bound time limit of the recurrence.                                                   | `false`  | `string` \| `null` , format: `date-time` |

The unit type of the recurrence interval.

##### EveryTwoHours example

```json
{
  "recurrence_rule": {
    "frequency": "HOURLY",
    "interval": 2
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### TriggeredOnce example

```json
{
  "recurrence_rule": null,
  "starts": "2028-08-01T12:00:00.000Z"
}
```

##### WeeklyOnWeekendsStopsAfter10Runs example

```json
{
  "recurrence_rule": {
    "byday": [
      "SA",
      "SU"
    ],
    "count": 10,
    "frequency": "WEEKLY"
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

#### `200` response

OK.

##### Content types: `application/json`

`ScheduleApiModel` properties:

| Name              | Description                                                                                                                                                                  | Required | Type                                     |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `created_by`      | The email of the user who created the schedule if applicable.                                                                                                                | `true`   | `string` \| `null`                       |
| `cron`            | The cron schedule to trigger the test periodically. If null, the test runs only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.              | `true`   | `ScheduleCron` \| `null`                 |
| `deactivated`     | Whether the schedule is deactivated. A deactivated schedule will not trigger new test runs, but the schedule recurrence rule and expiration is not affected.                 | `true`   | `boolean`                                |
| `id`              | ID of the schedule.                                                                                                                                                          | `true`   | `integer`                                |
| `load_test_id`    | ID of the test to run.                                                                                                                                                       | `true`   | `integer`                                |
| `next_run`        | The date of the next scheduled test run. The value is `null` if the schedule is expired and no more occurrences are expected in the future according to the recurrence rule. | `true`   | `string` \| `null` , format: `date-time` |
| `recurrence_rule` | The schedule recurrence settings. If null, the test will run only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.                            | `true`   | `ScheduleRecurrenceRule` \| `null`       |
| `starts`          | The date on which the schedule will start running the test.                                                                                                                  | `true`   | `string` , format: `date-time`           |

`ScheduleCron` properties:

| Name        | Description                                                                                                                             | Required | Type     |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `schedule`  | A cron expression with exactly 5 entries, or an alias. The allowed aliases are: @yearly, @annually, @monthly, @weekly, @daily, @hourly. | `true`   | `string` |
| `time_zone` | The timezone of the cron expression.                                                                                                    | `true`   | `string` |

`ScheduleRecurrenceRule` properties:

| Name        | Description                                                                                                                    | Required | Type                                     |
|-------------|--------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `byday`     | The weekdays when the ‘WEEKLY’ recurrence will be applied. Cannot be set for other frequencies.                                | `false`  | `array` \| `null`                        |
| `count`     | Determines how many times the recurrence will repeat.                                                                          | `false`  | `integer` \| `null`                      |
| `frequency` |                                                                                                                                | `true`   | `Frequency`                              |
| `interval`  | The interval between each frequency iteration. An interval of 2 with ‘HOURLY’ frequency makes the test run once every 2 hours. | `false`  | `integer`                                |
| `until`     | A datetime instance specifying the upper-bound time limit of the recurrence.                                                   | `false`  | `string` \| `null` , format: `date-time` |

The unit type of the recurrence interval.

##### 7amOnMonday example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 7 * * 1",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-22T07:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Deactivated example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": true,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "days": [],
    "ends": null,
    "frequency": "HOURLY",
    "interval": 2
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### EveryTwoHours example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "byday": null,
    "count": null,
    "frequency": "HOURLY",
    "interval": 2,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Hourly example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 0 * * *",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T00:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### TriggeredOnceInThePast example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": null,
  "recurrence_rule": null,
  "starts": "2023-08-01T12:00:00.000Z"
}
```

##### WeeklyOnWeekendsStopsAfter10Runs example

```json
{
  "created_by": null,
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T08:46:04.021Z",
  "recurrence_rule": {
    "byday": [
      "SA",
      "SU"
    ],
    "count": 10,
    "frequency": "WEEKLY",
    "interval": 1,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

#### `400` response

Request validation error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## List all schedules

`GET /cloud/v6/schedules`

List all schedules.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`$count`Include collection length in the response object as `@count`.`query``false``boolean`

`$skip`The initial index from which to return the results.`query``false``integer`

`$top`Number of results to return per page.  
Default: `1000`  
Maximum: `1000``query``false``integer`

#### `200` response

OK.

##### Content types: `application/json`

`ScheduleListResponse` properties:

| Name        | Description                                                                                                             | Required | Type                      |
|-------------|-------------------------------------------------------------------------------------------------------------------------|----------|---------------------------|
| `@count`    | Object count in the collection.                                                                                         | `false`  | `integer`                 |
| `@nextLink` | A reference to the next page of results. The property is included until there are no more pages of results to retrieve. | `false`  | `string` , format: `uri`  |
| `value`     | List of the resulting values.                                                                                           | `true`   | `Array[ScheduleApiModel]` |

`ScheduleApiModel` properties:

| Name              | Description                                                                                                                                                                  | Required | Type                                     |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `created_by`      | The email of the user who created the schedule if applicable.                                                                                                                | `true`   | `string` \| `null`                       |
| `cron`            | The cron schedule to trigger the test periodically. If null, the test runs only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.              | `true`   | `ScheduleCron` \| `null`                 |
| `deactivated`     | Whether the schedule is deactivated. A deactivated schedule will not trigger new test runs, but the schedule recurrence rule and expiration is not affected.                 | `true`   | `boolean`                                |
| `id`              | ID of the schedule.                                                                                                                                                          | `true`   | `integer`                                |
| `load_test_id`    | ID of the test to run.                                                                                                                                                       | `true`   | `integer`                                |
| `next_run`        | The date of the next scheduled test run. The value is `null` if the schedule is expired and no more occurrences are expected in the future according to the recurrence rule. | `true`   | `string` \| `null` , format: `date-time` |
| `recurrence_rule` | The schedule recurrence settings. If null, the test will run only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.                            | `true`   | `ScheduleRecurrenceRule` \| `null`       |
| `starts`          | The date on which the schedule will start running the test.                                                                                                                  | `true`   | `string` , format: `date-time`           |

`ScheduleCron` properties:

| Name        | Description                                                                                                                             | Required | Type     |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `schedule`  | A cron expression with exactly 5 entries, or an alias. The allowed aliases are: @yearly, @annually, @monthly, @weekly, @daily, @hourly. | `true`   | `string` |
| `time_zone` | The timezone of the cron expression.                                                                                                    | `true`   | `string` |

`ScheduleRecurrenceRule` properties:

| Name        | Description                                                                                                                    | Required | Type                                     |
|-------------|--------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `byday`     | The weekdays when the ‘WEEKLY’ recurrence will be applied. Cannot be set for other frequencies.                                | `false`  | `array` \| `null`                        |
| `count`     | Determines how many times the recurrence will repeat.                                                                          | `false`  | `integer` \| `null`                      |
| `frequency` |                                                                                                                                | `true`   | `Frequency`                              |
| `interval`  | The interval between each frequency iteration. An interval of 2 with ‘HOURLY’ frequency makes the test run once every 2 hours. | `false`  | `integer`                                |
| `until`     | A datetime instance specifying the upper-bound time limit of the recurrence.                                                   | `false`  | `string` \| `null` , format: `date-time` |

The unit type of the recurrence interval.

##### OK example

```json
{
  "@count": 12,
  "@nextLink": "https://api.k6.io/cloud/v6/schedules?$skip=50\u0026$top=20",
  "value": [
    {
      "created_by": "user@example.com",
      "cron": {
        "schedule": "0 0 * * *",
        "time_zone": "UTC"
      },
      "deactivated": false,
      "id": 123,
      "load_test_id": 234,
      "next_run": "2024-07-17T00:00:00Z",
      "recurrence_rule": null,
      "starts": "2024-07-16T08:46:04.021Z"
    }
  ]
}
```

#### `400` response

Request validation error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## Get a schedule by ID

`GET /cloud/v6/schedules/{id}`

Get a schedule by ID.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the schedule.`path``true``integer`

#### `200` response

OK.

##### Content types: `application/json`

`ScheduleApiModel` properties:

| Name              | Description                                                                                                                                                                  | Required | Type                                     |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `created_by`      | The email of the user who created the schedule if applicable.                                                                                                                | `true`   | `string` \| `null`                       |
| `cron`            | The cron schedule to trigger the test periodically. If null, the test runs only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.              | `true`   | `ScheduleCron` \| `null`                 |
| `deactivated`     | Whether the schedule is deactivated. A deactivated schedule will not trigger new test runs, but the schedule recurrence rule and expiration is not affected.                 | `true`   | `boolean`                                |
| `id`              | ID of the schedule.                                                                                                                                                          | `true`   | `integer`                                |
| `load_test_id`    | ID of the test to run.                                                                                                                                                       | `true`   | `integer`                                |
| `next_run`        | The date of the next scheduled test run. The value is `null` if the schedule is expired and no more occurrences are expected in the future according to the recurrence rule. | `true`   | `string` \| `null` , format: `date-time` |
| `recurrence_rule` | The schedule recurrence settings. If null, the test will run only once on the `starts` date. Only one of `recurrence_rule` and `cron` can be set.                            | `true`   | `ScheduleRecurrenceRule` \| `null`       |
| `starts`          | The date on which the schedule will start running the test.                                                                                                                  | `true`   | `string` , format: `date-time`           |

`ScheduleCron` properties:

| Name        | Description                                                                                                                             | Required | Type     |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `schedule`  | A cron expression with exactly 5 entries, or an alias. The allowed aliases are: @yearly, @annually, @monthly, @weekly, @daily, @hourly. | `true`   | `string` |
| `time_zone` | The timezone of the cron expression.                                                                                                    | `true`   | `string` |

`ScheduleRecurrenceRule` properties:

| Name        | Description                                                                                                                    | Required | Type                                     |
|-------------|--------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------|
| `byday`     | The weekdays when the ‘WEEKLY’ recurrence will be applied. Cannot be set for other frequencies.                                | `false`  | `array` \| `null`                        |
| `count`     | Determines how many times the recurrence will repeat.                                                                          | `false`  | `integer` \| `null`                      |
| `frequency` |                                                                                                                                | `true`   | `Frequency`                              |
| `interval`  | The interval between each frequency iteration. An interval of 2 with ‘HOURLY’ frequency makes the test run once every 2 hours. | `false`  | `integer`                                |
| `until`     | A datetime instance specifying the upper-bound time limit of the recurrence.                                                   | `false`  | `string` \| `null` , format: `date-time` |

The unit type of the recurrence interval.

##### 7amOnMonday example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 7 * * 1",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-22T07:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Deactivated example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": true,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "days": [],
    "ends": null,
    "frequency": "HOURLY",
    "interval": 2
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### EveryTwoHours example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-20T01:46:04.021Z",
  "recurrence_rule": {
    "byday": null,
    "count": null,
    "frequency": "HOURLY",
    "interval": 2,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### Hourly example

```json
{
  "created_by": "user@example.com",
  "cron": {
    "schedule": "0 0 * * *",
    "time_zone": "UTC"
  },
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T00:00:00Z",
  "recurrence_rule": null,
  "starts": "2024-07-16T08:46:04.021Z"
}
```

##### TriggeredOnceInThePast example

```json
{
  "created_by": "user@example.com",
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": null,
  "recurrence_rule": null,
  "starts": "2023-08-01T12:00:00.000Z"
}
```

##### WeeklyOnWeekendsStopsAfter10Runs example

```json
{
  "created_by": null,
  "cron": null,
  "deactivated": false,
  "id": 123,
  "load_test_id": 234,
  "next_run": "2024-07-17T08:46:04.021Z",
  "recurrence_rule": {
    "byday": [
      "SA",
      "SU"
    ],
    "count": 10,
    "frequency": "WEEKLY",
    "interval": 1,
    "until": null
  },
  "starts": "2024-07-16T08:46:04.021Z"
}
```

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## Delete a schedule

`DELETE /cloud/v6/schedules/{id}`

Delete a schedule.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the schedule.`path``true``integer`

#### `204` response

OK.

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## Re-activate deactivated schedule

`POST /cloud/v6/schedules/{id}/activate`

Re-activate a deactivated schedule.

A deactivated schedule can be re-activated only if it still has at least one future recurrence.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the schedule.`path``true``integer`

#### `204` response

OK.

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `409` response

Cannot re-activate an expired schedule.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

## Deactivate a schedule

`POST /cloud/v6/schedules/{id}/deactivate`

Deactivate a schedule.

A deactivated schedule will not trigger new test runs. Disabling a schedule does not affect the schedule recurrence rule and does not delay its expiration.

The operation has no effect if the schedule is expired.

#### Request parameters

NameDescriptionInRequiredType

`X-Stack-Id`

Numeric ID of the Grafana stack representing the request scope.

- If the API is called with a *Personal API token*, the user must be a member of the specified stack.
- If the API is called with a *Grafana Stack API token*, the value must be the ID of the corresponding stack.

`header``true``integer`

`id`ID of the schedule.`path``true``integer`

#### `204` response

OK.

#### `401` response

Invalid token or authentication scheme.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `403` response

The user does not have permission to perform this action.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `404` response

Resource not found.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |

#### `500` response

Unexpected error.

##### Content types: `application/json`

`ErrorResponseApiModel` properties:

| Name    | Description | Required | Type            |
|---------|-------------|----------|-----------------|
| `error` |             | `true`   | `ErrorApiModel` |

Details of the error.

`ErrorApiModel` properties:

| Name      | Description                                                                                  | Required | Type               |
|-----------|----------------------------------------------------------------------------------------------|----------|--------------------|
| `code`    | Service-defined error code.                                                                  | `true`   | `string`           |
| `details` | Array of objects with more specific error information when applicable.                       | `false`  | `array` \| `null`  |
| `message` | Human-readable string describing the error.                                                  | `true`   | `string`           |
| `target`  | A string indicating the target of the error. For example, the name of the property in error. | `false`  | `string` \| `null` |
