Intégration Webhooks

Intégration Webhooks

Configurez votre intégration Datadog/Webhooks directement via l’API Datadog. Pour en savoir plus sur l’intégration Datadog/Webhooks, consultez la page dédiée à l’intégration.

POST https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhookshttps://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhookshttps://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks

Présentation

Crée un endpoint <NOM_WEBHOOK>.

Requête

Body Data (required)

Corps de requête pour la création d’une intégration Webhooks.

Expand All

Champ

Type

Description

custom_headers

object

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name [required]

string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload

object

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

custom_headers

object

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name [required]

string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload

object

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "name": "WEBHOOK_NAME",
  "url": "https://example.com/webhook"
}
EOF

GET https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Récupère le contenu du Webhook <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

custom_headers

object

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name [required]

string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload

object

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Met à jour l’endpoint <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Requête

Body Data (required)

Mettez à jour une intégration Datadog/Webhooks existante.

Expand All

Champ

Type

Description

custom_headers

object

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name

string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload

object

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

custom_headers

object

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name [required]

string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload

object

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

DELETE https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Supprime l’endpoint <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Réponse

OK

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variableshttps://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variableshttps://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variableshttps://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables

Présentation

Crée un endpoint avec le nom <NOM_VARIABLE_PERSONNALISÉE>.

Requête

Body Data (required)

Corps de requête pour la définition d’une variable personnalisée.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}
EOF

GET https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Affiche le contenu de la variable personnalisée <NOM_VARIABLE_PERSONNALISÉE>. Si la variable personnalisée est secrète, renvoie null pour <NOM_VARIABLE_PERSONNALISÉE> dans la charge utile de la réponse.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Met à jour l’endpoint <CUSTOM_VARIABLE_NAME>.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Requête

Body Data (required)

Corps de requête pour la mise à jour d’une variable personnalisée existante.

Expand All

Champ

Type

Description

is_secret

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value

string

Value of the custom variable.

{
  "is_secret": false,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

DELETE https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Supprime l’endpoint <NOM_VARIABLE_PERSONNALISÉE>.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Réponse

OK

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


# Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"