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

Create postmortem attachment

ADVERTENCIANote: 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

Descripción general

Create a postmortem attachment for an incident.

The endpoint accepts markdown for notebooks created in Confluence or Google Docs. Postmortems created from notebooks need to be formatted using frontend notebook cells, in addition to markdown format.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
incident_id [required]
string

The ID of the incident

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Postmortem attachment data

Respuesta

Created

An attachment response containing the attachment data and related objects.

Campo
Type
Descripción
data
object

Attachment data from a response.

included
[<oneOf>]

A list of related objects included in the response.

Ejemplo de código

Create postmortem attachment
# 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