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

# Create a trading account

> Create a new trading account for a user. Starting balance precedence is: explicit account `initial_balance`, then the selected Phase `initial_balance`, then the Challenge `initial_balance`. When `phase_id` is omitted or null, the account uses the first phase for `challenge_id`; provide `phase_id` to create the account for a specific phase in that challenge.



## OpenAPI

````yaml /openapi.json post /api/accounts/
openapi: 3.0.3
info:
  title: TBBO API
  version: 1.0.0
  description: >
    Authentication uses short-lived session tokens (3 hours).


    Send the token with every request using the `Authorization` header:


    ```

    Authorization: Token <token>

    ```


    Example:


    ```

    Authorization: Token 123abc456def789

    ```


    To obtain a token, call `POST /auth/login/` with valid credentials. The
    response includes a `key` value. Use that value in the header above for
    subsequent API calls.


    How to find required IDs:


    - `challenge_id`: Prop Tech Configuration -> Challenges

    - `user_id`: Tickblaze Manager -> Users

    - `account_id`: Tickblaze Manager -> Accounts 
servers: []
security: []
tags:
  - name: withdrawals
    description: Withdrawal related endpoints
    x-displayName: Withdrawals
paths:
  /api/accounts/:
    post:
      tags:
        - Accounts
      summary: Create a trading account
      description: >-
        Create a new trading account for a user. Starting balance precedence is:
        explicit account `initial_balance`, then the selected Phase
        `initial_balance`, then the Challenge `initial_balance`. When `phase_id`
        is omitted or null, the account uses the first phase for `challenge_id`;
        provide `phase_id` to create the account for a specific phase in that
        challenge.
      operationId: api_accounts_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
            examples:
              BasicTradingAccount:
                value:
                  user_id: 123
                  challenge_id: 1
                  is_active: true
                summary: >-
                  Create a basic trading account using the challenge default
                  balance
                description: >-
                  Example of creating a standard trading account with minimal
                  required fields
              AdvancedTradingAccount:
                value:
                  user_id: 456
                  challenge_id: 2
                  initial_balance: 100000
                  is_active: true
                  allowed_symbols:
                    - EURUSD
                    - GBPUSD
                    - USDJPY
                    - XAUUSD
                    - US100
                  max_open_positions: 10
                  max_contracts: 5
                  notes: Priority review requested
                summary: Create an account with an explicit balance override
                description: >-
                  Example with custom symbols, position limits, notes, and an
                  explicit starting balance.
              SpecificPhaseTradingAccount:
                value:
                  user_id: 456
                  challenge_id: 2
                  phase_id: 9
                  initial_balance: 100000
                  is_active: true
                summary: Create an account for a specific challenge phase
                description: >-
                  Example of creating an account using an exact phase id while
                  keeping challenge_id for compatibility.
              InactiveAccount:
                value:
                  user_id: 321
                  challenge_id: 1
                  is_active: false
                  notes: >-
                    Account created for testing purposes. Will be activated
                    after verification.
                summary: Create an inactive account
                description: Example of creating an account that starts in inactive state
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResponse'
              examples:
                SuccessResponse:
                  value:
                    success: true
                    results:
                      - account_id: 282
                        user_id: 50
                        prop_firm_id: 08dfcf0b-005f-4e6a-84fc-d0348ed66a4e
                        prop_firm_slug: firm-demo
                        challenge_id: 1
                        challenge_short_code: '001122'
                        account_name: John Doe - 50K Challenge
                        initial_balance: 100000
                        current_balance: 100000
                        is_active: true
                        allowed_symbols:
                          - EURUSD
                          - GBPUSD
                          - USDJPY
                          - AUDUSD
                          - XAUUSD
                          - XAGUSD
                          - US30
                          - US100
                          - US500
                        max_drawdown: 12000
                        max_open_positions: 10
                        max_contracts: 5
                        notes: >-
                          Passed Phase 1 and Phase 2 evaluation. Ready for live
                          trading with full symbol access.
                        created_at: '2026-02-19T19:54:41.763500Z'
                        updated_at: '2026-02-19T19:54:41.763516Z'
                  summary: Successful account creation
                  description: Response when account is successfully created
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    AccountCreateRequest:
      type: object
      properties:
        user_id:
          type: integer
          description: ID of the user who will own the trading account.
        challenge_id:
          type: integer
          description: >-
            Challenge or program identifier associated with the account. The
            first phase for the challenge is used.
        phase_id:
          type: integer
          nullable: true
          description: >-
            Optional exact phase identifier for the account. When provided, it
            must belong to the selected challenge. When omitted or null, the
            first phase for the challenge is used.
        initial_balance:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
          description: >-
            Optional account-level starting balance override. Precedence is
            explicit account initial_balance, then the selected Phase
            initial_balance, then the Challenge initial_balance.
        is_active:
          type: boolean
          default: true
          description: Whether the account is active immediately after creation.
        notes:
          type: string
          nullable: true
          description: Optional notes or comments to store with the account.
          maxLength: 2000
      required:
        - challenge_id
        - user_id
    OperationResponse:
      type: object
      description: >-
        Standard serializer for operation responses. A command or a task should
        return a response matching this format.

        Operation = a request to perform some action, e.g. sync, update, delete,
        create, etc.
      properties:
        success:
          type: boolean
          description: Indicates whether the operation completed successfully.
        results:
          type: array
          items: {}
          description: >-
            List containing the result items produced by the operation. The
            structure of each item depends on the executed operation.
        summary:
          type: object
          additionalProperties: {}
          description: >-
            Aggregated summary information about the operation results (e.g.
            counts of updated, created, failed or unchanged records).
        duration_ms:
          type: number
          format: double
          description: Execution time of the operation in milliseconds.
        message:
          type: string
          nullable: true
          description: Optional human-readable message describing the operation outcome.
      required:
        - duration_ms
        - results
        - success
        - summary
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````

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