Update a Microsoft Teams integration

Updates the settings of a Microsoft Teams integration, the same settings as its Configure page. Send only the parameters you wish to change.

Connect the integration in Errors → Integrations first, since connecting Microsoft Teams needs you to authorize Better Stack in Microsoft Teams.

PATCH https://errors.betterstack.com/api/v1/microsoft-teams-integrations/{id}

URL parameters

id
required string

Headers

Authorization
required string
Content-Type
required string

Body parameters

notifications
object
occurrence_threshold_count
integer
occurrence_threshold_interval
string
affected_users_threshold_count
integer
tag_filter
array of objects
routes
array of objects
200

Response body

{
  "data": {
    "id": "55",
    "type": "microsoft_teams_integration",
    "attributes": {
      "team_id": "t123456",
      "team_name": "My team",
      "notifications": {
        "spikes": true,
        "spike_protection": true,
        "new_releases": true,
        "new_errors": true,
        "occurrence_milestones": true,
        "occurrence_threshold": false,
        "affected_users_threshold": false,
        "automatically_reopened": false
      },
      "occurrence_threshold_count": 10,
      "occurrence_threshold_interval": "minute",
      "affected_users_threshold_count": 10,
      "tag_filter": [],
      "microsoft_teams_team_name": "Engineering",
      "microsoft_teams_channel_name": "General",
      "routes": [
        {
          "applications": [
            {
              "application_id": 1234,
              "environments": [
                "production"
              ]
            }
          ],
          "channels": [
            {
              "id": "19:a1b2c3d4e5f6@thread.tacv2",
              "name": "Checkout errors"
            }
          ]
        },
        {
          "applications": [],
          "channels": [
            {
              "id": "19:f6e5d4c3b2a1@thread.tacv2",
              "name": "General"
            }
          ]
        }
      ]
    }
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
404

Response body

{
  "errors": "Resource with the provided ID was not found"
}
422

Response body

{
  "errors": "Unknown Microsoft Teams channel \"19:0a1b2c3d@thread.tacv2\" in routes[0]. Use the ID of a standard channel in the team the Better Stack app was added to."
}

Example cURL

Send an application's errors to its own channel
curl --request PATCH \
  --url https://errors.betterstack.com/api/v1/microsoft-teams-integrations/55 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "routes": [
      {
        "applications": [
          { "application_id": 1234, "environments": ["production"] }
        ],
        "channels": [
          { "id": "19:a1b2c3d4e5f6@thread.tacv2" }
        ]
      },
      {
        "applications": [],
        "channels": [
          { "id": "19:f6e5d4c3b2a1@thread.tacv2" }
        ]
      }
    ]
  }'