On-Call API › Postmortems
Write an incident's postmortem
Creates the incident's postmortem, or replaces every field of the existing
one: a field left out is stored empty. status defaults to draft on
creation. Setting it to published records published_at the first time and,
when the incident is on a status page, posts the postmortem there. The caller
becomes the author. POST and PUT do the same thing.
Permission (API-key scope): oncall:postmortem:write.
Authorization
bearerAuth(oncall:postmortem:write)apiKeyHeader(oncall:postmortem:write)
Parameters
Path parameters
idstring requiredThe incident's id.
Request body required
Every field is written as sent; one left out is stored empty.
statusPostmortemStatussummarystringroot_causestringcontributing_factorsstringtimelinestringaction_itemsstringlessons_learnedstring
Responses
200
The postmortem.
dataPostmortem requiredShow Postmortem properties
idstringorg_idstringincident_idstringauthor_idstringstatusPostmortemStatussummarystringroot_causestringcontributing_factorsstringtimelinestringaction_itemsstringlessons_learnedstringpublished_atstring (date-time)created_atstring (date-time)updated_atstring (date-time)
successboolean required
400
The body is not valid JSON (INVALID_BODY).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The key lacks the scope this endpoint needs (FORBIDDEN).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
404
No incident with this id in your organization (NOT_FOUND).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
Example request
curl -X POST 'https://evohub.io/api/v1/incidents/2e7f9a1b-3c4d-4e5f-8a9b-0c1d2e3f4a5b/postmortem' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"status": "draft",
"summary": "Payments timed out for 42 minutes.",
"timeline": "08:01 first alert; 08:43 rollback complete.",
"root_cause": "A connection pool limit was lowered in the v2.15.0 release.",
"action_items": "Alert on pool saturation; load test pool changes.",
"lessons_learned": "Configuration changes need the same review as code.",
"contributing_factors": "No alert on pool saturation."
}'