Update a Slack integration

Update a connected Slack channel's settings, invitees and status page resources, and the teams and escalation policies Slack users can alert. Only provide the fields you want to change. A list you send replaces the whole list.

PATCH https://incidents.betterstack.com/api/v4/slack-integrations/{id}

URL parameters

id
required string

Query parameters

team_id
string

Headers

Authorization
required string
Content-Type
string

Body parameters

integration_type
string
channel_display_name
string or null
channel_invitees
array of objects
channel_invitees[].type
string
channel_invitees[].id
string
alert_options
array of objects
alert_options[].type
string
alert_options[].id
string
alert_options[].call
boolean
alert_options[].sms
boolean
alert_options[].email
boolean
alert_options[].push
boolean
alert_options[].critical_alert
boolean
status_page_update_resources
array of objects
status_page_update_resources[].type
string
status_page_update_resources[].id
string
private_channel
boolean
alert_all_teams_and_policies
boolean
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
notify_alongside_primary_responder
boolean
200

Response body

{
  "data": {
    "id": "123456789",
    "type": "slack_integration",
    "attributes": {
      "slack_team_id": "T04UQ7K4QMB",
      "slack_team_name": "Acme Inc.",
      "slack_channel_id": "C07Q2KF20EU",
      "slack_channel_name": "#better-stack-incidents",
      "slack_status": "active",
      "integration_type": "channel",
      "channel_display_name": "Incidents",
      "channel_invitees": [
        {
          "type": "on_call_calendar",
          "id": "1"
        },
        {
          "type": "user",
          "id": "alice@example.com"
        }
      ],
      "alert_options": [
        {
          "type": "policy",
          "id": "73",
          "name": "High severity policy",
          "team_id": "t7",
          "team_name": "Production"
        },
        {
          "type": "team",
          "id": "t7",
          "name": "Production",
          "call": false,
          "sms": false,
          "email": true,
          "push": false,
          "critical_alert": false
        }
      ],
      "status_page_update_resources": [
        {
          "type": "status_page",
          "id": "1"
        }
      ],
      "private_channel": false,
      "alert_all_teams_and_policies": false,
      "invite_new_slack_users": true,
      "on_call_notifications": true,
      "notify_on_pause": true,
      "notify_on_resolve": true,
      "direct_message_on_mention": true,
      "ai_sre_on_mention": true,
      "restrict_incident_creation_to_channel": false,
      "post_timeline_events": true,
      "post_incident_metadata": true,
      "post_status_page_updates": true,
      "notify_alongside_primary_responder": true,
      "team_id": "t123",
      "team_name": "Production"
    }
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}
403

Response body

{
  "errors": "This API token is read-only and cannot be used for write operations."
}
404
422

Response body

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

Response body

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

Response attributes

id
string
type
string
slack_team_id
string
slack_team_name
string
slack_channel_id
string
slack_channel_name
string
slack_status
string
integration_type
string
channel_display_name
string or null
channel_invitees
array of objects
channel_invitees[].type
string
channel_invitees[].id
string
alert_options
array of objects
alert_options[].type
string
alert_options[].id
string
alert_options[].name
string
alert_options[].team_id
string
alert_options[].team_name
string
alert_options[].call
boolean
alert_options[].sms
boolean
alert_options[].email
boolean
alert_options[].push
boolean
alert_options[].critical_alert
boolean
status_page_update_resources
array of objects
status_page_update_resources[].type
string
status_page_update_resources[].id
string
private_channel
boolean
alert_all_teams_and_policies
boolean
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
notify_alongside_primary_responder
boolean
team_id
string
team_name
string

Example cURL

Create a channel per incident Allow only e-mail and push alerts
curl --request PATCH \
  --url https://incidents.betterstack.com/api/v4/slack-integrations/37 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "integration_type": "channel",
  "private_channel": true,
  "channel_invitees": [
    {
      "type": "on_call_calendar",
      "id": "1"
    },
    {
      "type": "user",
      "id": "alice@example.com"
    }
  ]
}'
curl --request PATCH \
  --url https://incidents.betterstack.com/api/v4/slack-integrations/37 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "alert_all_teams_and_policies": false,
  "alert_options": [
    {
      "type": "team",
      "id": "t7",
      "email": true,
      "push": true
    },
    {
      "type": "policy",
      "id": "73"
    }
  ]
}'