Skip to main content
POST
/
v1
/
postmortem_documents
/
actions
/
attach
Attach
curl --request POST \
  --url https://api.incident.io/v1/postmortem_documents/actions/attach \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document_provider": "notion",
  "incident_id": "01GBA8J19SMXQWPJMX3P2ESCVG",
  "permalink": "https://www.notion.so/INC-123-database-is-sad"
}
'
import requests

url = "https://api.incident.io/v1/postmortem_documents/actions/attach"

payload = {
"document_provider": "notion",
"incident_id": "01GBA8J19SMXQWPJMX3P2ESCVG",
"permalink": "https://www.notion.so/INC-123-database-is-sad"
}
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({
document_provider: 'notion',
incident_id: '01GBA8J19SMXQWPJMX3P2ESCVG',
permalink: 'https://www.notion.so/INC-123-database-is-sad'
})
};

fetch('https://api.incident.io/v1/postmortem_documents/actions/attach', 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/v1/postmortem_documents/actions/attach",
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([
'document_provider' => 'notion',
'incident_id' => '01GBA8J19SMXQWPJMX3P2ESCVG',
'permalink' => 'https://www.notion.so/INC-123-database-is-sad'
]),
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/v1/postmortem_documents/actions/attach"

payload := strings.NewReader("{\n \"document_provider\": \"notion\",\n \"incident_id\": \"01GBA8J19SMXQWPJMX3P2ESCVG\",\n \"permalink\": \"https://www.notion.so/INC-123-database-is-sad\"\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/v1/postmortem_documents/actions/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_provider\": \"notion\",\n \"incident_id\": \"01GBA8J19SMXQWPJMX3P2ESCVG\",\n \"permalink\": \"https://www.notion.so/INC-123-database-is-sad\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.incident.io/v1/postmortem_documents/actions/attach")

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 \"document_provider\": \"notion\",\n \"incident_id\": \"01GBA8J19SMXQWPJMX3P2ESCVG\",\n \"permalink\": \"https://www.notion.so/INC-123-database-is-sad\"\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 external_postmortems.create scope.

Authorizations

Authorization
string
header
required

API key from your incident.io dashboard (Settings → API keys)

Body

application/json
incident_id
string
required

The unique identifier of the incident to attach the post-mortem document to

Example:

"01GBA8J19SMXQWPJMX3P2ESCVG"

A URL pointing to the externally-hosted post-mortem document

Example:

"https://www.notion.so/INC-123-database-is-sad"

document_provider
enum<string>

The provider hosting the document. Set this when it can't be inferred from the permalink so the link renders correctly.

Available options:
,
confluence,
google_docs,
notion,
sharepoint,
incident_io,
copy_paste_basecamp,
copy_paste_confluence,
copy_paste_github_wiki,
copy_paste_google_docs,
copy_paste_notion,
copy_paste_quip
Example:

"notion"

Response

201 - application/json

Created response.

postmortem_document
object
required