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

# Slos

## Overview

### Available Operations

* [list](#list) - Get All SLOs
* [create](#create) - Create SLO
* [update](#update) - Update SLO
* [remove](#remove) - Remove SLO
* [getById](#getbyid) - Get SLO By ID
* [markFalsePositive](#markfalsepositive) - Mark SLO False Positive

## list

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

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.list({
    ownerId: "<id>",
    offset: "<value>",
    limit: "<value>",
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosList } from "@solarwinds/squadcast-sdk-typescript/funcs/slosList.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosList(squadcastSDK, {
    ownerId: "<id>",
    offset: "<value>",
    limit: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosList failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                           | Required             | Description                                                                                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SLOGetAllSLOsRequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/slogetallslosrequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                                 | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                        | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                                      | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

**Promise<**[**operations.SLOGetAllSLOsResponse**](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/slogetallslosresponse.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 API will create SLO. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.create({
    name: "<value>",
    timeIntervalType: "rolling",
    serviceIds: [
      "<value 1>",
    ],
    slis: [],
    targetSlo: 6924.37,
    startTime: new Date("2023-06-03T10:41:05.981Z"),
    endTime: new Date("2023-11-20T07:09:22.422Z"),
    durationInDays: 574042,
    ownerType: "<value>",
    ownerId: "<id>",
    sloOwnerId: "<id>",
    sloOwnerType: "squad",
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosCreate } from "@solarwinds/squadcast-sdk-typescript/funcs/slosCreate.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosCreate(squadcastSDK, {
    name: "<value>",
    timeIntervalType: "rolling",
    serviceIds: [
      "<value 1>",
    ],
    slis: [],
    targetSlo: 6924.37,
    startTime: new Date("2023-06-03T10:41:05.981Z"),
    endTime: new Date("2023-11-20T07:09:22.422Z"),
    durationInDays: 574042,
    ownerType: "<value>",
    ownerId: "<id>",
    sloOwnerId: "<id>",
    sloOwnerType: "squad",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosCreate failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                              | Required             | Description                                                                                                                                                                    |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [models.V3SLOCreateSLORequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/v3slocreateslorequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                    | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                           | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                         | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

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

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

### Example Usage

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.update({
    sloID: 16112,
    ownerId: "<id>",
    v3SLOCreateSLORequest: {
      name: "<value>",
      timeIntervalType: "rolling",
      serviceIds: [
        "<value 1>",
        "<value 2>",
        "<value 3>",
      ],
      slis: [
        "<value 1>",
      ],
      targetSlo: 2464.03,
      startTime: new Date("2025-10-31T03:29:37.701Z"),
      endTime: new Date("2024-03-30T19:04:36.297Z"),
      durationInDays: 271064,
      ownerType: "<value>",
      ownerId: "<id>",
      sloOwnerId: "<id>",
      sloOwnerType: "user",
    },
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosUpdate } from "@solarwinds/squadcast-sdk-typescript/funcs/slosUpdate.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosUpdate(squadcastSDK, {
    sloID: 16112,
    ownerId: "<id>",
    v3SLOCreateSLORequest: {
      name: "<value>",
      timeIntervalType: "rolling",
      serviceIds: [
        "<value 1>",
        "<value 2>",
        "<value 3>",
      ],
      slis: [
        "<value 1>",
      ],
      targetSlo: 2464.03,
      startTime: new Date("2025-10-31T03:29:37.701Z"),
      endTime: new Date("2024-03-30T19:04:36.297Z"),
      durationInDays: 271064,
      ownerType: "<value>",
      ownerId: "<id>",
      sloOwnerId: "<id>",
      sloOwnerType: "user",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosUpdate failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                         | Required             | Description                                                                                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SLOUpdateSLORequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/sloupdateslorequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                               | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                      | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                                    | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

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

## 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

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.remove({
    sloID: 938544,
    ownerId: "<id>",
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosRemove } from "@solarwinds/squadcast-sdk-typescript/funcs/slosRemove.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosRemove(squadcastSDK, {
    sloID: 938544,
    ownerId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosRemove failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                         | Required             | Description                                                                                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SLORemoveSLORequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/sloremoveslorequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                               | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                      | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                                    | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

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

## 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

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.getById({
    sloID: 586718,
    ownerId: "<id>",
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosGetById } from "@solarwinds/squadcast-sdk-typescript/funcs/slosGetById.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosGetById(squadcastSDK, {
    sloID: 586718,
    ownerId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosGetById failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                           | Required             | Description                                                                                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SLOGetSLOByIdRequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/slogetslobyidrequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                                 | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                        | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                                      | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

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

## markFalsePositive

Value is a boolean (true or false)

### Example Usage

```typescript
import { SquadcastSDK } from "@solarwinds/squadcast-sdk-typescript";

const squadcastSDK = new SquadcastSDK({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const result = await squadcastSDK.slos.markFalsePositive({
    sloID: 825843,
    incidentID: 505067,
    value: true,
    ownerId: "<id>",
    requestBody: {},
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { slosMarkFalsePositive } from "@solarwinds/squadcast-sdk-typescript/funcs/slosMarkFalsePositive.js";

// Use `SquadcastSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const squadcastSDK = new SquadcastSDKCore({
  refreshTokenAuth: "<YOUR_REFRESH_TOKEN_AUTH_HERE>",
});

async function run() {
  const res = await slosMarkFalsePositive(squadcastSDK, {
    sloID: 825843,
    incidentID: 505067,
    value: true,
    ownerId: "<id>",
    requestBody: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("slosMarkFalsePositive failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                                               | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SLOMarkSLOFalsePositiveRequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/slomarkslofalsepositiverequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                                                     | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                            | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://developers.incidents.cloud.solarwinds.com/typescript/docs/lib/utils/retryconfig.md)                                                          | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

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