For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/slack-integration/add-channels-to-slack-integration.md. A documentation index is available at /llms.txt.
Language
Datadog site

Add channels to Slack integration

PUThttps://api.datadoghq.com/api/v1/integration/slackhttps://api.us3.datadoghq.com/api/v1/integration/slackhttps://api.us5.datadoghq.com/api/v1/integration/slackhttps://api.datadoghq.eu/api/v1/integration/slackhttps://api.ap1.datadoghq.com/api/v1/integration/slackhttps://api.ap2.datadoghq.com/api/v1/integration/slackhttps://api.uk1.datadoghq.com/api/v1/integration/slackhttps://api.ddog-gov.com/api/v1/integration/slackhttps://api.us2.ddog-gov.com/api/v1/integration/slack

Overview

Deprecated: This endpoint is deprecated.

This method completely rewrites your integration configuration by replacing your current configuration with the new one sent to your Datadog organization. Please ensure that all fields—including the Slack webhook URL—are valid because an invalid URL will break your Slack notifications.

Request

Body Data (required)

Update an existing Datadog-Slack integration request body.

Field
Type
Description
channels
[object]

An array of slack channel configurations.

Response

OK

Code Example

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "Main_Account",
      "channel_name": "#channel_name_main_account",
      "transfer_all_user_comments": false
    }
  ]
}
EOF