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

# List Accounts

> Use this endpoint to list all accounts in your Ledger.



## OpenAPI

````yaml /en/openapi/v3-current/ledger.yaml get /v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts
openapi: 3.1.0
info:
  title: Midaz Ledger API
  description: >-
    Complete API reference for Midaz Ledger services including organization
    management, ledger operations, assets, segments, portfolios, accounts,
    account types, transactions, operations, balances, operation routes,
    transaction routes, and metadata indexes.
  version: 3.7.1
servers:
  - url: https://ledger.sandbox.lerian.net
security: []
tags:
  - name: Organizations API
  - name: Ledgers API
  - name: Assets API
  - name: Segments API
  - name: Portfolios API
  - name: Account Types API
  - name: Accounts API
  - name: Balances API
  - name: Transactions API
  - name: Operations API
  - name: Operation Routes API
  - name: Transaction Routes API
  - name: Metadata Indexes API
paths:
  /v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts:
    get:
      tags:
        - Accounts API
      summary: List Accounts
      description: Use this endpoint to list all accounts in your Ledger.
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/LedgerId'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XRequestId'
        - name: limit
          in: query
          description: 'The maximum number of items to include in the response. Max: 100'
          required: false
          example: '10'
          schema:
            type: string
        - name: start_date
          in: query
          description: >-
            The beginning of the period you want to retrieve. You must also
            include the end_date.
          required: false
          example: '2021-01-01'
          schema:
            type: string
        - name: end_date
          in: query
          description: >-
            The end of the period you want to retrieve. You must also include
            the start_date.
          required: false
          example: '2025-01-01'
          schema:
            type: string
        - name: sort_order
          in: query
          description: The order used to sort the results.
          required: false
          example: asc
          schema:
            type: string
        - name: page
          in: query
          description: The number of the page that you want to retrieve.
          required: false
          example: '1'
          schema:
            type: string
        - name: portfolio_id
          in: query
          description: >-
            Filter accounts by portfolio. Returns only accounts assigned to this
            portfolio.
          required: false
          schema:
            type: string
            format: uuid
        - name: segment_id
          in: query
          description: >-
            Filter accounts by segment. Returns only accounts assigned to this
            segment.
          required: false
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          description: >-
            Filter accounts by status. Accepted values are `active`, `blocked`,
            or `inactive`.
          required: false
          schema:
            type: string
            enum:
              - active
              - blocked
              - inactive
        - name: type
          in: query
          description: >-
            Filter accounts by type (exact match, case-insensitive). Common
            values include `deposit`, `savings`, `loans`, `marketplace`,
            `creditCard`, and `external`.
          required: false
          schema:
            type: string
        - name: asset_code
          in: query
          description: Filter accounts by asset code (e.g. `BRL`, `USD`).
          required: false
          schema:
            type: string
        - name: entity_id
          in: query
          description: Filter accounts by entity identifier.
          required: false
          schema:
            type: string
        - name: blocked
          in: query
          description: >-
            Filter accounts by blocked state. Use `true` to list only blocked
            accounts, `false` for unblocked.
          required: false
          schema:
            type: boolean
        - name: parent_account_id
          in: query
          description: >-
            Filter accounts by parent account. Returns only sub-accounts of the
            specified parent.
          required: false
          schema:
            type: string
            format: uuid
        - name: name
          in: query
          description: Filter accounts by name. Uses prefix matching (case-insensitive).
          required: false
          schema:
            type: string
        - name: alias
          in: query
          description: Filter accounts by alias. Uses prefix matching (case-insensitive).
          required: false
          schema:
            type: string
        - name: metadata.key
          in: query
          description: >-
            Filter by metadata using dot-notation. Replace `key` with your
            metadata field name (e.g. `metadata.costCenter=BR_11101997`).
          required: false
          example: mymetadata
          schema:
            type: string
      responses:
        '200':
          description: >-
            Indicates that the request was successful and the response contains
            the expected data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/CreateAccountResponse'
                  page:
                    type: integer
                    description: The number of pages returned.
                  limit:
                    type: integer
                    description: The maximum number of items included in the response.
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0065:
                  $ref: '#/components/examples/Error0065'
                Error0079:
                  $ref: '#/components/examples/Error0079'
                Error0080:
                  $ref: '#/components/examples/Error0080'
                Error0081:
                  $ref: '#/components/examples/Error0081'
                Error0083:
                  $ref: '#/components/examples/Error0083'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0041:
                  $ref: '#/components/examples/Error0041'
                Error0042:
                  $ref: '#/components/examples/Error0042'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0043:
                  $ref: '#/components/examples/Error0043'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0037:
                  $ref: '#/components/examples/Error0037'
                Error0038:
                  $ref: '#/components/examples/Error0038'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0046:
                  $ref: '#/components/examples/Error0046'
      security: []
