# Change team

{% put /%}
{% path text="/v1/users/changeTeam" /%}

This API allows you to move users from one team to another. You can also set it to either transfer their documents to another user or retain them.

## Code snippet

{% codetab %}

cURL

```shell
curl --location --request PUT 'https://api.boldsign.com/v1/users/changeTeam?userId=d98c14c5-60e0-411f-b02d-b39ca83c0da8' \
--header 'accept: */*' \
--header 'X-API-KEY: {apikey}' \
--header 'Content-Type: application/json' \
--data '{
  "toTeamId": "9bca0986-xxx-xxxx-xxx-30ffe3a2c5b7",
  "transferDocumentsToUserId": "8117b911-xxx-xxxx-xxx-819aab1e2bd5"
}'
```

C#

```csharp
// requires beta version of the SDK at least v4.10.18-beta
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var userClient = new UserClient(apiClient);

var changeTeam = new ChangeTeam()
{
    ToTeamId = "9bca0986-xxx-xxxx-xxx-30ffe3a2c5b7",
    TransferDocumentsToUserId = "8117b911-xxx-xxxx-xxx-819aab1e2bd5"
};

await userClient.ChangeTeam("UserId", changeTeam);
```

Python

```python
import boldsign
from boldsign.models import ChangeTeam

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    change_teams_api = boldsign.UserApi(api_client)
    change_team = boldsign.ChangeTeamRequest(
        to_team_id = "YOUR_TEAM_ID",
    )
    team_details_response = change_teams_api.change_team(
        user_id="YOUR_USER_ID",
        change_team_request= change_team
    )
```

NodeJS

```js
import { UserApi, ChangeTeamRequest} from 'boldsign';

const userApi = new UserApi("https://api.boldsign.com");
userApi.setApiKey("YOUR_API_KEY");

var changeTeam = new ChangeTeamRequest();
changeTeam.toTeamId = "YOUR_TEAM_ID";
userApi.changeTeam("YOUR_USER_ID",changeTeam);
```

PHP

```php
<?php
require_once "vendor/autoload.php";

$config = new BoldSign\Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');
$apiInstance = new BoldSign\Api\UserApi($config);
$changeTeam = new BoldSign\Model\ChangeTeamRequest();
$changeTeam->setToTeamId("YOUR_TEAM_ID");
$apiInstance->changeTeam("YOUR_USER_ID",$changeTeam);
```

Java

```java
ApiClient apiClient = Configuration.getDefaultApiClient();
apiClient.setBasePath("https://api.boldsign.com");
apiClient.setApiKey("YOUR_API_KEY");
UserApi userApi = new UserApi(apiClient);
ChangeTeamRequest changeTeamRequest = new ChangeTeamRequest();
changeTeamRequest.setToTeamId("YOUR_TEAM_ID");
userApi.changeTeam("YOUR_USER_ID", changeTeamRequest);
```

{% /codetab %}

## Query parameters

{% nestedtable %}

- {% arguments name="userId" /%}{% batch datatype="String" /%}{% required /%}
- The User ID of the user. It can be obtained from users and teams from the web app.

{% /nestedtable %}

## Request body

{% nestedtable %}

- {% arguments name="ToTeamId" /%}{% batch datatype="string" /%}{% required /%}
- The team ID to which the user is transferred.

---

- {% arguments name="TransferDocumentsToUserId" /%}{% batch datatype="string" /%}
- The target user ID to which the user can transfer documents while changing the team.

  **Note:**
    1. If a document is currently in-progress then the document will be declined or revoked.

    2. All sender identity approvals for the deleted user will be revoked, and the reassigned user will need to obtain approval again from those sender identities to access the on-behalf documents.

{% /nestedtable %}

## Example response

***200 Success***
