# Remove a Collection Account

Take a customer's account out of the omnibus, once the omnibus owes them nothing.

## Overview

- **Only with no claim of its customer** on any asset of the network — `409` `STRUCTURE_ACCOUNT_HOLDS_CLAIMS` — **and no transfer of it on its way** — `409` `STRUCTURE_ACCOUNT_BUSY`. Pay the claim out with a [pool withdrawal](https://docs.aureahub.com/docs/structures-withdrawal-create.md) first.
- An account that is not a collection account of the network — the treasury, a pool account, another network's — answers `404` `STRUCTURE_NOT_FOUND` (`No such collection account here.`).
- `204`, no body. Its entries and transfers stay, as history; the account itself is not changed.
- For `owner`, `tenantadmin` and `non_signing_admin`, on their own tenant, with an access token. Written to your audit trail [Coming soon, upon request](https://docs.aureahub.com/docs/feature-availability.md), as `structure.member_removed`.

## Endpoint

### `DELETE /v1/structures/{network}/collection-accounts/{accountId}`

Authentication: bearer token required.

Removes a collection account from the omnibus of a network.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `network` | string | yes | `mainnet` or `testnet` |
| `accountId` | string (uuid) | yes | The collection account |

**Responses**

`204` No Content

`404` Not found

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "No such collection account here.",
  "details": { "code": "STRUCTURE_NOT_FOUND" }
}
```

`409` Claim held

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "The customer still holds a claim on the omnibus",
  "details": { "code": "STRUCTURE_ACCOUNT_HOLDS_CLAIMS" }
}
```

`409` On its way

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "A transfer of this account is on its way",
  "details": { "code": "STRUCTURE_ACCOUNT_BUSY" }
}
```

**Example request**

```bash
curl -X DELETE https://api.aureahub.com/v1/structures/mainnet/collection-accounts/0a0698c3-18ff-4db3-bd66-f2e0ffbf0a29 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

---

Web version: https://docs.aureahub.com/#structures-collection-remove
