# Declare a Network's Account Structure

Make a network omnibus — with its treasury, its pool, the pool's rule and your funding addresses — or bring it back to segregated.

## Overview

- **`omnibus`**: `treasuryAccountId` is required the first time — `400` `STRUCTURE_TREASURY_REQUIRED` otherwise. A field left out keeps what the network has: the treasury, the pool, the rule (`priority` the first time), the funding addresses.
- **The members are accounts you created** ([Create an Account](https://docs.aureahub.com/docs/account-create.md)), never a user's default account: `400` `STRUCTURE_ACCOUNT_UNKNOWN`, the unknown ones in `details.accountIds`. One role each: a collection account named as the treasury or in the pool answers `409` `STRUCTURE_ACCOUNT_ROLE` (`details.accountId`).
- **`poolAccountIds`** is the whole pool, in order — up to 50, each named once; the treasury may be in it, and pays withdrawals only then. The list replaces the pool.
- **A replaced treasury stays** as a pool account, at the end of the pool unless you list it. A pool account already in the sub-ledger stays in the pool: leaving it out answers `409` `STRUCTURE_ACCOUNT_OPENED`.
- **`fundingAddresses`**: up to 20 of your own EVM addresses (`0x` and 40 hex digits, any case; kept in lower case, each once). What they send to a collection wallet is the house's, never the customer's. `[]` clears them.
- **`segregated`**: the body is `{ "structure": "segregated" }` alone — anything else with it answers `400` `STRUCTURE_REQUEST_INVALID` (`A segregated structure has no treasury, pool or funding addresses`). From omnibus, only with no customer's claim and no transfer on its way: `409` `STRUCTURE_LEDGER_NOT_EMPTY` otherwise. The network's members and sweep policies are then removed; its entries and transfers stay.
- `200` with the network's structure, as [Get a Structure](https://docs.aureahub.com/docs/structures-get.md) answers it. Declaring works today; the omnibus's processing — sweeps, the sub-ledger, withdrawals — is coming ([Account Structures](https://docs.aureahub.com/docs/guide-account-structures.md)).
- 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.changed`.

## Endpoint

### `PUT /v1/structures/{network}`

Authentication: bearer token required.

Declares the network's structure: segregated, or omnibus with its treasury and pool.

**Path parameters**

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

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `structure` | string | yes | `segregated` or `omnibus` |
| `treasuryAccountId` | string (uuid) | no | The treasury: where sweeps go. Required the first time the network is made omnibus |
| `poolAccountIds` | string[] | no | The pool's account ids, in order: the whole list, up to 50. The treasury may be one |
| `poolRule` | string | no | `priority` or `largest_balance` |
| `fundingAddresses` | string[] | no | Your own EVM addresses, up to 20: what they send to a collection wallet is the house's |

**Responses**

`200` Omnibus

```json
{
  "network": "mainnet",
  "structure": "omnibus",
  "poolRule": "priority",
  "fundingAddresses": ["0x661edf1a2bd8d4826b91cc9089e1044ccd556bad"],
  "treasuryAccountId": "3e3f3321-a179-423c-b4fb-8a4fe6bc5756",
  "pool": [
    { "accountId": "a9dcb8c6-9bee-4900-b792-cd01bd77820b", "position": 0, "isTreasury": false },
    { "accountId": "3e3f3321-a179-423c-b4fb-8a4fe6bc5756", "position": 1, "isTreasury": true }
  ],
  "collectionAccounts": 0,
  "sweepPolicies": [],
  "jobOn": false,
  "updatedBy": "454bda73-ba10-4bac-9e62-e28e4e575007",
  "updatedAt": "2026-10-13T09:12:40.511Z"
}
```

`200` Segregated

```json
{
  "network": "mainnet",
  "structure": "segregated",
  "poolRule": "priority",
  "fundingAddresses": [],
  "treasuryAccountId": null,
  "pool": [],
  "collectionAccounts": 0,
  "sweepPolicies": [],
  "jobOn": false,
  "updatedBy": "454bda73-ba10-4bac-9e62-e28e4e575007",
  "updatedAt": "2026-10-14T08:03:55.207Z"
}
```

`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"]
  }
}
```

`400` No treasury

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "An omnibus structure names its treasury account",
  "details": { "code": "STRUCTURE_TREASURY_REQUIRED" }
}
```

`409` Role

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "A collection account cannot be the treasury or in the pool",
  "details": {
    "code": "STRUCTURE_ACCOUNT_ROLE",
    "accountId": "3cb0a94e-6358-445d-99a2-021749a80e0a"
  }
}
```

`409` Claims held

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "The omnibus still holds customers' claims or transfers on their way",
  "details": {
    "code": "STRUCTURE_LEDGER_NOT_EMPTY",
    "claims": true,
    "openTransfers": 1
  }
}
```

**Example request**

```bash
curl -X PUT https://api.aureahub.com/v1/structures/mainnet \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "structure": "omnibus",
    "treasuryAccountId": "3e3f3321-a179-423c-b4fb-8a4fe6bc5756",
    "poolAccountIds": ["a9dcb8c6-9bee-4900-b792-cd01bd77820b", "3e3f3321-a179-423c-b4fb-8a4fe6bc5756"],
    "poolRule": "priority",
    "fundingAddresses": ["0x661edf1a2bd8d4826b91cc9089e1044ccd556bad"]
  }'
```

---

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