---
title: Añadir canales a una integración Slack
description: Añade canales a tu integración Slack en Datadog actual.
breadcrumbs: Documentación > API > Añadir canales a una integración Slack
---

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

# Añadir canales a una integración Slack

## 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

Añade canales a tu integración Slack en Datadog actual.

Este método actualiza la configuración de tu integración **sustituyendo**
tu configuración actual por la nueva, enviada a tu organización Datadog.

### Request

#### Body Data (required)

Actualiza el cuerpo de una solicitud de integración Slack en Datadog existente.

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                      | Type     | Description                                                                                                                                                                 |
| ------------ | -------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | channels                   | [object] | Configuración de tus canales de Slack.                                                                                                                                      |
| 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 %}
