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

# Initialize Account

> The Create Account API endpoint adds a new account to the specified ledger. Each account can have a unique reference, which serves as a readable ID or account address. While optional, this reference provides an easy way to identify the account in subsequent operations. Accounts can hold multiple assets and are used to track balances and participate in transactions within the ledger.



## OpenAPI

````yaml ledger-openapi POST /v1/ledger/{ledger_key}/account
openapi: 3.0.0
info:
  title: Ledger API
  version: 0.0.0
servers:
  - url: https://api.sandbox.nxos.io
    description: single server endpoint
    variables: {}
security: []
tags: []
paths:
  /v1/ledger/{ledger_key}/account:
    post:
      summary: Create Account
      description: >-
        The Create Account API endpoint adds a new account to the specified
        ledger. Each account can have a unique reference, which serves as a
        readable ID or account address. While optional, this reference provides
        an easy way to identify the account in subsequent operations. Accounts
        can hold multiple assets and are used to track balances and participate
        in transactions within the ledger.
      operationId: Accounts_createAccount
      parameters:
        - $ref: '#/components/parameters/BasicAuthHeader'
        - $ref: '#/components/parameters/LedgerKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
components:
  parameters:
    BasicAuthHeader:
      name: Authorization
      in: header
      required: true
      description: |-
        The Basic Authentication header.
        Format: "Basic {base64(orgID:apiKey)}"
      schema:
        type: string
    LedgerKey:
      name: ledger_key
      in: path
      required: true
      description: |-
        The key of the ledger. 
        Examples: 
        - "123e4567-e89b-12d3-a456-426614174000"
        - "id:123e4567-e89b-12d3-a456-426614174000"
        - "ref:ledger:customer_a"
      schema:
        type: string
  schemas:
    CreateAccountRequest:
      type: object
      required:
        - account_ref
        - default_asset_code
      properties:
        account_ref:
          type: string
          minLength: 1
          description: >-
            The externally defined reference of the accoun. Generally speaking
            this reference can be in the format of your choice. We recommend
            either using a UUID that can be mapped internally, or a unique

            reference that acts like an address, such as internal:revenue:fx, or
            internal:exchange
        default_asset_code:
          type: string
          minLength: 1
          description: >-
            The default asset for the account. A fallback asset for an account
            against which accounts can be reconciled
        enabled_assets:
          type: array
          items:
            $ref: '#/components/schemas/AccountRuleInput'
          description: The enabled assets for the account, in addition to the default asset
        metadata:
          type: object
          additionalProperties: {}
          description: >-
            Additional, optional, metadata for the account, such as internal
            references, user-mappings or other data
    Account:
      type: object
      required:
        - account_id
        - account_ref
        - default_asset_code
        - enabled_assets
        - created_at
        - updated_at
      properties:
        account_id:
          type: string
          format: uuid
          description: The unique identifier of the account
        account_ref:
          type: string
          minLength: 1
          description: The externally defined reference of the account
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - INACTIVE
          description: The status of the account, defaults to ACTIVE
        default_asset_code:
          type: string
          minLength: 1
          description: The default asset for the account
        enabled_assets:
          type: array
          items:
            $ref: '#/components/schemas/EnabledAsset'
          description: >-
            The enabled assets for the account with asset rules such as min/max
            balances
        metadata:
          type: object
          additionalProperties: {}
          description: Additional, optional, metadata for the account
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    AccountRuleInput:
      type: object
      required:
        - asset_code
        - max_balance
      properties:
        asset_code:
          type: string
          minLength: 1
          description: The asset reference
        min_balance:
          type: integer
          format: int64
          description: The minimum balance allowed for the asset, defaults to 0 if not set
        max_balance:
          type: integer
          format: int64
          description: >-
            The maximum balance allowed for the asset, defaults to max int64 if
            not set
    EnabledAsset:
      type: object
      required:
        - asset_code
        - max_balance
        - created_at
        - updated_at
      properties:
        asset_code:
          type: string
          minLength: 1
          description: The asset reference
        min_balance:
          type: string
          description: The minimum balance allowed for the asset, defaults to 0 if not set
        max_balance:
          type: string
          description: >-
            The maximum balance allowed for the asset, defaults to max int64 if
            not set
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time

````