> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whitebit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Sub-Account

> The endpoint creates new [sub-account](/glossary#sub-account).

A main account holds up to 50 sub-accounts by default; the assigned account manager raises the limit on request.

WhiteBIT refuses a create request over the limit on the `alias` field.

<Note>
The `email` field, not `shareKyc`, decides whether the sub-account is active at creation:
- When `shareKyc` is `false` or not provided: `email` is **required**. WhiteBIT sends an invitation to that email, and the sub-account stays inactive until the end user opens the link and sets a password. The link expires after three days and can be re-sent on whitebit.com, not through the API.
- When `shareKyc` is `true`: leave `email` out. The sub-account is active as soon as the request succeeds and shares the main account's verification.
- A request with `email` starts the invitation flow even when `shareKyc` is `true`.
</Note>

A refused request names the cause by field in `errors`: `alias` for a duplicate alias, and `email` for an invalid or temporary (disposable) email address or the main account's own email. A `422` with "Account creation failed" and no field means the request was valid and the creation failed for an unexpected reason.

<Note>
Until the end user activates a sub-account created with `email`, sub-account balances, transfers, transfer history and the [KYC URL](/api-reference/sub-accounts/kyc-url) return `422` with "Account is not confirmed". Create the sub-account's API key once [List of Sub-Accounts](/api-reference/sub-accounts/list-of-sub-accounts) shows its `status` as `active`. Activation is a separate step from KYC: transfers from the main account to a sub-account created with `shareKyc: false` are refused until the end user's KYC is approved.
</Note>

On a request with `email`, `spotEnabled` and `collateralEnabled` are kept after activation. Set `depositsEnabled` and `withdrawsEnabled` with [Edit Sub-Account](/api-reference/sub-accounts/edit-sub-account) once [List of Sub-Accounts](/api-reference/sub-accounts/list-of-sub-accounts) shows the sub-account's `status` as `active`; Edit is refused before activation. Send the sub-account's `alias` and the full `permissions` object: `spotEnabled` and `collateralEnabled` with the values used at creation, plus `depositsEnabled` and `withdrawsEnabled`. With `shareKyc: true` and no `email`, `spotEnabled` and `collateralEnabled` apply at creation, and `depositsEnabled` and `withdrawsEnabled` go in the same request. See [FAQ](/faq).

<Note>
Crypto deposits to sub-accounts are disabled by default. Enablement for the account is not
available via API. To request it, contact the assigned account manager.
Once enabled, a sub-account generates deposit addresses through the standard
[deposit-address endpoint](/api-reference/account-wallet/get-cryptocurrency-deposit-address)
using its own `type: 2` API key, after `/api/v4/main-account/address` is enabled on the key with
[Edit Sub-Account API Key](/api-reference/sub-accounts/edit-sub-account-api-key) (every URL group starts switched off on a new key).
Each sub-account also needs its own deposit permission, `depositsEnabled`, and withdrawal
permission, `withdrawsEnabled`.
</Note>

<Warning>
Rate limit: 1000 requests/10 sec.
</Warning>

<Note>
The API does not cache the response.
</Note>


POST

Copy URL

Copy URL

> [!NOTE]
>
> The `email` field, not `shareKyc`, decides whether the sub-account is active at creation:
>
> * When `shareKyc` is `false` or not provided: `email` is **required**. WhiteBIT sends an invitation to that email, and the sub-account stays inactive until the end user opens the link and sets a password. The link expires after three days and can be re-sent on whitebit.com, not through the API.
> * When `shareKyc` is `true`: leave `email` out. The sub-account is active as soon as the request succeeds and shares the main account's verification.
> * A request with `email` starts the invitation flow even when `shareKyc` is `true`.

## Used in these guides

* [Embedded Trading sub-account integration](https://docs.whitebit.com/guides/sub-account-integration.md) — managed sub-accounts, fee-share, and partner onboarding.
* [Wallet-as-a-Service integration](https://docs.whitebit.com/guides/waas-integration.md) — sub-accounts as end-user wallets: deposits, payouts, and per-user API keys.
* [Yield-as-a-Service integration](https://docs.whitebit.com/guides/yaas-integration.md) — Crypto Lending run in a sub-account per end user.


## OpenAPI

````yaml openapi/private/main_api_v4.yaml POST /api/v4/sub-account/create
openapi: 3.0.3
info:
  title: WhiteBIT Private HTTP API V4
  description: |
    WhiteBIT Private HTTP API V4 for Main balance changes.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.
  version: 4.0.0
  contact:
    name: WhiteBIT Support
    email: support@whitebit.com
    url: https://whitebit.com
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
  - url: https://whitebit.tr
    description: WhiteBIT TR Server
  - url: https://whitebit.ge
    description: WhiteBIT GE Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main balance and related operations
  - name: Deposit
    description: Cryptocurrency and fiat deposit operations
  - name: Withdraw
    description: Cryptocurrency and fiat withdrawal operations
  - name: Transfer
    description: Balance transfer operations
  - name: Codes
    description: WhiteBIT codes operations
  - name: Crypto Lending - Fixed
    description: Fixed crypto lending plans
  - name: Crypto Lending - Flex
    description: Flexible crypto lending plans
  - name: Fees
    description: Fee information
  - name: Sub-Account
    description: Sub-account management
  - name: Sub-Account API Keys
    description: Sub-account API key management
  - name: Mining Pool
    description: Mining pool operations
  - name: Credit Line
    description: Credit line information
  - name: JWT
    description: JWT token management
  - name: Travel Rule
    description: Travel Rule compliance endpoints for deposits and withdrawals
paths:
  /api/v4/sub-account/create:
    post:
      tags:
        - Sub-Account
      summary: Create Sub-Account
      description: >
        The endpoint creates new [sub-account](/glossary#sub-account).


        A main account holds up to 50 sub-accounts by default; the assigned
        account manager raises the limit on request.


        WhiteBIT refuses a create request over the limit on the `alias` field.


        <Note>

        The `email` field, not `shareKyc`, decides whether the sub-account is
        active at creation:

        - When `shareKyc` is `false` or not provided: `email` is **required**.
        WhiteBIT sends an invitation to that email, and the sub-account stays
        inactive until the end user opens the link and sets a password. The link
        expires after three days and can be re-sent on whitebit.com, not through
        the API.

        - When `shareKyc` is `true`: leave `email` out. The sub-account is
        active as soon as the request succeeds and shares the main account's
        verification.

        - A request with `email` starts the invitation flow even when `shareKyc`
        is `true`.

        </Note>


        A refused request names the cause by field in `errors`: `alias` for a
        duplicate alias, and `email` for an invalid or temporary (disposable)
        email address or the main account's own email. A `422` with "Account
        creation failed" and no field means the request was valid and the
        creation failed for an unexpected reason.


        <Note>

        Until the end user activates a sub-account created with `email`,
        sub-account balances, transfers, transfer history and the [KYC
        URL](/api-reference/sub-accounts/kyc-url) return `422` with "Account is
        not confirmed". Create the sub-account's API key once [List of
        Sub-Accounts](/api-reference/sub-accounts/list-of-sub-accounts) shows
        its `status` as `active`. Activation is a separate step from KYC:
        transfers from the main account to a sub-account created with `shareKyc:
        false` are refused until the end user's KYC is approved.

        </Note>


        On a request with `email`, `spotEnabled` and `collateralEnabled` are
        kept after activation. Set `depositsEnabled` and `withdrawsEnabled` with
        [Edit Sub-Account](/api-reference/sub-accounts/edit-sub-account) once
        [List of Sub-Accounts](/api-reference/sub-accounts/list-of-sub-accounts)
        shows the sub-account's `status` as `active`; Edit is refused before
        activation. Send the sub-account's `alias` and the full `permissions`
        object: `spotEnabled` and `collateralEnabled` with the values used at
        creation, plus `depositsEnabled` and `withdrawsEnabled`. With `shareKyc:
        true` and no `email`, `spotEnabled` and `collateralEnabled` apply at
        creation, and `depositsEnabled` and `withdrawsEnabled` go in the same
        request. See [FAQ](/faq).


        <Note>

        Crypto deposits to sub-accounts are disabled by default. Enablement for
        the account is not

        available via API. To request it, contact the assigned account manager.

        Once enabled, a sub-account generates deposit addresses through the
        standard

        [deposit-address
        endpoint](/api-reference/account-wallet/get-cryptocurrency-deposit-address)

        using its own `type: 2` API key, after `/api/v4/main-account/address` is
        enabled on the key with

        [Edit Sub-Account API
        Key](/api-reference/sub-accounts/edit-sub-account-api-key) (every URL
        group starts switched off on a new key).

        Each sub-account also needs its own deposit permission,
        `depositsEnabled`, and withdrawal

        permission, `withdrawsEnabled`.

        </Note>


        <Warning>

        Rate limit: 1000 requests/10 sec.

        </Warning>


        <Note>

        The API does not cache the response.

        </Note>
      operationId: createSubAccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - alias
                - permissions
              properties:
                alias:
                  type: string
                  description: >-
                    Sub-account name, up to 127 characters. Unique among the
                    main account's sub-accounts; the alias of a deleted
                    sub-account can be used again.
                  maxLength: 127
                  example: trading_bot
                email:
                  type: string
                  description: >-
                    End user's email. Required when shareKyc is false or
                    omitted; leave it out when shareKyc is true. Any email
                    starts the invitation flow, and the sub-account stays
                    inactive until the end user sets a password
                  example: sub@example.com
                shareKyc:
                  type: boolean
                  description: >-
                    Share the main account's KYC with the sub-account. With
                    true, leave email out; the sub-account is then active at
                    creation
                  example: false
                permissions:
                  type: object
                  required:
                    - spotEnabled
                    - collateralEnabled
                  properties:
                    spotEnabled:
                      type: boolean
                      description: Enable transfers to trade balance
                      example: true
                    collateralEnabled:
                      type: boolean
                      description: Enable transfers to collateral balance
                      example: false
                    depositsEnabled:
                      type: boolean
                      description: >-
                        Deposit permission for the sub-account. On a request
                        with `email`, set it with Edit Sub-Account after
                        activation
                      example: false
                    withdrawsEnabled:
                      type: boolean
                      description: >-
                        Withdrawal permission for the sub-account. On a request
                        with `email`, set it with Edit Sub-Account after
                        activation
                      example: false
      responses:
        '201':
          description: Sub-account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAccount'
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                aliasOrEmailInvalid:
                  summary: Alias or email invalid
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      alias:
                        - Alias already exists.
                      email:
                        - Email is invalid.
                emailRequired:
                  summary: Email required when shareKyc is false
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      email:
                        - The email field is required.
        '422':
          description: >-
            Sub-account creation failed after the request passed validation; the
            response gives no reason
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                accountCreationFailed:
                  summary: Creation failed after validation
                  value:
                    message: Account creation failed
components:
  schemas:
    SubAccount:
      type: object
      properties:
        id:
          type: string
          description: Sub-account identifier
          example: 8e667b4a-0b71-4988-8af5-9474dbfaeb51
        alias:
          type: string
          description: Sub-account alias/name
          example: trading_bot
        userId:
          type: string
          description: >-
            User identifier associated with account. In List of Sub-Accounts,
            `null` for a sub-account created with `email` until the end user
            sets the password
          nullable: true
          example: u-12345
        email:
          type: string
          description: Sub-account email (masked)
          example: s***@example.com
        status:
          type: string
          description: >-
            Sub-account status. In List of Sub-Accounts, `active` once the end
            user of a sub-account created with `email` has set the password; a
            sub-account created without an email (`shareKyc: true`) is `active`
            from the first list call
          example: active
        color:
          type: string
          description: Sub-account color
          example: '#FF5733'
        kyc:
          type: object
          description: KYC information
          properties:
            shareKyc:
              type: boolean
              description: Whether KYC is shared with main account
              example: false
            kycStatus:
              type: string
              description: KYC status
              example: verified
        permissions:
          type: object
          description: Sub-account permissions
          properties:
            spotEnabled:
              type: boolean
              description: Spot trading enabled
              example: true
            collateralEnabled:
              type: boolean
              description: Collateral trading enabled
              example: false
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: The public WhiteBIT API key.
    PayloadAuth:
      type: apiKey
      in: header
      name: X-TXC-PAYLOAD
      description: Base64-encoded JSON request body.
    SignatureAuth:
      type: apiKey
      in: header
      name: X-TXC-SIGNATURE
      description: >-
        HMAC-SHA512 signature of the payload, hex-encoded. Computed as
        hex(HMAC-SHA512(payload, api_secret)).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.