> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Moving teams between subtenants

> Move a team and all of its associated entities (users, transactions, etc.) to a different subtenant

This endpoint allows you to move teams (both consumer and corporate) between subtenants along with all their associated data including users, transactions, cards, and other related entities.

<Warning>
  Moving teams from a Partner-Managed tenant to a Rain-Managed tenant is not supported yet.
</Warning>

<Warning>
  In cases where the team being moved has many related entities (e.g., transactions), the request may take several seconds to complete.
</Warning>

## Consumer teams

To move a consumer user to a different subtenant, use the **update consumer user subtenant** endpoint. You can only move a consumer team to a tenant who is authorized to serve consumer teams.

### HTTP Method and URL

```
PUT /v1/issuing/users/{userId}/subtenant
```

### Request Parameters

| Parameter     | Type   | Required | Description                                                                                     |
| ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------- |
| `subtenantId` | string | Yes      | The target subtenant ID to which the user will be moved along with all of its related entities. |

### Request Example

```bash theme={null}
curl --request PUT \
  --url https://api.rain.xyz/v1/issuing/users/{userId}/subtenant \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "subtenantId": "target-subtenant-uuid"
  }'
```

<Info>
  This endpoint is only available for users belonging to a consumer team.
</Info>

#### Success Response (204 No Content)

A successful request returns a 204 No Content response with no body.

#### Error Responses

| Status Code | Description                                              |
| ----------- | -------------------------------------------------------- |
| 400         | Bad Request - Invalid parameters or user cannot be moved |
| 404         | Not Found - User or subtenant not found                  |
| 403         | Forbidden - Subtenant not authorized for consumer teams  |
| 500         | Internal Server Error                                    |

***

## Corporate teams

To move a corporate team to a different subtenant, use the **update corporate team subtenant** endpoint. You can only move a corporate team to a tenant who is authorized to serve corporate teams.

<Note>
  All users belonging to the team will be moved to the new subtenant.
</Note>

### HTTP Method and URL

```
PUT /v1/issuing/companies/{companyId}/subtenant
```

### Request Parameters

| Parameter     | Type   | Required | Description                                                                                     |
| ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------- |
| `subtenantId` | string | Yes      | The target subtenant ID to which the team will be moved along with all of its related entities. |

### Request Example

```bash theme={null}
curl --request PUT \
  --url https://api.rain.xyz/v1/issuing/companies/{companyId}/subtenant \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "subtenantId": "target-subtenant-uuid"
  }'
```

<Info>
  This endpoint is only available for corporate teams.
</Info>

#### Success Response (204 No Content)

A successful request returns a 204 No Content response with no body.

#### Error Responses

| Status Code | Description                                              |
| ----------- | -------------------------------------------------------- |
| 400         | Bad Request - Invalid parameters or team cannot be moved |
| 404         | Not Found - Company or subtenant not found               |
| 403         | Forbidden - Subtenant not authorized for corporate teams |
| 500         | Internal Server Error                                    |
