> 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/go-sdk/docs/sdks/slos.md).

# Slos

## Overview

### Available Operations

* [ListAll](#listall) - Get All SLOs
* [Create](#create) - Create SLO
* [Update](#update) - Update SLO
* [Remove](#remove) - Remove SLO
* [GetByID](#getbyid) - Get SLO By ID
* [MarkAffected](#markaffected) - Mark SLO Affected
* [MarkFalsePositive](#markfalsepositive) - Mark SLO False Positive

## ListAll

Returns all the SLOs of the passed owner\_id in the params. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### 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.Slos.ListAll(ctx, "<id>", "<value>", "<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. |
| `ownerID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `offset`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `limit`   | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.SLOGetAllSLOsResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slogetallslosresponse.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    | \*/\*            |

## Create

* This API will create SLO. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### 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.Slos.Create(ctx, components.V3SLOCreateSLORequest{
        Name: "<value>",
        TimeIntervalType: components.V3SLOTimeIntervalTypeRolling,
        ServiceIds: []string{
            "<value 1>",
        },
        Slis: []string{},
        TargetSlo: 6924.37,
        StartTime: types.MustTimeFromString("2023-06-03T10:41:05.981Z"),
        EndTime: types.MustTimeFromString("2023-11-20T07:09:22.422Z"),
        DurationInDays: 574042,
        OwnerType: "<value>",
        OwnerID: "<id>",
        SloOwnerID: "<id>",
        SloOwnerType: components.V3SLOSLOOwnerTypeSquad,
    })
    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.V3SLOCreateSLORequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3slocreateslorequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                            | :heavy\_minus\_sign: | The options for this request.              |

### Response

[**\*operations.SLOCreateSLOResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slocreatesloresponse.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    | \*/\*            |

## Update

* This API will update SLO. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### 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.Slos.Update(ctx, 16112, "<id>", components.V3SLOCreateSLORequest{
        Name: "<value>",
        TimeIntervalType: components.V3SLOTimeIntervalTypeRolling,
        ServiceIds: []string{
            "<value 1>",
            "<value 2>",
            "<value 3>",
        },
        Slis: []string{
            "<value 1>",
        },
        TargetSlo: 2464.03,
        StartTime: types.MustTimeFromString("2025-10-31T03:29:37.701Z"),
        EndTime: types.MustTimeFromString("2024-03-30T19:04:36.297Z"),
        DurationInDays: 271064,
        OwnerType: "<value>",
        OwnerID: "<id>",
        SloOwnerID: "<id>",
        SloOwnerType: components.V3SLOSLOOwnerTypeUser,
    })
    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. |
| `sloID`                 | `int64`                                                                                                                                      | :heavy\_check\_mark: | N/A                                 |
| `ownerID`               | `string`                                                                                                                                     | :heavy\_check\_mark: | N/A                                 |
| `v3SLOCreateSLORequest` | [components.V3SLOCreateSLORequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3slocreateslorequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                  | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                            | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.SLOUpdateSLOResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/sloupdatesloresponse.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    | \*/\*            |

## Remove

Remove SLO from passed owner\_id (team\_id) in the params . Upon sccess the slo will be removed. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### 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.Slos.Remove(ctx, 938544, "<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. |
| `sloID`   | `int64`                                                                                                           | :heavy\_check\_mark: | N/A                                 |
| `ownerID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.SLORemoveSLOResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/sloremovesloresponse.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

Returns a SLO details of the given `sloID` in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### 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.Slos.GetByID(ctx, 586718, "<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. |
| `sloID`   | `int64`                                                                                                           | :heavy\_check\_mark: | N/A                                 |
| `ownerID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.SLOGetSLOByIDResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slogetslobyidresponse.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    | \*/\*            |

## MarkAffected

This endpoint is used for mark slo affected.

Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### 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.Slos.MarkAffected(ctx, 294670, "<id>", components.V3SLOMarkSLOAffectedRequest{
        IncidentID: "<id>",
        Slis: []string{
            "<value 1>",
            "<value 2>",
        },
        ErrorBudgetSpent: 3480.26,
        OwnerType: "<value>",
        OwnerID: "<id>",
        OrgID: "<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. |
| `sloID`                       | `int64`                                                                                                                                                  | :heavy\_check\_mark: | N/A                                 |
| `ownerID`                     | `string`                                                                                                                                                 | :heavy\_check\_mark: | N/A                                 |
| `v3SLOMarkSLOAffectedRequest` | [components.V3SLOMarkSLOAffectedRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3slomarksloaffectedrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                        | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                        | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.SLOMarkSLOAffectedResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slomarksloaffectedresponse.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    | \*/\*            |

## MarkFalsePositive

Value is a boolean (true or false)

### Example Usage

```go
package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"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.Slos.MarkFalsePositive(ctx, operations.SLOMarkSLOFalsePositiveRequest{
        SloID: 825843,
        IncidentID: 505067,
        Value: true,
        OwnerID: "<id>",
        RequestBody: operations.SLOMarkSLOFalsePositiveRequestBody{},
    })
    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` | [operations.SLOMarkSLOFalsePositiveRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slomarkslofalsepositiverequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                              | :heavy\_minus\_sign: | The options for this request.              |

### Response

[**\*operations.SLOMarkSLOFalsePositiveResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/slomarkslofalsepositiveresponse.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    | \*/\*            |
