# Delete Account Group

Deletes an account group. The group must be empty: a group that still has accounts (`GROUP_HAS_ACCOUNTS`) or sub-groups (`GROUP_HAS_SUBGROUPS`) is rejected with `400`. Move or [remove its accounts](/reference/organizations/remove-account-from-group) and move or delete its sub-groups first. Accounts are never reassigned automatically.

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

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

Deletes an account group. A group can only be deleted once it is empty: remove, move or delete its accounts first (see Remove Account from Group) and move or delete its sub-groups. Accounts are never reassigned automatically.

## Authorization

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

## Path parameters

- `account_group_id` (string, required)
  Account group UUID.

## Responses

### 204

No Content — the group was deleted.

### 400

Bad Request. The `code` field tells the reason:

- `GROUP_HAS_ACCOUNTS` — the group still has accounts. Remove them from the group first.
- `GROUP_HAS_SUBGROUPS` — the group still has sub-groups. Move them to another parent (or detach them with Update Account Group) or delete them first.

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

Example:

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

### 404

Not Found — no account group with that `account_group_id` in this organization.