Note : This endpoint is in public beta and it’s subject to change.
If you have any feedback, contact Datadog support .
POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments/postmortems https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.us2.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems
Overview
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.
Arguments Path Parameters Request Body Data (required)
Expand All
Postmortem attachment data
Postmortem attachment attributes
The cells of the postmortem
Attributes of a postmortem cell
Definition of a postmortem cell
The content of the cell in markdown format
The unique identifier of the cell
The postmortem cell resource type.
Allowed enum values: markdown
The content of the postmortem
The ID of the postmortem template
The title of the postmortem
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
{
"data" : {
"attributes" : {
"cells" : [
{
"attributes" : {
"definition" : {
"content" : "## Incident Summary\nThis incident was caused by..."
}
},
"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"
}
} Response Created
An attachment response containing the attachment data and related objects.
Expand All
Attachment data from a response.
The attachment's attributes.
The URL of the attachment.
The title of the attachment.
The type of the attachment.
Allowed enum values: postmortem,link
Timestamp when the attachment was last modified.
The unique identifier of the attachment.
The attachment's resource relationships.
Relationship to incident.
Relationship to incident object.
A unique identifier that represents the incident.
Incident resource type.
Allowed enum values: incidents
default: incidents
Relationship to user object.
A unique identifier that represents the user.
Users resource type.
Allowed enum values: users
default: users
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
A list of related objects included in the response.
User object returned by the API.
Attributes of user object returned by the API.
Users resource type.
Allowed enum values: users
default: users
{
"data" : {
"attributes" : {
"attachment" : {
"documentUrl" : "https://app.datadoghq.com/notebook/123/Postmortem-IR-123" ,
"title" : "Postmortem IR-123"
},
"attachment_type" : "postmortem" ,
"modified" : "2025-01-01T01:01:01.000000001Z"
},
"id" : "00000000-abcd-0002-0000-000000000000" ,
"relationships" : {
"incident" : {
"data" : {
"id" : "00000000-0000-0000-1234-000000000000" ,
"type" : "incidents"
}
},
"last_modified_by_user" : {
"data" : {
"id" : "00000000-0000-0000-2345-000000000000" ,
"type" : "users"
}
}
},
"type" : "incident_attachments"
},
"included" : [
{
"attributes" : {
"email" : "string" ,
"handle" : "string" ,
"icon" : "string" ,
"name" : "string" ,
"uuid" : "string"
},
"id" : "string" ,
"type" : "users"
}
]
} Bad Request
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
Short human-readable summary of the error.
{
"errors" : [
{
"detail" : "Missing required attribute in body" ,
"meta" : {},
"source" : {
"header" : "Authorization" ,
"parameter" : "limit" ,
"pointer" : "/data/attributes/title"
},
"status" : "400" ,
"title" : "Bad Request"
}
]
} Too many requests
{
"errors" : [
"Bad Request"
]
} Code Example Copy
## default
#
# Path parameters export incident_id = "00000000-0000-0000-0000-000000000000" # Curl command curl -X POST "https://api.ap1.datadoghq.com "https://api.ap2.datadoghq.com "https://api.datadoghq.eu "https://api.ddog-gov.com "https://api.us2.ddog-gov.com "https://api.datadoghq.com "https://api.us3.datadoghq.com "https://api.us5.datadoghq.com /api/v2/incidents/${incident_id}/attachments/postmortems " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} " \
-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
"""
Create postmortem attachment returns "Created" response
"""
from datadog_api_client import ApiClient , Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType
from datadog_api_client.v2.model.postmortem_attachment_request import PostmortemAttachmentRequest
from datadog_api_client.v2.model.postmortem_attachment_request_attributes import PostmortemAttachmentRequestAttributes
from datadog_api_client.v2.model.postmortem_attachment_request_data import PostmortemAttachmentRequestData
from datadog_api_client.v2.model.postmortem_cell import PostmortemCell
from datadog_api_client.v2.model.postmortem_cell_attributes import PostmortemCellAttributes
from datadog_api_client.v2.model.postmortem_cell_definition import PostmortemCellDefinition
from datadog_api_client.v2.model.postmortem_cell_type import PostmortemCellType
body = PostmortemAttachmentRequest (
data = PostmortemAttachmentRequestData (
attributes = PostmortemAttachmentRequestAttributes (
cells = [
PostmortemCell (
attributes = PostmortemCellAttributes (
definition = PostmortemCellDefinition (
content = "## Incident Summary \n This incident was caused by..." ,
),
),
id = "cell-1" ,
type = PostmortemCellType . MARKDOWN ,
),
],
content = "# Incident Report - IR-123 \n [...]" ,
postmortem_template_id = "93645509-874e-45c4-adfa-623bfeaead89-123" ,
title = "Postmortem-IR-123" ,
),
type = IncidentAttachmentType . INCIDENT_ATTACHMENTS ,
),
)
configuration = Configuration ()
configuration . unstable_operations [ "create_incident_postmortem_attachment" ] = True
with ApiClient ( configuration ) as api_client :
api_instance = IncidentsApi ( api_client )
response = api_instance . create_incident_postmortem_attachment (
incident_id = "00000000-0000-0000-0000-000000000000" , body = body
)
print ( response )
Instructions First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" python3 "example.py"
# Create postmortem attachment returns "Created" response
require "datadog_api_client"
DatadogAPIClient . configure do | config |
config . unstable_operations [ "v2.create_incident_postmortem_attachment" . to_sym ] = true
end
api_instance = DatadogAPIClient :: V2 :: IncidentsAPI . new
body = DatadogAPIClient :: V2 :: PostmortemAttachmentRequest . new ({
data : DatadogAPIClient :: V2 :: PostmortemAttachmentRequestData . new ({
attributes : DatadogAPIClient :: V2 :: PostmortemAttachmentRequestAttributes . new ({
cells : [
DatadogAPIClient :: V2 :: PostmortemCell . new ({
attributes : DatadogAPIClient :: V2 :: PostmortemCellAttributes . new ({
definition : DatadogAPIClient :: V2 :: PostmortemCellDefinition . new ({
content : '## Incident Summary\nThis incident was caused by...' ,
}),
}),
id : "cell-1" ,
type : DatadogAPIClient :: V2 :: PostmortemCellType :: MARKDOWN ,
}),
] ,
content : '# Incident Report - IR-123\n[...]' ,
postmortem_template_id : "93645509-874e-45c4-adfa-623bfeaead89-123" ,
title : "Postmortem-IR-123" ,
}),
type : DatadogAPIClient :: V2 :: IncidentAttachmentType :: INCIDENT_ATTACHMENTS ,
}),
})
p api_instance . create_incident_postmortem_attachment ( "00000000-0000-0000-0000-000000000000" , body )
Instructions First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" rb "example.rb"
// Create postmortem attachment returns "Created" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main () {
body := datadogV2 . PostmortemAttachmentRequest {
Data : datadogV2 . PostmortemAttachmentRequestData {
Attributes : datadogV2 . PostmortemAttachmentRequestAttributes {
Cells : [] datadogV2 . PostmortemCell {
{
Attributes : & datadogV2 . PostmortemCellAttributes {
Definition : & datadogV2 . PostmortemCellDefinition {
Content : datadog . PtrString ( `## Incident Summary
This incident was caused by...` ),
},
},
Id : datadog . PtrString ( "cell-1" ),
Type : datadogV2 . POSTMORTEMCELLTYPE_MARKDOWN . Ptr (),
},
},
Content : datadog . PtrString ( `# Incident Report - IR-123
[...]` ),
PostmortemTemplateId : datadog . PtrString ( "93645509-874e-45c4-adfa-623bfeaead89-123" ),
Title : datadog . PtrString ( "Postmortem-IR-123" ),
},
Type : datadogV2 . INCIDENTATTACHMENTTYPE_INCIDENT_ATTACHMENTS ,
},
}
ctx := datadog . NewDefaultContext ( context . Background ())
configuration := datadog . NewConfiguration ()
configuration . SetUnstableOperationEnabled ( "v2.CreateIncidentPostmortemAttachment" , true )
apiClient := datadog . NewAPIClient ( configuration )
api := datadogV2 . NewIncidentsApi ( apiClient )
resp , r , err := api . CreateIncidentPostmortemAttachment ( ctx , "00000000-0000-0000-0000-000000000000" , body )
if err != nil {
fmt . Fprintf ( os . Stderr , "Error when calling `IncidentsApi.CreateIncidentPostmortemAttachment`: %v\n" , err )
fmt . Fprintf ( os . Stderr , "Full HTTP response: %v\n" , r )
}
responseContent , _ := json . MarshalIndent ( resp , "" , " " )
fmt . Fprintf ( os . Stdout , "Response from `IncidentsApi.CreateIncidentPostmortemAttachment`:\n%s\n" , responseContent )
}
Instructions First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" go run "main.go"
// Create postmortem attachment returns "Created" response
import com.datadog.api.client.ApiClient ;
import com.datadog.api.client.ApiException ;
import com.datadog.api.client.v2.api.IncidentsApi ;
import com.datadog.api.client.v2.model.Attachment ;
import com.datadog.api.client.v2.model.IncidentAttachmentType ;
import com.datadog.api.client.v2.model.PostmortemAttachmentRequest ;
import com.datadog.api.client.v2.model.PostmortemAttachmentRequestAttributes ;
import com.datadog.api.client.v2.model.PostmortemAttachmentRequestData ;
import com.datadog.api.client.v2.model.PostmortemCell ;
import com.datadog.api.client.v2.model.PostmortemCellAttributes ;
import com.datadog.api.client.v2.model.PostmortemCellDefinition ;
import com.datadog.api.client.v2.model.PostmortemCellType ;
import java.util.Collections ;
public class Example {
public static void main ( String [] args ) {
ApiClient defaultClient = ApiClient . getDefaultApiClient ();
defaultClient . setUnstableOperationEnabled ( "v2.createIncidentPostmortemAttachment" , true );
IncidentsApi apiInstance = new IncidentsApi ( defaultClient );
PostmortemAttachmentRequest body =
new PostmortemAttachmentRequest ()
. data (
new PostmortemAttachmentRequestData ()
. attributes (
new PostmortemAttachmentRequestAttributes ()
. cells (
Collections . singletonList (
new PostmortemCell ()
. attributes (
new PostmortemCellAttributes ()
. definition (
new PostmortemCellDefinition ()
. content (
"""
## Incident Summary
This incident was caused by...
""" )))
. id ( "cell-1" )
. type ( PostmortemCellType . MARKDOWN )))
. content ( """
# Incident Report - IR-123
[...]
""" )
. postmortemTemplateId ( "93645509-874e-45c4-adfa-623bfeaead89-123" )
. title ( "Postmortem-IR-123" ))
. type ( IncidentAttachmentType . INCIDENT_ATTACHMENTS ));
try {
Attachment result =
apiInstance . createIncidentPostmortemAttachment (
"00000000-0000-0000-0000-000000000000" , body );
System . out . println ( result );
} catch ( ApiException e ) {
System . err . println ( "Exception when calling IncidentsApi#createIncidentPostmortemAttachment" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
Instructions First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" java "Example.java"
// Create postmortem attachment returns "Created" response
use datadog_api_client ::datadog ;
use datadog_api_client ::datadogV2 ::api_incidents ::IncidentsAPI ;
use datadog_api_client ::datadogV2 ::model ::IncidentAttachmentType ;
use datadog_api_client ::datadogV2 ::model ::PostmortemAttachmentRequest ;
use datadog_api_client ::datadogV2 ::model ::PostmortemAttachmentRequestAttributes ;
use datadog_api_client ::datadogV2 ::model ::PostmortemAttachmentRequestData ;
use datadog_api_client ::datadogV2 ::model ::PostmortemCell ;
use datadog_api_client ::datadogV2 ::model ::PostmortemCellAttributes ;
use datadog_api_client ::datadogV2 ::model ::PostmortemCellDefinition ;
use datadog_api_client ::datadogV2 ::model ::PostmortemCellType ;
#[tokio::main]
async fn main () {
let body = PostmortemAttachmentRequest ::new ( PostmortemAttachmentRequestData ::new (
PostmortemAttachmentRequestAttributes ::new ()
. cells ( vec! [ PostmortemCell ::new ()
. attributes (
PostmortemCellAttributes ::new (). definition (
PostmortemCellDefinition ::new (). content (
r #"## Incident Summary
This incident was caused by..."#
. to_string (),
),
),
)
. id ( "cell-1" . to_string ())
. type_ ( PostmortemCellType ::MARKDOWN )])
. content (
r #"# Incident Report - IR-123
[...]"#
. to_string (),
)
. postmortem_template_id ( "93645509-874e-45c4-adfa-623bfeaead89-123" . to_string ())
. title ( "Postmortem-IR-123" . to_string ()),
IncidentAttachmentType ::INCIDENT_ATTACHMENTS ,
));
let mut configuration = datadog ::Configuration ::new ();
configuration . set_unstable_operation_enabled ( "v2.CreateIncidentPostmortemAttachment" , true );
let api = IncidentsAPI ::with_config ( configuration );
let resp = api
. create_incident_postmortem_attachment (
"00000000-0000-0000-0000-000000000000" . to_string (),
body ,
)
. await ;
if let Ok ( value ) = resp {
println! ( " {:#?} " , value );
} else {
println! ( " {:#?} " , resp . unwrap_err ());
}
}
Instructions First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" cargo run
/**
* Create postmortem attachment returns "Created" response
*/
import { client , v2 } from "@datadog/datadog-api-client" ;
const configuration = client . createConfiguration ();
configuration . unstableOperations [ "v2.createIncidentPostmortemAttachment" ] =
true ;
const apiInstance = new v2 . IncidentsApi ( configuration );
const params : v2.IncidentsApiCreateIncidentPostmortemAttachmentRequest = {
body : {
data : {
attributes : {
cells : [
{
attributes : {
definition : {
content : "## Incident Summary\nThis incident was caused by..." ,
},
},
id : "cell-1" ,
type : "markdown" ,
},
],
content : "# Incident Report - IR-123\n[...]" ,
postmortemTemplateId : "93645509-874e-45c4-adfa-623bfeaead89-123" ,
title : "Postmortem-IR-123" ,
},
type : "incident_attachments" ,
},
},
incidentId : "00000000-0000-0000-0000-000000000000" ,
};
apiInstance
. createIncidentPostmortemAttachment ( params )
. then (( data : v2.Attachment ) => {
console . log (
"API called successfully. Returned data: " + JSON . stringify ( data )
);
})
. catch (( error : any ) => console . error ( error ));
Instructions First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<API-KEY>" DD_APP_KEY = "<APP-KEY>" tsc "example.ts"