components:
  parameters:
    OrganizationId:
      name: organization_id
      in: path
      description: The unique identifier of the Organization associated with the Ledger.
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
    Authorization:
      name: Authorization
      in: header
      description: >-
        The authorization token. **This header is required if your environment
        has Access Manager enabled**.
      required: false
      schema:
        type: string
    LedgerId:
      name: ledger_id
      in: path
      description: The unique identifier of the associated Ledger.
      required: true
      example: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
      schema:
        type: string
    ContentType:
      name: Content-Type
      in: header
      description: >-
        The type of media of the resource. Recommended value is
        `application/json`.
      required: false
      example: application/json
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: A unique identifier used to trace and track each request.
      required: false
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
  schemas:
    CreateAccountResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the Account.
          format: uuid
        organizationId:
          type: string
          format: uuid
          description: The unique identifier of the Organization.
        ledgerId:
          type: string
          description: The unique identifier of the Ledger.
          format: uuid
        assetCode:
          type: string
          description: The code that identifies the Asset used in the Account.
        name:
          type: string
          description: The name of the Account.
          maxLength: 256
        alias:
          type: string
          description: >-
            A unique, user-friendly identifier for the account. Used to
            reference the account in transactions and other operations.
        type:
          type: string
          description: Specifies the Account Type associated with the account.
        blocked:
          type: boolean
          default: false
          description: Defines whether the account should be blocked.
        parentAccountId:
          type:
            - string
            - 'null'
          format: uuid
          description: The unique identifier of the Parent Account.
        entityId:
          type:
            - string
            - 'null'
          description: The unique identifier of the Entity responsible for the Account.
        portfolioId:
          type:
            - string
            - 'null'
          description: The unique identifier of the associated Portfolio.
          format: uuid
        segmentId:
          type:
            - string
            - 'null'
          description: >-
            The unique identifier of the Segment which is used to cluster the
            Account.
          format: uuid
        status: c37bdb5b-fef3-47c4-a0c8-043f65d94875
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          type: string
          format: date-time
          description: Timestamp of creation (UTC).
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of last update (UTC).
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of soft deletion, if applicable (UTC).
    ErrorFormat:
      type: object
      description: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
        fields:
          type: object
          additionalProperties: true
          description: Additional information about the fields that caused the error.
    Metadata:
      type: object
      additionalProperties:
        type: string
      description: >-
        An object containing key-value pairs to add as metadata, where the field
        `name` is the key and the field `value` is the value. For example, to
        add a Cost Center, use 'costCenter': 'BR_11101997'.
  examples:
    Error0065:
      value:
        code: '0065'
        title: Invalid Path Parameter
        message: >-
          The provided path parameter {{parameter_name}} is not in the expected
          format. Please ensure the parameter adheres to the required format and
          try again.
      summary: Invalid Path Parameter
    Error0079:
      value:
        code: '0079'
        title: Date Range Exceeds Limit Error
        message: >-
          The range between 'initialDate' and 'finalDate' exceeds the permitted
          limit of {{limit}} months. Please adjust the dates and try again.
      summary: Date Range Exceeds Limit Error
    Error0080:
      value:
        code: '0080'
        title: Pagination Limit Exceeded
        message: >-
          The pagination limit exceeds the maximum allowed of {{pageLimit}}
          items per page. Please verify the limit and try again.
      summary: Pagination Limit Exceeded
    Error0081:
      value:
        code: '0081'
        title: Invalid Sort Order
        message: >-
          The 'sort_order' field must be 'asc' or 'desc'. Please provide a valid
          sort order and try again.
      summary: Invalid Sort Order
    Error0083:
      value:
        code: '0083'
        title: Invalid Date Range Error
        message: >-
          Both 'initialDate' and 'finalDate' fields are required and must be in
          the 'yyyy-mm-dd' format. Please provide valid dates and try again.
      summary: Invalid Date Range Error
    Error0041:
      summary: Token Missing
      value:
        code: '0041'
        title: Token Missing
        message: >-
          A valid token must be provided in the request header. Please include a
          token and try again.
    Error0042:
      summary: Invalid Token
      value:
        code: '0042'
        title: Invalid Token
        message: >-
          The provided token is expired, invalid or malformed. Please provide a
          valid token and try again.
    Error0043:
      summary: Insufficient Privileges
      value:
        code: '0043'
        title: Insufficient Privileges
        message: >-
          You do not have the necessary permissions to perform this action.
          Please contact your administrator if you believe this is an error.
    Error0037:
      summary: Ledger ID Not Found
      value:
        code: '0037'
        title: Ledger ID Not Found
        message: >-
          The provided ledger ID does not exist in our records. Please verify
          the ledger ID and try again.
    Error0038:
      summary: Organization ID Not Found
      value:
        code: '0038'
        title: Organization ID Not Found
        message: >-
          The provided organization ID does not exist in our records. Please
          verify the organization ID and try again.
    Error0046:
      summary: Internal Server Error
      value:
        code: '0046'
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.

````