# Remove Account from Group

Detaches an account from an account group. The account is not deleted or disabled — it becomes a standalone account of your organization and can be attached to another group later. A group must always keep at least one account, so the last account cannot be removed this way — move it into another group or delete the account instead.

**DELETE** `/organizations/account-groups/{account_group_id}/accounts/{account_id}`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Detaches an account from an account group. The account itself is not deleted or disabled: it keeps its users, permissions and configuration and becomes a standalone account of the organization, so it can be attached to another group later with Create Account. A group must always keep at least one account, so the last account of a group cannot be removed this way: move it into another group (with `account_codes` on Create Account Group) or delete the account instead.

## Authorization

- PUBLIC-API-KEY (apiKey in header)
- PRIVATE-SECRET-KEY (apiKey in header)

## Path parameters

- `account_group_id` (string, required)
  Account group UUID.
- `account_id` (string, required)
  UUID of the account to detach. It must currently belong to this group.

## Responses

### 204

No Content — the account was detached from the group.

### 400

Bad Request — `LAST_ACCOUNT_IN_GROUP`: the account is the only one left in the group. A group must contain at least one account.

- `code` (string)
  Machine-readable error code.
- `messages` (string[])
  Human-readable details.

Example:

```json
{
  "code": "string",
  "messages": [
    "string"
  ]
}
```

### 404

Not Found — no such account group in this organization, or the account is not a member of this group.