> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Create or Update a Post Postmortem

`PUT https://api.pagerduty.com/status_pages/{id}/posts/{post_id}/postmortem`

Create or Update a Postmortem for a Post by Post ID.

Scoped OAuth requires: `status_pages.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |
| `post_id` | string | yes | The ID of the Status Page Post. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `postmortem` | object | yes | Request to create/update a given Postmortem resource. |
| `postmortem.type` | string | yes | The type of the object returned by the API - in this case, a Status Page Post Postmortem. Read-only. One of: `status_page_post_postmortem`. Default: `status_page_post_postmortem`. |
| `postmortem.post` | object | yes | Status Page Post. |
| `postmortem.post.id` | string | yes | Status page post unique identifier. |
| `postmortem.post.type` | string | yes | A string that determines the schema of the object. |
| `postmortem.message` | string | yes | The message of the Postmortem (supports Rich-Text). Max length: 10000. |
| `postmortem.notify_subscribers` | boolean | yes | Whether or not subscribers of the Status Page should be notified about the Postmortem. |

Example: default

```json
{
  "postmortem": {
    "message": "<p>Something wrong happened and this is a postmortem.<p>",
    "notify_subscribers": true,
    "post": {
      "id": "P6F2CJ3",
      "self": "https://api.pagerduty.com/status_pages/PR5LMML/posts/P6F2CJ3",
      "type": "status_page_post"
    },
    "type": "status_page_post_postmortem"
  }
}
```

## Response 200

OK

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `postmortem` | object |  | A Postmortem represents a communication resource presented in the Status Page about follow-up made to a certain Post. |
| `postmortem.id` | string |  | An unique identifier within Status Page scope that defines a single Postmortem resource. Read-only. |
| `postmortem.self` | string |  | The API resource URL of the Postmortem. Read-only. |
| `postmortem.post` | object |  | Status Page Post. |
| `postmortem.post.id` | string | yes | The id of the status page post. |
| `postmortem.post.type` | string |  | A string that determines the schema of the object. |
| `postmortem.message` | string |  | The message of the Postmortem (supports Rich-Text). Max length: 10000. |
| `postmortem.notify_subscribers` | boolean |  | Whether or not subscribers of the Status Page should be notified about the Postmortem. |
| `postmortem.reported_at` | string (date-time) |  | The date and time the Postmortem was reported. |
| `postmortem.type` | string |  | The type of the object returned by the API - in this case, a Status Page Post Postmortem. |

Example: Response Example

```json
{
  "postmortem": {
    "id": "PIJ90N7",
    "message": "<p>Something wrong happened and this is a postmortem.<p>",
    "notify_subscribers": true,
    "post": {
      "id": "P6F2CJ3",
      "self": "https://api.pagerduty.com/status_pages/PR5LMML/posts/P6F2CJ3",
      "type": "status_page_post"
    },
    "reported_at": "2023-09-13T10:34:04.000Z",
    "self": "https://api.pagerduty.com/status_pages/PR5LMML/posts/P6F2CJ3/postmortem",
    "type": "status_page_post_postmortem"
  }
}
```

## Response 201

Created

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `postmortem` | object |  | A Postmortem represents a communication resource presented in the Status Page about follow-up made to a certain Post. Same fields as `postmortem` above. |

Example: Response Example

```json
{
  "postmortem": {
    "id": "PIJ90N7",
    "message": "<p>Something wrong happened and this is a postmortem.<p>",
    "notify_subscribers": true,
    "post": {
      "id": "P6F2CJ3",
      "self": "https://api.pagerduty.com/status_pages/PR5LMML/posts/P6F2CJ3",
      "type": "status_page_post"
    },
    "reported_at": "2023-09-13T10:34:04.000Z",
    "self": "https://api.pagerduty.com/status_pages/PR5LMML/posts/P6F2CJ3/postmortem",
    "type": "status_page_post_postmortem"
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
