Update Slack integration

Update an existing Slack integration. Every setting on the integration's Configure page can be changed here. Send only the parameters you wish to change, e.g. integration_type. Lists like alert_options replace the whole list.

Connecting Slack needs a sign-in to your Slack workspace, so connect the integration in the Better Stack dashboard first.

PATCH https://incidents.betterstack.com/api/v2/slack-integrations/{slack_integration_id}

URL parameters

slack_integration_id
required string

Headers

Authorization
required string
Content-Type
required string

Body parameters

integration_type
string
channel_invitees
array
private_channel
boolean
channel_display_name
string
alert_all_teams_and_policies
boolean
alert_options
array
invite_new_slack_users
boolean
on_call_notifications
boolean
notify_on_pause
boolean
notify_on_resolve
boolean
direct_message_on_mention
boolean
ai_sre_on_mention
boolean
restrict_incident_creation_to_channel
boolean
post_timeline_events
boolean
post_incident_metadata
boolean
post_status_page_updates
boolean
status_page_update_resources
array
notify_alongside_primary_responder
boolean
200

Response body

{
  "data": {
    "id": "37",
    "type": "slack_integration",
    "attributes": {
      "slack_team_id": "T04UQ7K4QMB",
      "slack_team_name": "My Slack workspace",
      "slack_channel_id": "C07Q2KF20EU",
      "slack_channel_name": "#better-stack-incidents",
      "slack_status": "active",
      "integration_type": "channel",
      "on_call_notifications": false,
      "notify_alongside_primary_responder": false,
      "channel_display_name": "incidents",
      "channel_invitees": [
        {
          "type": "user",
          "id": 2
        },
        {
          "type": "on_call_calendar",
          "id": 1
        }
      ],
      "status_page_update_resources": [
        {
          "type": "status_page",
          "id": 1
        }
      ],
      "private_channel": true,
      "alert_all_teams_and_policies": false,
      "invite_new_slack_users": true,
      "notify_on_pause": false,
      "notify_on_resolve": true,
      "direct_message_on_mention": false,
      "ai_sre_on_mention": false,
      "restrict_incident_creation_to_channel": true,
      "post_timeline_events": true,
      "post_incident_metadata": false,
      "post_status_page_updates": true,
      "team_name": "My team",
      "alert_options": [
        {
          "type": "team",
          "id": 7,
          "name": "My team",
          "call": false,
          "sms": false,
          "email": true,
          "push": true,
          "critical_alert": true
        },
        {
          "type": "policy",
          "id": 73,
          "name": "High severity policy",
          "team_id": 7,
          "team_name": "My team"
        }
      ]
    }
  }
}
422

Response body

{
  "errors": {
    "alert_options": [
      "Team 8 was not found."
    ]
  }
}
422

Response body

{
  "errors": "Thread-based and channel-based Slack integrations need a paid plan.",
  "unauthorized_attributes": [
    "integration_type"
  ]
}

Example cURL

Create a channel per incident Allow only e-mail and push alerts
curl -X "PATCH" "https://incidents.betterstack.com/api/v2/slack-integrations/37" \
     -H "Authorization: Bearer $TOKEN" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "integration_type": "channel",
  "private_channel": true,
  "channel_invitees": [{ "type": "on_call_calendar", "id": 1 }]
}'
curl -X "PATCH" "https://incidents.betterstack.com/api/v2/slack-integrations/37" \
     -H "Authorization: Bearer $TOKEN" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "alert_all_teams_and_policies": false,
  "alert_options": [
    { "type": "team", "id": 7, "email": true, "push": true },
    { "type": "policy", "id": 73 }
  ]
}'