# incidents

## Incidents

### Overview

#### Available Operations

* [BulkAcknowledge](#bulkacknowledge) - Bulk Acknowledge Incidents
* [Export](#export) - Incident Export
* [ExportAsync](#exportasync) - Incident Export Async
* [BulkUpdatePriority](#bulkupdatepriority) - Bulk Incidents Priority Update
* [BulkResolve](#bulkresolve) - Bulk Resolve Incidents
* [GetByID](#getbyid) - Get Incident by ID
* [Acknowledge](#acknowledge) - Acknowledge Incident
* [MarkSloFalsePositive](#markslofalsepositive) - Mark Incident SLO False Positive
* [UpdatePriority](#updatepriority) - Incident Priority Update
* [Reassign](#reassign) - Reassign Incident
* [Resolve](#resolve) - Resolve Incident
* [GetStatusByRequestIds](#getstatusbyrequestids) - Get Incidents Status By RequestIDs
* [GetAllPostmortems](#getallpostmortems) - Get All Postmortems
* [MarkAsTransient](#markastransient) - Mark as Transient
* [UpdatePostmortem](#updatepostmortem) - Update Postmortem By Incident
* [UnsnoozeNotifications](#unsnoozenotifications) - Unsnooze Incident Notifications

### BulkAcknowledge

* This endpoint is used to bulk acknowledge the incident by IDs. The API can handle a maximum of 100 incident IDs in a single request with 10 such calls per minute."
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.BulkAcknowledge(ctx, components.V3IncidentsBulkIncidentIDsRequest{
        IncidentIds: []string{
            "<value 1>",
            "<value 2>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                                | Required             | Description                                |
| --------- | ------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                               | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3IncidentsBulkIncidentIDsRequest](/go-sdk/docs/models/components/v3incidentsbulkincidentidsrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                    | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsBulkAcknowledgeIncidentsResponse**](/go-sdk/docs/models/operations/incidentsbulkacknowledgeincidentsresponse.md)**, error**

#### Errors

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

### Export

* This endpoint is used to export the incident details into a `csv` or `json` file.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.
* Header field/value: `Content-Type`: `text/csv`

Query Params:

```
type: csv or json
start_time: filter by date range
end_time: filter by date range
services: filter by services
sources: filter by alert sources
assigned_to: filter by assignee
status: filter by incident status
slo_affecting: filetr by slo affected
slos: filter by slos
tags: filter by tags key=value

```

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/types"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"github.com/solarwinds/squadcast-sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.Export(ctx, operations.IncidentsIncidentExportRequest{
        StartTime: types.MustTimeFromString("2023-02-02T07:53:59.590Z"),
        EndTime: types.MustTimeFromString("2023-02-03T13:28:22.839Z"),
        Type: components.V3IncidentsExportFormatCsv,
        OwnerID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                          | Required             | Description                                |
| --------- | ------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                         | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [operations.IncidentsIncidentExportRequest](/go-sdk/docs/models/operations/incidentsincidentexportrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                              | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsIncidentExportResponse**](/go-sdk/docs/models/operations/incidentsincidentexportresponse.md)**, error**

#### Errors

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

### ExportAsync

* This is an async API, once the request is made the export will start in our workers. You will get a download link to your registered Email ID once the export is completed

#### Payload

| Key         | Value              | Example                    |
| ----------- | ------------------ | -------------------------- |
| type        | csv / json         | “csv”                      |
| start\_time | Date in ISO Format | “2020-01-01T00:00:00.000Z” |
| end\_time   | Date in ISO Format | “2020-04-01T00:00:00.000Z” |
| owner\_id   | Team ID            | “611262a9d5b4ea846b534a3f” |

#### Incident Filters

| Key          | Value                                                     | Example                            |
| ------------ | --------------------------------------------------------- | ---------------------------------- |
| statuses     | Array of triggered / resolved / acknowledged / suppressed | \[“triggered”, “acknowleged”]      |
| tags         | Array of tags in format “KEY=VALUE”                       | \[“severity=high”, “severity=low”] |
| sources      | Array of Alert Source IDs                                 | \[“6077f7225fdc7075e371685f”]      |
| services     | Array of Service IDs                                      | \["62385fb309bc474014180828"]      |
| assigned\_to | Array of Assigned to user IDs                             | \["625e40c9a9bd76370bf9f7fb"]      |

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"github.com/solarwinds/squadcast-sdk-go/types"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.ExportAsync(ctx, components.V3IncidentsIncidentExportAsyncRequest{
        OwnerID: "<id>",
        Type: components.V3IncidentsExportFormatCsv,
        StartTime: types.MustTimeFromString("2024-12-29T12:56:54.559Z"),
        EndTime: types.MustTimeFromString("2025-08-25T17:31:33.747Z"),
        IncidentFilters: components.V3IncidentsExportIncidentsFilter{
            Services: []string{},
            Sources: []string{},
            ServiceOwner: components.V3IncidentsServiceOwnerFilter{
                UserIDs: []string{
                    "<value 1>",
                },
                SquadIDs: []string{
                    "<value 1>",
                    "<value 2>",
                    "<value 3>",
                },
            },
            AssignedTo: []string{
                "<value 1>",
                "<value 2>",
                "<value 3>",
            },
            AssignedToUserIDsAndTheirSquads: []string{
                "<value 1>",
                "<value 2>",
            },
            Statuses: []string{
                "<value 1>",
                "<value 2>",
                "<value 3>",
            },
            Priority: []components.V3IncidentsIncidentPriority{
                components.V3IncidentsIncidentPriorityP5,
            },
            Tags: []string{},
            Notes: "<value>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Body != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                                        | Required             | Description                                |
| --------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                                       | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3IncidentsIncidentExportAsyncRequest](/go-sdk/docs/models/components/v3incidentsincidentexportasyncrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                            | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsIncidentExportAsyncResponse**](/go-sdk/docs/models/operations/incidentsincidentexportasyncresponse.md)**, error**

#### Errors

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

### BulkUpdatePriority

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.BulkUpdatePriority(ctx, components.V3IncidentsBulkIncidentsPriorityUpdateRequest{
        IncidentIds: []string{},
        Priority: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Body != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                                                        | Required             | Description                                |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                                                       | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3IncidentsBulkIncidentsPriorityUpdateRequest](/go-sdk/docs/models/components/v3incidentsbulkincidentspriorityupdaterequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                                            | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsBulkIncidentsPriorityUpdateResponse**](/go-sdk/docs/models/operations/incidentsbulkincidentspriorityupdateresponse.md)**, error**

#### Errors

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

### BulkResolve

* This endpoint is used to bulk resolve the incident by IDs. The API can handle a maximum of 100 incident IDs in a single request with 10 such calls per minute."
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.BulkResolve(ctx, components.V3IncidentsBulkIncidentIDsRequest{
        IncidentIds: []string{
            "<value 1>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                                | Required             | Description                                |
| --------- | ------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                               | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3IncidentsBulkIncidentIDsRequest](/go-sdk/docs/models/components/v3incidentsbulkincidentidsrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                    | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsBulkResolveIncidentsResponse**](/go-sdk/docs/models/operations/incidentsbulkresolveincidentsresponse.md)**, error**

#### Errors

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

### GetByID

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.GetByID(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter    | Type                                                             | Required             | Description                         |
| ------------ | ---------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`        | [context.Context](https://pkg.go.dev/context#Context)            | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `opts`       | \[][operations.Option](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsGetIncidentByIDResponse**](/go-sdk/docs/models/operations/incidentsgetincidentbyidresponse.md)**, error**

#### Errors

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

### Acknowledge

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.Acknowledge(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter    | Type                                                             | Required             | Description                         |
| ------------ | ---------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`        | [context.Context](https://pkg.go.dev/context#Context)            | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `opts`       | \[][operations.Option](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsAcknowledgeIncidentResponse**](/go-sdk/docs/models/operations/incidentsacknowledgeincidentresponse.md)**, error**

#### Errors

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

### MarkSloFalsePositive

* This endpoint is used to mark incident slo false positive.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.MarkSloFalsePositive(ctx, "<id>", "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter    | Type                                                             | Required             | Description                         |
| ------------ | ---------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`        | [context.Context](https://pkg.go.dev/context#Context)            | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `value`      | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `opts`       | \[][operations.Option](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsMarkIncidentSloFalsePositiveResponse**](/go-sdk/docs/models/operations/incidentsmarkincidentslofalsepositiveresponse.md)**, error**

#### Errors

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

### UpdatePriority

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.UpdatePriority(ctx, "<id>", components.V3IncidentsIncidentPriorityUpdateRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter                                  | Type                                                                                                                              | Required             | Description                         |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                                      | [context.Context](https://pkg.go.dev/context#Context)                                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID`                               | `string`                                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `v3IncidentsIncidentPriorityUpdateRequest` | [components.V3IncidentsIncidentPriorityUpdateRequest](/go-sdk/docs/models/components/v3incidentsincidentpriorityupdaterequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                                     | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                                  | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsIncidentPriorityUpdateResponse**](/go-sdk/docs/models/operations/incidentsincidentpriorityupdateresponse.md)**, error**

#### Errors

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

### Reassign

* This endpoint is used to reassign the unresolved incident to any user or escalation policy or squads by ID.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.
* `type` can be either `user` or `escalationpolicy` or `squad`

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.Reassign(ctx, "<id>", components.V3IncidentsReassignIncidentRequest{
        ReassignTo: components.ReassignTo{
            ID: "<id>",
            Type: "<value>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter                            | Type                                                                                                                  | Required             | Description                         |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                                | [context.Context](https://pkg.go.dev/context#Context)                                                                 | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID`                         | `string`                                                                                                              | :heavy\_check\_mark: | N/A                                 |
| `v3IncidentsReassignIncidentRequest` | [components.V3IncidentsReassignIncidentRequest](/go-sdk/docs/models/components/v3incidentsreassignincidentrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                               | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                      | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsReassignIncidentResponse**](/go-sdk/docs/models/operations/incidentsreassignincidentresponse.md)**, error**

#### Errors

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

### Resolve

* This endpoint is used to resolve the incident by ID.
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.
* Resolution Reason is mandatory / optional based on the organization feature settings (Only for Premium and Enterprise Orgs) [Read more](https://support.squadcast.com/incidents-page/incidents-details#understanding-resolution-reason)

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.Resolve(ctx, "<id>", components.V3IncidentsResolveIncidentRequest{
        ResolutionReason: components.ResolutionReason{
            Message: "<value>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter                           | Type                                                                                                                | Required             | Description                         |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                               | [context.Context](https://pkg.go.dev/context#Context)                                                               | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID`                        | `string`                                                                                                            | :heavy\_check\_mark: | N/A                                 |
| `v3IncidentsResolveIncidentRequest` | [components.V3IncidentsResolveIncidentRequest](/go-sdk/docs/models/components/v3incidentsresolveincidentrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                              | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                    | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.IncidentsResolveIncidentResponse**](/go-sdk/docs/models/operations/incidentsresolveincidentresponse.md)**, error**

#### Errors

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

### GetStatusByRequestIds

* This endpoint is used to get the status of incidents given list of request\_ids
* Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.

## Response

* The response contains the mapping from `request_ids` to incident status.
* `status` field can be one of - `suppressed`, `discarded`, `deduplicated`, `created`, `error`.
* status is `error` if the `request_id` is invalid. Both `incident_id` and `event_id` field won't be present if `status` is `error`
* status is `suppressed` if the incident was suppressed due to suppression rules.
* status is `deduplicated` if the incident was deduplicated due to deduplication rules.
* status is `discarded` if the incident was discarded due to some deduplication rule. `incident_id` field won't be present if `status` is `discarded`.
* otherwise, the status is `created`

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.GetStatusByRequestIds(ctx, components.V3IncidentsIngestionStatusRequest{
        RequestIds: []string{
            "<value 1>",
            "<value 2>",
            "<value 3>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter | Type                                                                                                                | Required             | Description                                |
| --------- | ------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                               | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3IncidentsIngestionStatusRequest](/go-sdk/docs/models/components/v3incidentsingestionstatusrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                    | :heavy\_minus\_sign: | The options for this request.              |

#### Response

[**\*operations.IncidentsGetIncidentsStatusByRequestidsResponse**](/go-sdk/docs/models/operations/incidentsgetincidentsstatusbyrequestidsresponse.md)**, error**

#### Errors

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

### GetAllPostmortems

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.GetAllPostmortems(ctx, "<value>", "<value>", "<id>", 221553)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter  | Type                                                             | Required             | Description                         |
| ---------- | ---------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`      | [context.Context](https://pkg.go.dev/context#Context)            | :heavy\_check\_mark: | The context to use for the request. |
| `fromDate` | `string`                                                         | :heavy\_check\_mark: | Provide date in RFC3339 format      |
| `toDate`   | `string`                                                         | :heavy\_check\_mark: | Provide date in RFC3339 format      |
| `ownerID`  | `string`                                                         | :heavy\_check\_mark: | Here owner\_id represents team\_id  |
| `limit`    | `int64`                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`     | \[][operations.Option](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.PostmortemsGetAllPostmortemsResponse**](/go-sdk/docs/models/operations/postmortemsgetallpostmortemsresponse.md)**, error**

#### Errors

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

### MarkAsTransient

Mark as Transient

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.MarkAsTransient(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter    | Type                                                             | Required             | Description                         |
| ------------ | ---------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`        | [context.Context](https://pkg.go.dev/context#Context)            | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `opts`       | \[][operations.Option](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.AptaMarkAsTransientResponse**](/go-sdk/docs/models/operations/aptamarkastransientresponse.md)**, error**

#### Errors

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

### UpdatePostmortem

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

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.UpdatePostmortem(ctx, "<id>", components.V3IncidentsPostmortemsUpdatePostmortemRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter                                       | Type                                                                                                                                        | Required             | Description                         |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                                           | [context.Context](https://pkg.go.dev/context#Context)                                                                                       | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID`                                    | `string`                                                                                                                                    | :heavy\_check\_mark: | N/A                                 |
| `v3IncidentsPostmortemsUpdatePostmortemRequest` | [components.V3IncidentsPostmortemsUpdatePostmortemRequest](/go-sdk/docs/models/components/v3incidentspostmortemsupdatepostmortemrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                                          | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                                            | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.PostmortemsUpdatePostmortemByIncidentResponse**](/go-sdk/docs/models/operations/postmortemsupdatepostmortembyincidentresponse.md)**, error**

#### Errors

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

### UnsnoozeNotifications

Unsnooze Incident Notifications

#### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
    )

    res, err := s.Incidents.UnsnoozeNotifications(ctx, "<id>", components.V3IncidentsSnoozeNotificationsUnsnoozeIncidentRequest{
        ReassignTo: components.V3IncidentsSnoozeNotificationsReassignTo{
            ID: "<id>",
            Type: "<value>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

#### Parameters

| Parameter                                               | Type                                                                                                                                                        | Required             | Description                         |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                                                   | [context.Context](https://pkg.go.dev/context#Context)                                                                                                       | :heavy\_check\_mark: | The context to use for the request. |
| `incidentID`                                            | `string`                                                                                                                                                    | :heavy\_check\_mark: | N/A                                 |
| `v3IncidentsSnoozeNotificationsUnsnoozeIncidentRequest` | [components.V3IncidentsSnoozeNotificationsUnsnoozeIncidentRequest](/go-sdk/docs/models/components/v3incidentssnoozenotificationsunsnoozeincidentrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                                                  | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                                                            | :heavy\_minus\_sign: | The options for this request.       |

#### Response

[**\*operations.SnoozeNotificationsUnsnoozeIncidentNotificationsResponse**](/go-sdk/docs/models/operations/snoozenotificationsunsnoozeincidentnotificationsresponse.md)**, error**

#### Errors

| Error Type                         | Status Code | Content Type     |
| ---------------------------------- | ----------- | ---------------- |
| apierrors.BadRequestError          | 400         | application/json |
| apierrors.UnauthorizedError        | 401         | application/json |
| apierrors.PaymentRequiredError     | 402         | application/json |
| apierrors.ForbiddenError           | 403         | application/json |
| apierrors.NotFoundError            | 404         | application/json |
| apierrors.ConflictError            | 409         | application/json |
| apierrors.UnprocessableEntityError | 422         | application/json |
| apierrors.InternalServerError      | 500         | application/json |
| apierrors.BadGatewayError          | 502         | application/json |
| apierrors.ServiceUnavailableError  | 503         | application/json |
| apierrors.GatewayTimeoutError      | 504         | application/json |
| apierrors.APIError                 | 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/go-sdk/docs/sdks/incidents.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.
