# Add Collection Accounts

Make up to 1,000 of your accounts collection accounts of the omnibus: one per customer.

## Overview

- **`accountIds`**: 1 to 1,000 accounts you created ([Create an Account](https://docs.aureahub.com/docs/account-create.md)), each named once — never a user's default account: `400` `STRUCTURE_ACCOUNT_UNKNOWN`, the unknown ones in `details.accountIds`.
- **The network must be omnibus**: `409` `STRUCTURE_NOT_OMNIBUS` on a segregated one ([Declare a Structure](https://docs.aureahub.com/docs/structures-put.md)).
- An account already a collection account is counted in `already`, and nothing changes for it; the treasury or a pool account answers `409` `STRUCTURE_ACCOUNT_ROLE` (`details.accountId`), and none is added.
- **Its wallet stops sending directly.** From then on, a send from the account's EVM wallet on that network is refused `403` `OMNIBUS_COLLECTION_WALLET` at every route that would send it, and its key is not exported, until the account is removed from the collection ([Account Structures](https://docs.aureahub.com/docs/guide-account-structures.md) › The Sub-Ledger).
- **From when its coins count.** Once the omnibus processing runs (coming), each new collection wallet is opened at a following pass: what it holds then is its customer's claim, and what reaches it later from outside the omnibus is the customer's deposit ([Account Structures](https://docs.aureahub.com/docs/guide-account-structures.md) › The Sub-Ledger).
- `200` with `added` and `already`. 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.members_added` — when at least one was added.

## Endpoint

### `POST /v1/structures/{network}/collection-accounts`

Authentication: bearer token required.

Adds collection accounts to the omnibus of a network.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `network` | string | yes | `mainnet` or `testnet` |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `accountIds` | string[] | yes | 1 to 1,000 account ids, each once |

**Responses**

`200` OK

```json
{
  "added": 2,
  "already": 1
}
```

`400` Not your account

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "Each member is one of the tenant's own accounts (not a user's default account)",
  "details": {
    "code": "STRUCTURE_ACCOUNT_UNKNOWN",
    "accountIds": ["e44c9a66-1370-4484-96ca-738e1d58e599"]
  }
}
```

`409` Segregated

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "The tenant's structure on this network is not omnibus",
  "details": { "code": "STRUCTURE_NOT_OMNIBUS", "network": "mainnet" }
}
```

`409` Role

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "The treasury and pool accounts cannot be collection accounts",
  "details": {
    "code": "STRUCTURE_ACCOUNT_ROLE",
    "accountId": "a9dcb8c6-9bee-4900-b792-cd01bd77820b"
  }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/structures/mainnet/collection-accounts \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "accountIds": ["0a0698c3-18ff-4db3-bd66-f2e0ffbf0a29", "3cb0a94e-6358-445d-99a2-021749a80e0a", "f22d2b25-338e-444c-93ef-71693565f346"] }'
```

---

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