Update a Slack integration

Updates the settings of a Slack 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 Slack needs you to authorize Better Stack in Slack.

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

URL parameters

id
required string

Headers

Authorization
required string
Content-Type
required string

Body parameters

applications
array of objects
notifications
object
occurrence_threshold_count
integer
occurrence_threshold_interval
string
affected_users_threshold_count
integer
tag_filter
array of objects
post_updates
string
broadcast_updates
boolean
ai_sre_on_mention
boolean
200

Response body

{
  "data": {
    "id": "188",
    "type": "slack_integration",
    "attributes": {
      "team_id": "t123456",
      "team_name": "My team",
      "applications": [
        {
          "application_id": 1234,
          "environments": [
            "production"
          ]
        }
      ],
      "notifications": {
        "spikes": true,
        "spike_protection": true,
        "new_releases": true,
        "new_errors": true,
        "occurrence_milestones": true,
        "occurrence_threshold": false,
        "affected_users_threshold": true,
        "automatically_reopened": false
      },
      "occurrence_threshold_count": 10,
      "occurrence_threshold_interval": "minute",
      "affected_users_threshold_count": 50,
      "tag_filter": [
        {
          "tag": "level",
          "values": [
            "error",
            "fatal"
          ]
        }
      ],
      "slack_team_name": "My Slack workspace",
      "slack_channel_name": "#errors",
      "post_updates": "thread_based",
      "broadcast_updates": true,
      "ai_sre_on_mention": true
    }
  }
}
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": "The \"level\" tag is used in more than one row."
}

Example cURL

Notify about production errors only Post updates in threads
curl --request PATCH \
  --url https://errors.betterstack.com/api/v1/slack-integrations/188 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "applications": [
      { "application_id": 1234, "environments": ["production"] }
    ]
  }'
curl --request PATCH \
  --url https://errors.betterstack.com/api/v1/slack-integrations/188 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "post_updates": "thread_based",
    "broadcast_updates": false
  }'