> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/incidentspostmortems.md).

# Incidents.Postmortems

## Overview

### Available Operations

* [remove](#remove) - Delete Postmortem By Incident
* [get\_by\_incident](#get_by_incident) - Get Postmortem By Incident
* [update\_by\_incident](#update_by_incident) - Update Postmortem By Incident

## remove

* This endpoint is used to delete a postmortem by incident.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.incidents.postmortems.remove(incident_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `incident_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.PostmortemsDeletePostmortemByIncidentResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/postmortemsdeletepostmortembyincidentresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## get\_by\_incident

* This endpoint is used to get a postmortem by incident.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.incidents.postmortems.get_by_incident(incident_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `incident_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.PostmortemsGetPostmortemByIncidentResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/postmortemsgetpostmortembyincidentresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## update\_by\_incident

* This endpoint is used to update a postmortem by incident.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.incidents.postmortems.update_by_incident(incident_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter         | Type                                                                                                                                                                                             | Required             | Description                                                         |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `incident_id`     | *str*                                                                                                                                                                                            | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`        | *Optional\[str]*                                                                                                                                                                                 | :heavy\_minus\_sign: | N/A                                                                 |
| `postmortem`      | *Optional\[str]*                                                                                                                                                                                 | :heavy\_minus\_sign: | N/A                                                                 |
| `follow_ups`      | List\[[models.V3IncidentsPostmortemsPostmortemFollowUp](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3incidentspostmortemspostmortemfollowup.md)]                   | :heavy\_minus\_sign: | N/A                                                                 |
| `new_attachments` | List\[[models.V3IncidentsPostmortemsPostmortemAttachmentRequest](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3incidentspostmortemspostmortemattachmentrequest.md)] | :heavy\_minus\_sign: | N/A                                                                 |
| `title`           | *Optional\[str]*                                                                                                                                                                                 | :heavy\_minus\_sign: | N/A                                                                 |
| `status`          | [Optional\[models.V3IncidentsPostmortemsPostmortemStatus\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3incidentspostmortemspostmortemstatus.md)                  | :heavy\_minus\_sign: | Represents the status of a postmortem.                              |
| `retries`         | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md)                                                                   | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.PostmortemsUpdatePostmortemByIncidentResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/postmortemsupdatepostmortembyincidentresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |
