> 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/msteams2.md).

# Extensions.Msteams

## Overview

### Available Operations

* [create\_or\_update\_config](#create_or_update_config) - Create Or Update MSTeams Configuration

## create\_or\_update\_config

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.extensions.msteams.create_or_update_config(default_conversation_name="<value>", default_conversation_id="<id>", is_active=False, is_default_active=False, is_custom_channels_active=True, triggers={
        "all_active": False,
        "custom": [],
    }, tenant_id="<id>", from_id="<id>", connected_teams=[
        {
            "team_id": "<id>",
            "team_name": "<value>",
            "channel_configurations": [
                {
                    "squadcast_team_id": "<id>",
                    "squadcast_team_name": "<value>",
                    "is_all_services": True,
                    "services": [
                        {
                            "squadcast_service_id": "<id>",
                            "squadcast_service_name": "<value>",
                        },
                    ],
                    "msteams_channel_id": "<id>",
                    "msteams_channel_name": "<value>",
                },
            ],
        },
    ])

    # Handle response
    print(res)

```

### Parameters

| Parameter                     | Type                                                                                                                                                                                      | Required             | Description                                                                                                                                   |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `default_conversation_name`   | *str*                                                                                                                                                                                     | :heavy\_check\_mark: | The display name for the default conversation/channel.                                                                                        |
| `default_conversation_id`     | *str*                                                                                                                                                                                     | :heavy\_check\_mark: | The unique identifier for the default MS Teams conversation/channel.                                                                          |
| `is_active`                   | *bool*                                                                                                                                                                                    | :heavy\_check\_mark: | A master switch to enable or disable the entire integration.                                                                                  |
| `is_default_active`           | *bool*                                                                                                                                                                                    | :heavy\_check\_mark: | Determines if notifications should be sent to the default channel.                                                                            |
| `is_custom_channels_active`   | *bool*                                                                                                                                                                                    | :heavy\_check\_mark: | Determines if notifications should be sent to custom-configured channels.                                                                     |
| `triggers`                    | [models.V3ExtensionsMSTeamsTriggers](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3extensionsmsteamstriggers.md)                                             | :heavy\_check\_mark: | Configuration for which alerts are sent to the MS Teams channel.                                                                              |
| `tenant_id`                   | *str*                                                                                                                                                                                     | :heavy\_check\_mark: | The Azure AD Tenant ID of the organization that owns this extension.                                                                          |
| `from_id`                     | *str*                                                                                                                                                                                     | :heavy\_check\_mark: | The Azure AD Object ID of the user who created this extension.                                                                                |
| `connected_teams`             | List\[[models.V3ExtensionsMSTeamsConnectedTeams](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3extensionsmsteamsconnectedteams.md)]                          | :heavy\_check\_mark: | A list of all MS Teams (teams) connected to this organization.                                                                                |
| `custom_incident_alert_state` | [Optional\[models.V3ExtensionsMSTeamsIncidentActionAlertState\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3extensionsmsteamsincidentactionalertstate.md) | :heavy\_minus\_sign: | A user-friendly way to configure which incident action alerts are active. This is translated by the backend into the 'triggers.custom' array. |
| `id`                          | *Optional\[str]*                                                                                                                                                                          | :heavy\_minus\_sign: | The MongoDB ObjectID of the extension document. Should be included for updates.                                                               |
| `organization_id`             | *Optional\[str]*                                                                                                                                                                          | :heavy\_minus\_sign: | The MongoDB ObjectID of the organization this extension belongs to.                                                                           |
| `retries`                     | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md)                                                            | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client.                                                                           |

### Response

[**models.MSTeamsCreateOrUpdateMsteamsConfigurationResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/msteamscreateorupdatemsteamsconfigurationresponse.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    | \*/\*            |
