Slack Integration
Incident Management is now generally available! Incident Management is now generally available!

Slack Integration

Configure your Datadog-Slack integration directly through the Datadog API.

Add channels to Slack integration

PUT https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack

Overview

Add channels to your existing Datadog-Slack integration.

This method updates your integration configuration by replacing your current configuration with the new one sent to your Datadog organization.

Request

Body Data (required)

Update an existing Datadog-Slack integration request body.

Expand All

Field

Type

Description

channels

[object]

An array of slack channel configurations.

account [required]

string

Account to which the channel belongs to.

channel_name [required]

string

Your channel name.

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.

{
  "channels": [
    {
      "account": "jane.doe",
      "channel_name": "#general",
      "transfer_all_user_comments": false
    }
  ]
}

Response

OK

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X PUT "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "channels": [
    {
      "account": "jane.doe",
      "channel_name": "#general"
    }
  ]
}
EOF

Create a Slack integration

POST https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack

Overview

Create a Datadog-Slack integration. Once created, add a channel to it with the Add channels to Slack integration endpoint.

This method updates your integration configuration by adding your new configuration to the existing one in your Datadog organization.

Request

Body Data (required)

Create Datadog-Slack integration request body.

Expand All

Field

Type

Description

service_hooks

[object]

The array of service hook objects.

account [required]

string

Your Slack account name.

url [required]

string

Your Slack service hook URL.

{
  "service_hooks": [
    {
      "account": "joe.doe",
      "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ]
}

Response

OK

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X POST "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "service_hooks": [
    {
      "account": "joe.doe",
      "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ]
}
EOF
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

config= {
    "service_hooks": [
      {
        "account": "Main_Account",
        "url": "https://hooks.slack.com/services/1/1/1"
      },
      {
        "account": "doghouse",
        "url": "https://hooks.slack.com/services/2/2/2"
      }
    ]
  }

dog = Dogapi::Client.new(api_key, app_key)

dog.create_integration('slack', config)

Create a Slack integration channel

POST https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channelshttps://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels

Overview

Add a channel to your Datadog-Slack integration.

Arguments

Path Parameters

Name

Type

Description

team_name [required]

string

Your Slack team name.

Request

Body Data (required)

Payload describing Slack channel to be created

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Response

OK

The Slack channel configuration.

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export team_name="CHANGE_ME"
# Curl command curl -X POST "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF

Delete a Slack integration

DELETE https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack

Overview

Delete a Datadog-Slack integration.

Response

OK

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X DELETE "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dog.delete_integration('slack')

Get a Slack integration channel

GET https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}

Overview

Get a channel configured for your Datadog-Slack integration.

Arguments

Path Parameters

Name

Type

Description

team_name [required]

string

Your Slack team name.

channel_name [required]

string

The name of the Slack channel being operated on.

Response

OK

The Slack channel configuration.

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Get all channels in a Slack integration

GET https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channelshttps://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels

Overview

Get a list of all channels configured for your Datadog-Slack integration.

Arguments

Path Parameters

Name

Type

Description

team_name [required]

string

Your Slack team name.

Response

OK

A list of configured Slack channels.

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export team_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Get info about a Slack integration

GET https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack

Overview

Get all information about your Datadog-Slack integration.

Response

OK

Expand All

Field

Type

Description

No response body

{}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dog.get_integration('slack')

Remove a Slack integration channel

DELETE https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}

Overview

Remove a channel from your Datadog-Slack integration.

Arguments

Path Parameters

Name

Type

Description

team_name [required]

string

Your Slack team name.

channel_name [required]

string

The name of the Slack channel being operated on.

Response

The channel was removed successfully.

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Update a Slack integration channel

PATCH https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}

Overview

Update a channel used in your Datadog-Slack integration.

Arguments

Path Parameters

Name

Type

Description

team_name [required]

string

Your Slack team name.

channel_name [required]

string

The name of the Slack channel being operated on.

Request

Body Data (required)

Payload describing fields and values to be updated.

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Response

OK

The Slack channel configuration.

Expand All

Field

Type

Description

display

object

Configuration options for what is shown in an alert event message.

message

boolean

Show the main body of the alert event.

notified

boolean

Show the list of @-handles in the alert event.

snapshot

boolean

Show the alert event's snapshot image.

tags

boolean

Show the scopes on which the monitor alerted.

name

string

Your channel name.

{
  "display": {
    "message": false,
    "notified": false,
    "snapshot": false,
    "tags": false
  },
  "name": "#general"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command curl -X PATCH "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF