---
title: "Create postmortem attachment"
method: POST
path: "/api/v2/incidents/{incident_id}/attachments/postmortems"
tags: ["Incidents"]
---

# Create postmortem attachment

`POST /api/v2/incidents/{incident_id}/attachments/postmortems`

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.

## Path parameters

- `incident_id` string, required

## Request body

- PostmortemAttachmentRequest — Request body for creating a postmortem attachment.
  - `data` PostmortemAttachmentRequestData, required — Postmortem attachment data
    - `attributes` PostmortemAttachmentRequestAttributes, required — Postmortem attachment attributes
      - `cells` PostmortemCell[] — The cells of the postmortem
        - `attributes` PostmortemCellAttributes — Attributes of a postmortem cell
          - `definition` PostmortemCellDefinition — Definition of a postmortem cell
            - `content` string — The content of the cell in markdown format
        - `id` string — The unique identifier of the cell
        - `type` 'markdown' — The postmortem cell resource type.
      - `content` string — The content of the postmortem
      - `postmortem_template_id` string — The ID of the postmortem template
      - `title` string — The title of the postmortem
    - `type` 'incident_attachments', required — The incident attachment resource type.

## Response `201`

Created

- Attachment — An attachment response containing the attachment data and related objects.
  - `data` AttachmentData — Attachment data from a response.
    - `attributes` AttachmentDataAttributes, required — The attachment's attributes.
      - `attachment` AttachmentDataAttributesAttachment — The attachment object.
        - `documentUrl` string — The URL of the attachment.
        - `title` string — The title of the attachment.
      - `attachment_type` 'postmortem' | 'link' — The type of the attachment.
      - `modified` string, date-time — Timestamp when the attachment was last modified.
    - `id` string, required — The unique identifier of the attachment.
    - `relationships` AttachmentDataRelationships, required — The attachment's resource relationships.
      - `incident` RelationshipToIncident — Relationship to incident.
        - `data` RelationshipToIncidentData, required — Relationship to incident object.
          - `id` string, required — A unique identifier that represents the incident.
          - `type` 'incidents', required — Incident resource type.
      - `last_modified_by_user` RelationshipToUser — Relationship to user.
        - `data` RelationshipToUserData, required — Relationship to user object.
          - `id` string, required — A unique identifier that represents the user.
          - `type` 'users', required — Users resource type.
    - `type` 'incident_attachments', required — The incident attachment resource type.
  - `included` AttachmentIncluded[] — A list of related objects included in the response.
    - `attributes` IncidentUserAttributes — Attributes of user object returned by the API.
      - `email` string — Email of the user.
      - `handle` string — Handle of the user.
      - `icon` string — URL of the user's icon.
      - `name` string, nullable — Name of the user.
      - `uuid` string — UUID of the user.
    - `id` string — ID of the user.
    - `type` 'users' — Users resource type.

## Other responses

- `400` — Bad Request
- `429` — Too many requests

---

[API](https://skmtc.dev/datadog/apis/api-v2.md) · [All operations](https://skmtc.dev/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
