# EscalationPolicies

## Overview

### Available Operations

* [get\_by\_team](#get_by_team) - Get Escalation Policy By team
* [create](#create) - Create Escalation Policies
* [remove](#remove) - Remove Escalation Policy
* [get\_by\_id](#get_by_id) - Get Escalation Policy By ID
* [update](#update) - Update Escalation Policy

## get\_by\_team

Returns all escalation policy details of the given `ownerID` (teamId) in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.escalation_policies.get_by_team(owner_id="<id>")

    while res is not None:
        # Handle items

        res = res.next()

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                                                                       |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `owner_id`    | *str*                                                                         | :heavy\_check\_mark: | here owner\_id represents team\_id, if team\_id is not provided, it will return escalation policies of all teams. |
| `page_number` | *Optional\[int]*                                                              | :heavy\_minus\_sign: | N/A                                                                                                               |
| `page_size`   | *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.EscalationPoliciesGetEscalationPolicyByTeamResponse**](/python-sdk/docs/models/escalationpoliciesgetescalationpolicybyteamresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## create

Add escalation policy to the organization. Returns the escalation policy object in response. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.escalation_policies.create(owner_id="<id>", name="<value>", description="properly aw gerbil address co-producer guzzle delight difficult", repetition=549305, repeat_after=226311, rules=[
        {
            "escalation_time": 646220,
            "via": [
                "<value 1>",
                "<value 2>",
            ],
            "roundrobin_enabled": True,
            "roundrobin_next_index": 685302,
            "entities": [],
            "escalate_within_roundrobin": True,
            "repetition": 149319,
            "repeat_after": 619552,
        },
    ], enable_incident_reminders=False, incident_reminder_rules=[], enable_incident_retrigger=False, retrigger_after=660610)

    # Handle response
    print(res)

```

### Parameters

| Parameter                   | Type                                                                                                                          | Required             | Description                                                         |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `owner_id`                  | *str*                                                                                                                         | :heavy\_check\_mark: | The ID of the team that owns this escalation policy.                |
| `name`                      | *str*                                                                                                                         | :heavy\_check\_mark: | The name of the escalation policy.                                  |
| `description`               | *str*                                                                                                                         | :heavy\_check\_mark: | A description of the escalation policy.                             |
| `repetition`                | *int*                                                                                                                         | :heavy\_check\_mark: | The number of times the entire policy should be repeated.           |
| `repeat_after`              | *int*                                                                                                                         | :heavy\_check\_mark: | The time in minutes after which the policy should be repeated.      |
| `rules`                     | List\[[models.V3EscalationPoliciesEscalationPolicyRule](/python-sdk/docs/models/v3escalationpoliciesescalationpolicyrule.md)] | :heavy\_check\_mark: | The rules that define the escalation steps.                         |
| `enable_incident_reminders` | *bool*                                                                                                                        | :heavy\_check\_mark: | Enable or disable incident reminders.                               |
| `incident_reminder_rules`   | List\[[models.V3EscalationPoliciesIncidentReminderRule](/python-sdk/docs/models/v3escalationpoliciesincidentreminderrule.md)] | :heavy\_check\_mark: | The rules for incident reminders.                                   |
| `enable_incident_retrigger` | *bool*                                                                                                                        | :heavy\_check\_mark: | Enable or disable automatic incident re-triggering.                 |
| `retrigger_after`           | *int*                                                                                                                         | :heavy\_check\_mark: | The time in hours after which an incident should be re-triggered.   |
| `entity_owner`              | [Optional\[models.CommonV3EntityOwner\]](/python-sdk/docs/models/commonv3entityowner.md)                                      | :heavy\_minus\_sign: | The owner of the entity.                                            |
| `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.EscalationPoliciesCreateEscalationPoliciesResponse**](/python-sdk/docs/models/escalationpoliciescreateescalationpoliciesresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## remove

Remove escalation policy from the organization. Upon success, the escalation policy will be removed from the organization. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.escalation_policies.remove(escalation_policy_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter              | Type                                                                          | Required             | Description                                                         |
| ---------------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `escalation_policy_id` | *str*                                                                         | :heavy\_check\_mark: | (Required) escalation policy ID                                     |
| `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.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## get\_by\_id

Returns an escalation policy details of the given `escalationPolicyID` in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.escalation_policies.get_by_id(escalation_policy_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter              | Type                                                                          | Required             | Description                                                         |
| ---------------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `escalation_policy_id` | *str*                                                                         | :heavy\_check\_mark: | (Required) escalation policy ID                                     |
| `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.EscalationPoliciesGetEscalationPolicyByIDResponse**](/python-sdk/docs/models/escalationpoliciesgetescalationpolicybyidresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## update

Update organization escalation policy details. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.escalation_policies.update(escalation_policy_id="<id>", v3_escalation_policies_update_escalation_policy_request=open("example.file", "rb"))

    # Handle response
    print(res)

```

### Parameters

| Parameter                                                 | Type                                                                          | Required             | Description                                                         |
| --------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `escalation_policy_id`                                    | *str*                                                                         | :heavy\_check\_mark: | (Required) escalation policy ID                                     |
| `v3_escalation_policies_update_escalation_policy_request` | *Union\[bytes, IO\[bytes], io.BufferedReader]*                                | :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.EscalationPoliciesUpdateEscalationPolicyResponse**](/python-sdk/docs/models/escalationpoliciesupdateescalationpolicyresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
