# Move user groups

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

Batch move user groups 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 invites settings restricted to org unit members, group members who are non-org
unit members will be removed when the user groups 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:** [`enterprise.groups:manage`](https://airtable.com/developers/web/api/scopes.md#enterprise-groups-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.

- `groupIds: array<string>` — required

  ID of the groups to be moved. Up to 100 groupIds can be provided.

## Response format

- `errors: array<object>` — required

  - `id: string` — required

    A user group ID

  - `type: string` — required

  - `message: string` — required

- `movedGroups: array<object>` — required

  - `id: string` — required

    A user group ID

  - `removedUserIds: array<string>` — optional

    A list of group members removed from the group as part of the move.
    Only returned when the target enterprise account has the invites settings restricted to org unit members.

### Example — Success response

```sh
curl -X POST "https://api.airtable.com/v0/meta/enterpriseAccounts/{enterpriseAccountId}/moveGroups" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "groupIds": [
      "ugp1mKGb3KXUyQfOZ",
      "ugp1mKGb3KXUyQfOZ",
      "ugpR8ZT9KtIgp8Bh3",
      "ugp1UdbspZKMrIOjk"
    ],
    "targetEnterpriseAccountId": "entUBq2RGdihxl3vU"
  }'
```

```json
{
  "errors": [
    {
      "id": "ugp1mKGb3KXUyQfOZ",
      "message": "Duplicate group",
      "type": "DUPLICATE"
    },
    {
      "id": "ugpR8ZT9KtIgp8Bh3",
      "message": "Group not found",
      "type": "NOT_FOUND"
    },
    {
      "id": "ugp1UdbspZKMrIOjk",
      "message": "Group is not managed by the enterprise account",
      "type": "INVALID_PERMISSIONS"
    }
  ],
  "movedGroups": [
    {
      "id": "ugp1mKGb3KXUyQfOZ"
    }
  ]
}
```
