# Teams.Members

## Overview

### Available Operations

* [list](#list) - Get All Team Members
* [add](#add) - Add Team Member

## list

Returns all the team members of the organization. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.teams.members.list(team_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter | Type                                                                          | Required             | Description                                                         |
| --------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `team_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries` | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

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

## add

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

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.teams.members.add(team_id="<id>", user_id="<id>", role_ids=[])

    # Handle response
    print(res)

```

### Parameters

| Parameter  | Type                                                                          | Required             | Description                                                         |
| ---------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `team_id`  | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `user_id`  | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `role_ids` | List\[*str*]                                                                  | :heavy\_check\_mark: | this field is required if you are using RBAC permission model       |
| `role`     | *Optional\[str]*                                                              | :heavy\_minus\_sign: | this field is required if you are using OBAC permission model       |
| `retries`  | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.TeamsAddTeamMemberResponse**](/python-sdk/docs/models/teamsaddteammemberresponse.md)

### Errors

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


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/teamsmembers.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.
