# Move workspaces

`POST https://api.airtable.com/v0/meta/enterpriseAccounts/{enterpriseAccountId}/moveWorkspaces`

Batch move workspaces between two enterprise accounts belonging to the same organization.

This endpoint can only be used if your enterprise account has the Enterprise Hub feature enabled.

If the target enterprise account has the invite settings restricted to org unit members, all non-org unit member
collaborators will be removed when the workspaces are moved.

For more information about invites settings, please see [our support article](https://support.airtable.com/docs/settings-airtable-admin-panel#sharing-and-data-in-the-admin-panel).

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`workspacesAndBases:manage`](https://airtable.com/developers/web/api/scopes.md#workspaces-and-bases-manage)
- **User role:** Enterprise admin
- **Billing plans:** Enterprise (pre-2023.08 legacy plan), Enterprise Scale

## Path parameters

- `enterpriseAccountId: string`

## Request body

- `targetEnterpriseAccountId: string` — required

  ID of the target enterprise account of the move. The target enterprise account must be in the same Hub-enabled
  organization as the source enterprise account, and you must have admin rights over the target enterprise account.

- `replacementOwnerId: string` — optional

  If the target enterprise account has the invites settings restricted to org unit members, all non-member
  collaborators will be removed when the workspace are moved. If any workspace only has non-member owners, you must specify
  a replacementOwnerId to be added as the new owner of such workspaces. If no workspace has only non-member owners, replaceOwnerId
  is optional and will be ignored if provided.

- `workspaceIds: array<string>` — required

  ID of the workspaces to be moved. Up to 100 workspaceIds can be provided.

## Response format

- `errors: array<object>` — required

  - `id: string` — required

  - `type: string` — required

  - `message: string` — required

- `movedWorkspaces: array<object>` — required

  - `id: string` — required

### Example — Success response

```sh
curl -X POST "https://api.airtable.com/v0/meta/enterpriseAccounts/{enterpriseAccountId}/moveWorkspaces" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "targetEnterpriseAccountId": "entUBq2RGdihxl3vU",
    "workspaceIds": [
      "wspmhESAta6clCCwF",
      "wspHvvm4dAktsStZH",
      "wspHvvm4dAktsStZH",
      "wspgAeR3b03M3tSSy",
      "wsp4mAKZgXB0vBqU2"
    ]
  }'
```

```json
{
  "errors": [
    {
      "id": "wspmhESAta6clCCwF",
      "message": "Workspace not found",
      "type": "NOT_FOUND"
    },
    {
      "id": "wspHvvm4dAktsStZH",
      "message": "Duplicate workspace",
      "type": "DUPLICATE"
    },
    {
      "id": "wsp4mAKZgXB0vBqU2",
      "message": "Workspace is not managed by the enterprise account",
      "type": "INVALID_PERMISSIONS"
    }
  ],
  "movedWorkspaces": [
    {
      "id": "wspHvvm4dAktsStZH"
    },
    {
      "id": "wspgAeR3b03M3tSSy"
    }
  ]
}
```
