---
title: "Create a bucket"
method: POST
path: "/buckets"
tags: ["Buckets"]
---

# Create a bucket

`POST /buckets`

## Request

- Base URL: `https://sochain.com/api/v3`
- URL: `https://sochain.com/api/v3/buckets`
- Auth: API key in header `API-KEY`

One network per bucket; the name is yours.

## Request body

- BucketCreate
  - `name` string, required: Letters, numbers, - and _, up to 64 characters. Unique within your account.
  - `network` 'BTC' | 'LTC' | 'DOGE' | 'ZEC' | 'BTCTEST' | 'LTCTEST' | 'DOGETEST' | 'ZECTEST', required

## Response `200`

Success.

- object
  - `status` 'success', required
  - `data` Bucket, required
    - `wallet` Wallet: Only for a bucket filled from a wallet's public key (POST /buckets/{bucket}/xpub). The public key itself is never kept.
      - `fingerprint` string
      - `type` 'p2pkh' | 'p2sh-p2wpkh' | 'p2wpkh' | 'p2tr'
      - `receive` WalletChain
        - `used_through` integer, nullable: The highest used index at the last fill.
        - `next` integer: The first index not in the bucket.
        - `spare` integer: Spare (unused) addresses after the last used, at the last fill.
        - `spare_left` integer, nullable: Of those, how many are still unused after the last one used since. Null if it can't be checked just now.
      - `change` WalletChain
        - `used_through` integer, nullable: The highest used index at the last fill.
        - `next` integer: The first index not in the bucket.
        - `spare` integer: Spare (unused) addresses after the last used, at the last fill.
        - `spare_left` integer, nullable: Of those, how many are still unused after the last one used since. Null if it can't be checked just now.
      - `running_low` boolean, nullable: True once more than half of a chain's spare addresses are used: send the public key again. Null if it can't be checked just now.
      - `updated_at` integer: When the bucket was last filled from the public key (unix time).
    - `bucket` string, required: Letters, numbers, - and _, up to 64 characters. Unique within your account.
    - `network` 'BTC' | 'LTC' | 'DOGE' | 'ZEC' | 'BTCTEST' | 'LTCTEST' | 'DOGETEST' | 'ZECTEST', required
    - `num_addresses` integer, required
    - `version` integer, required: Changes whenever membership does.
    - `created` integer: When it was made (Unix time).
    - `modified` integer: When it last changed (Unix time).

## Other responses

- `400`: A bad parameter or body; the message says which.
- `401`: An invalid key, no key where one is needed (buckets, webhooks, /account_info), a locked account or expired plan, or both the month's requests and the keyless rate used up. Kept as 401, with this message, for v3 compatibility.
- `403`: A read-only key, or a change past your plan's limits: data.error_message says which.
- `404`: Not found.
- `409`: You already have a bucket by that name.
- `413`: A body over the limit: 256 KB where a call carries addresses or transaction IDs, 64 KB otherwise.
- `415`: A body that isn't JSON: send it with Content-Type: application/json.
- `503`: Briefly unavailable; retry with backoff. May carry Retry-After.

---

[API](https://skmtc.dev/sochain/apis/sochain-api.md) · [All operations](https://skmtc.dev/sochain/apis/sochain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sochain/apis/sochain-api/revisions/80682797b38f?raw)
