> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/rotations.md).

# Rotations

## Overview

### Available Operations

* [list\_by\_schedule](#list_by_schedule) - List Schedule Rotations
* [create](#create) - Create Rotation
* [delete](#delete) - Delete Rotation
* [get\_by\_id](#get_by_id) - Get Schedule Rotation by ID
* [update](#update) - Update Rotation
* [get\_participants](#get_participants) - Get Rotation Participants
* [update\_participants](#update_participants) - Update Rotation Participants

## list\_by\_schedule

List Schedule Rotations

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.list_by_schedule(schedule_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                         |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsGetScheduleRotationsResponse**](/python-sdk/docs/models/rotationsgetschedulerotationsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## create

Create Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.create(schedule_id="<id>", name="<value>", start_date="<value>", period="<value>", change_participants_frequency=62013, change_participants_unit="<value>", participant_groups=[])

    # Handle response
    print(res)

```

### Parameters

| Parameter                       | Type                                                                              | Required             | Description                                                         |
| ------------------------------- | --------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`                   | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `name`                          | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `start_date`                    | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `period`                        | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_frequency` | *int*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_unit`      | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `participant_groups`            | List\[[models.V4ParticipantGroup](/python-sdk/docs/models/v4participantgroup.md)] | :heavy\_check\_mark: | N/A                                                                 |
| `color`                         | *Optional\[str]*                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_frequency`       | *Optional\[int]*                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_unit`            | *Optional\[str]*                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `shift_time_slots`              | List\[[models.V4ShiftTimeSlot](/python-sdk/docs/models/v4shifttimeslot.md)]       | :heavy\_minus\_sign: | N/A                                                                 |
| `end_date`                      | *Optional\[str]*                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `ends_after_iterations`         | *Optional\[int]*                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`                       | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)     | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsCreateRotationResponse**](/python-sdk/docs/models/rotationscreaterotationresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## delete

Delete Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.delete(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                         |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**bytes**](https://github.com/solarwinds/squadcast-sdk-python/blob/main/squadcastv1/docs/models/.md/README.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## get\_by\_id

Get Schedule Rotation by ID

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.get_by_id(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                         |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsGetScheduleRotationByIDResponse**](/python-sdk/docs/models/rotationsgetschedulerotationbyidresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## update

Update Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.update(schedule_id="<id>", rotation_id="<id>", name="<value>", start_date="<value>", period="<value>", change_participants_frequency=183098, change_participants_unit="<value>")

    # Handle response
    print(res)

```

### Parameters

| Parameter                       | Type                                                                          | Required             | Description                                                         |
| ------------------------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`                   | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id`                   | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `name`                          | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `start_date`                    | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `period`                        | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_frequency` | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_unit`      | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `color`                         | *Optional\[str]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_frequency`       | *Optional\[int]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_unit`            | *Optional\[str]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `shift_time_slots`              | List\[[models.V4ShiftTimeSlot](/python-sdk/docs/models/v4shifttimeslot.md)]   | :heavy\_minus\_sign: | N/A                                                                 |
| `end_date`                      | *Optional\[str]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `ends_after_iterations`         | *Optional\[int]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`                       | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsUpdateRotationResponse**](/python-sdk/docs/models/rotationsupdaterotationresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## get\_participants

Get Rotation Participants

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.get_participants(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                         |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsGetRotationParticipantsResponse**](/python-sdk/docs/models/rotationsgetrotationparticipantsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## update\_participants

Update Rotation Participants

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.rotations.update_participants(schedule_id="<id>", rotation_id="<id>", participant_groups=[])

    # Handle response
    print(res)

```

### Parameters

| Parameter            | Type                                                                              | Required             | Description                                                         |
| -------------------- | --------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`        | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id`        | *str*                                                                             | :heavy\_check\_mark: | N/A                                                                 |
| `participant_groups` | List\[[models.V4ParticipantGroup](/python-sdk/docs/models/v4participantgroup.md)] | :heavy\_check\_mark: | N/A                                                                 |
| `retries`            | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)     | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RotationsUpdateRotationParticipantsResponse**](/python-sdk/docs/models/rotationsupdaterotationparticipantsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/rotations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
