For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/fr/api/latest/incidents/create-postmortem-attachment.md. A documentation index is available at /llms.txt.
Language
Datadog site

Créer une pièce jointe post-mortem

WARNINGNote: This endpoint is in public beta and it's subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.uk1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/postmortemshttps://api.us2.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/postmortems

Présentation

Créer une pièce jointe de post-mortem pour un incident.

L'endpoint accepte le format Markdown pour les notebooks créés dans Confluence ou Google Docs. Les post-mortems créés à partir de notebooks doivent être formatés à l'aide de cellules de notebook frontend, en plus du format Markdown.

Arguments

Paramètres du chemin

Name
Type
Description
incident_id [required]
string

The ID of the incident

Requête

Body Data (required)

Champ
Type
Description
data [required]
object

Réponse

Created

An attachment response containing the attachment data and related objects.

Champ
Type
Description
data
object

Attachment data from a response.

included
[<oneOf>]

A list of related objects included in the response.

Exemple de code

Créer une pièce jointe post-mortem
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF
# Path parameters
export incident_id="00000000-0000-0000-0000-000000000000"

# 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 POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/attachments/postmortems" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cells": [
        {
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
EOF