> 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/squadsv4.md).

# SquadsV4

## Overview

### Available Operations

* [getById](#getbyid) - Get Squad By ID
* [update](#update) - Update Squad

## getById

This endpoint is used to get the squads details by id. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `squad-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.squadsV4.getById({
    squadID: "<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 { squadsV4GetById } from "@solarwinds/squadcast-sdk-typescript/funcs/squadsV4GetById.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 squadsV4GetById(squadcastSDK, {
    squadID: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("squadsV4GetById failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                                     | Required             | Description                                                                                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SquadsGetSquadByIdRequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/squadsgetsquadbyidrequest.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.SquadsGetSquadByIdResponse**](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/squadsgetsquadbyidresponse.md)**>**

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## update

This endpoint is used to update squad.

The role will be considered only if your organization is on the OBAC permission model; otherwise, the role field will be ignored, and only the member will be added to the squad. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `squad-create` 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.squadsV4.update({
    squadID: "<id>",
    v4SquadsUpdateSquadRequest: {},
  });

  console.log(result);
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { SquadcastSDKCore } from "@solarwinds/squadcast-sdk-typescript/core.js";
import { squadsV4Update } from "@solarwinds/squadcast-sdk-typescript/funcs/squadsV4Update.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 squadsV4Update(squadcastSDK, {
    squadID: "<id>",
    v4SquadsUpdateSquadRequest: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("squadsV4Update failed:", res.error);
  }
}

run();
```

### Parameters

| Parameter              | Type                                                                                                                                                   | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.SquadsUpdateSquadRequest](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/squadsupdatesquadrequest.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.SquadsUpdateSquadResponse**](https://developers.incidents.cloud.solarwinds.com/typescript/docs/models/operations/squadsupdatesquadresponse.md)**>**

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |
