Import postmortem document
Import a postmortem document from markdown into an incident.
The document content should be provided as GitHub-Flavored Markdown. It will be parsed and converted into the collaborative editor format, and a new postmortem document will be created for the incident.
If no main postmortem document exists for the incident, the imported document will become the main document.
POST
/
v2
/
incidents
/
{id}
/
actions
/
import_postmortem_document
Import postmortem document
curl --request POST \
--url https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "## Summary\n\nA database migration caused increased latency...",
"title": "INC-123: Post-incident review"
}
'import requests
url = "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document"
payload = {
"content": "## Summary
A database migration caused increased latency...",
"title": "INC-123: Post-incident review"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '## Summary\n\nA database migration caused increased latency...',
title: 'INC-123: Post-incident review'
})
};
fetch('https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '## Summary
A database migration caused increased latency...',
'title' => 'INC-123: Post-incident review'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document"
payload := strings.NewReader("{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}"
response = http.request(request)
puts response.read_body{
"postmortem_document": {
"created_at": "2021-08-17T13:28:57.801578Z",
"document_url": "https://app.incident.io/my-org/incidents/123/post-mortems/01GDZEW57FDA1K4S63MGMQ5DS9",
"editors": [
{
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "viewer",
"slack_user_id": "U02AYNF2XJM"
}
],
"exported_urls": [
"https://www.notion.so/INC-123-sad-database",
"https://docs.google.com/document/d/1234"
],
"id": "01GDZEW57FDA1K4S63MGMQ5DS9",
"incident_id": "01GBA8J19SMXQWPJMX3P2ESCVG",
"status": "in_progress",
"title": "INC-123: Database is sad",
"type": "in_app",
"updated_at": "abc123"
}
}🔑 Requires the
in_app_postmortems.import scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The unique identifier of the incident
Example:
"01GBA8J19SMXQWPJMX3P2ESCVG"
Body
application/json
Response
201 - application/json
Created response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Import postmortem document
curl --request POST \
--url https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "## Summary\n\nA database migration caused increased latency...",
"title": "INC-123: Post-incident review"
}
'import requests
url = "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document"
payload = {
"content": "## Summary
A database migration caused increased latency...",
"title": "INC-123: Post-incident review"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '## Summary\n\nA database migration caused increased latency...',
title: 'INC-123: Post-incident review'
})
};
fetch('https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '## Summary
A database migration caused increased latency...',
'title' => 'INC-123: Post-incident review'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document"
payload := strings.NewReader("{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incidents/{id}/actions/import_postmortem_document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"## Summary\\n\\nA database migration caused increased latency...\",\n \"title\": \"INC-123: Post-incident review\"\n}"
response = http.request(request)
puts response.read_body{
"postmortem_document": {
"created_at": "2021-08-17T13:28:57.801578Z",
"document_url": "https://app.incident.io/my-org/incidents/123/post-mortems/01GDZEW57FDA1K4S63MGMQ5DS9",
"editors": [
{
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "viewer",
"slack_user_id": "U02AYNF2XJM"
}
],
"exported_urls": [
"https://www.notion.so/INC-123-sad-database",
"https://docs.google.com/document/d/1234"
],
"id": "01GDZEW57FDA1K4S63MGMQ5DS9",
"incident_id": "01GBA8J19SMXQWPJMX3P2ESCVG",
"status": "in_progress",
"title": "INC-123: Database is sad",
"type": "in_app",
"updated_at": "abc123"
}
}