> ## 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

> Create a new sub-account under a main WhiteBIT account via the V4 API.

<Note>
  The `email` field requirement depends on the `shareKyc` parameter:

  * When `shareKyc` is `false` or not provided: `email` is **required**
  * When `shareKyc` is `true`: `email` is **optional**
</Note>


## 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
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main account balance and 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
paths:
  /api/v4/sub-account/create:
    post:
      tags:
        - Sub-Account
      summary: Create Sub-Account
      description: |
        The endpoint creates new [sub-account](/glossary#sub-account).

        <Note>
        The `email` field requirement depends on the `shareKyc` parameter:
        - When `shareKyc` is `false` or not provided: `email` is **required**
        - When `shareKyc` is `true`: `email` is **optional**
        </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: Name for sub-account
                  example: trading_bot
                email:
                  type: string
                  description: Sub-account email (required when shareKyc is false)
                  example: sub@example.com
                shareKyc:
                  type: boolean
                  description: If KYC shared with main account
                  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
      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.
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
          example: u-12345
        email:
          type: string
          description: Sub-account email (masked)
          example: s***@example.com
        status:
          type: string
          description: Sub-account status
          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)).

````