# Postmortems

## Overview

### Available Operations

* [get\_all](#get_all) - Get All Postmortems
* [create](#create) - Create Postmortem

## get\_all

* This endpoint is used to get all postmortems.
* 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.postmortems.get_all(from_date="<value>", to_date="<value>", owner_id="<id>", limit=221553)

    # Handle response
    print(res)

```

### Parameters

| Parameter   | Type                                                                          | Required             | Description                                                         |
| ----------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `from_date` | *str*                                                                         | :heavy\_check\_mark: | Provide date in RFC3339 format                                      |
| `to_date`   | *str*                                                                         | :heavy\_check\_mark: | Provide date in RFC3339 format                                      |
| `owner_id`  | *str*                                                                         | :heavy\_check\_mark: | Here owner\_id represents team\_id                                  |
| `limit`     | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`   | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.PostmortemsGetAllPostmortemsResponse**](/python-sdk/docs/models/postmortemsgetallpostmortemsresponse.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    | \*/\*            |

## create

* This endpoint is used to create a postmortem.
* 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.postmortems.create(incident_id="<id>", owner_id="<id>", title="<value>", postmortem="<value>", status="published", follow_ups=[], attachments=[
        {},
    ])

    # Handle response
    print(res)

```

### Parameters

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

### Response

[**models.PostmortemsCreatePostmortemResponse**](/python-sdk/docs/models/postmortemscreatepostmortemresponse.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    | \*/\*            |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/postmortemssdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
