---
title: Add channels to Slack integration
description: "Deprecated: This endpoint is deprecated."
breadcrumbs: Docs > API > Add channels to Slack integration
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/llms.txt).

# Add channels to Slack integration

## v1 (deprecated)

| Datadog site      | API endpoint                                               |
| ----------------- | ---------------------------------------------------------- |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v1/integration/slack     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v1/integration/slack |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v1/integration/slack |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v1/integration/slack      |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v1/integration/slack |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v1/integration/slack |
| uk1.datadoghq.com | PUT https://api.uk1.datadoghq.com/api/v1/integration/slack |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v1/integration/slack      |
| us2.ddog-gov.com  | PUT https://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.

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                      | Type     | Description                                                                                                                                                                 |
| ------------ | -------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | channels                   | [object] | An array of slack channel configurations.                                                                                                                                   |
| channels     | account [*required*]       | string   | Account to which the channel belongs to.                                                                                                                                    |
| channels     | channel_name [*required*]  | string   | Your channel name.                                                                                                                                                          |
| channels     | transfer_all_user_comments | boolean  | To be notified for every comment on a graph, set it to `true`. If set to `False` use the `@slack-channel_name` syntax for comments to be posted to slack. Default: `false`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "channels": [
    {
      "account": "jane.doe",
      "channel_name": "#general",
      "transfer_all_user_comments": false
    }
  ]
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="204" %}
OK
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Authentication error

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, 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
```
{% /tab %}
{% /tabs %}
