# Create Accounts in Bulk

Up to 10,000 accounts in one request, each with your reference for its customer, and optionally a wallet on each chain you list.

## Overview

- `accounts`: 1 to 10,000, each with a `customerRefId` (required) and optionally `name`, `tags`, `hidden` and `users`, as in [Create an Account](https://docs.aureahub.com/docs/account-create.md).
- `wallets` (optional): up to 20 `{ "chain", "isTestnet" }` made for every account, in the order listed — every EVM chain named is the account's one EVM key, made on chain `evm`; a family named twice is one wallet. They need a custodial tenant and an owner on every account.
- **Checked whole first**: `400` `ACCOUNTS_BULK_DUPLICATE_REF` (`A customerRefId is named twice.`, up to 20 in `details.customerRefIds`); with `wallets`, `409` `ACCOUNT_WALLET_BY_CLIENT`, `400` `ACCOUNT_CHAIN_UNKNOWN` and `400` `ACCOUNT_OWNER_REQUIRED` (`Every account needs an owner to hold wallets: a wallet is its owner's.`, up to 20 places in `details.indexes`); `400` `ACCOUNT_USER_UNKNOWN`; `400` `ACCOUNT_REQUEST_INVALID`. Nothing is stored.
- **`202` with the job.** The accounts are made in the background, each job in the order of its request. An account whose `customerRefId` your tenant already has is skipped, so the same request sent again makes nothing twice. Follow it with [Bulk Creation Report](https://docs.aureahub.com/docs/accounts-bulk-get.md).
- The body may be up to 6 MiB. For `owner`, `tenantadmin` and `non_signing_admin`, on their own tenant. More: [Accounts](https://docs.aureahub.com/docs/guide-accounts.md).

## Endpoint

### `POST /v1/accounts/bulk`

Authentication: bearer token required.

Queues the creation of up to 10,000 accounts.

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `accounts` | object[] | yes | 1–10,000: `{ customerRefId, name?, tags?, hidden?, users? }` |
| `wallets` | object[] | no | Up to 20 `{ chain, isTestnet? }` made for every account |

**Responses**

`503` Switched off

```json
{
  "statusCode": 503,
  "error": "ServiceUnavailableError",
  "message": "Bulk creation of accounts is switched off.",
  "details": { "code": "ACCOUNTS_BULK_OFF" }
}
```

`202` Queued

```json
{
  "jobId": "c41e8a7d-3b2f-4d96-a05e-9f7b1c3d5e82",
  "status": "queued",
  "total": 2
}
```

`400` Duplicate

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "A customerRefId is named twice.",
  "details": { "code": "ACCOUNTS_BULK_DUPLICATE_REF", "customerRefIds": ["cust-00042"] }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/accounts/bulk \
  -H "Authorization: Bearer $TENANT_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "accounts": [
      { "customerRefId": "cust-00043", "users": [{ "userId": "5d2c1b0a-9e8f-4a7b-8c6d-5e4f3a2b1c0d", "access": "owner" }] },
      { "customerRefId": "cust-00044", "users": [{ "userId": "5d2c1b0a-9e8f-4a7b-8c6d-5e4f3a2b1c0d", "access": "owner" }] }
    ],
    "wallets": [{ "chain": "base" }, { "chain": "solana" }]
  }'
```

---

Web version: https://docs.aureahub.com/#accounts-bulk-create
