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

# Update Account

This endpoint updates an account and associated asset rules


## OpenAPI

````yaml ledger-openapi put /v1/ledger/{ledger_key}/account/{account_key}
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/{account_key}:
    put:
      summary: Update Account
      operationId: Accounts_updateAccount
      parameters:
        - $ref: '#/components/parameters/BasicAuthHeader'
        - $ref: '#/components/parameters/LedgerKey'
        - $ref: '#/components/parameters/AccountKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountRequest'
      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
    AccountKey:
      name: account_key
      in: path
      required: true
      description: |-
        The key of the account. 
        Examples: 
        - "123e4567-e89b-12d3-a456-426614174000"
        - "id:123e4567-e89b-12d3-a456-426614174000"
        - "ref:internal:revenue:fx"
      schema:
        type: string
  schemas:
    UpdateAccountRequest:
      type: object
      properties:
        default_asset_code:
          type: string
          minLength: 1
          description: the new default asset code for the account
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - INACTIVE
          description: the new status for the account
        metadata:
          type: object
          additionalProperties: {}
          description: the new metadata for the account, will overwrite existing metadata
    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
    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

````