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

> Lists all aliases, with or without filters. This endpoint supports pagination through the `page` and `limit` parameters, and sorting via the `sort` parameter.   

Sorting is based on the entity ID, which follows the UUID v7 standard, ensuring results are returned in chronological order.      



## OpenAPI

````yaml /en/openapi/v3-current/CRM.yaml get /v1/aliases
openapi: 3.1.0
info:
  title: CRM
  description: >-
    The CRM Integration API is a non-transactional component that provides a set
    of endpoints for managing holders of ledger accounts and their associated
    data. CRM is designed to organize and expose customer data for use by other
    components within the system, facilitating efficient integration and data
    management.
  version: 3.7.0
servers:
  - url: https://crm.sandbox.lerian.net
security: []
tags:
  - name: Holders
paths:
  /v1/aliases:
    get:
      tags:
        - Alias Accounts API
      summary: List Alias Accounts
      description: >-
        Lists all aliases, with or without filters. This endpoint supports
        pagination through the `page` and `limit` parameters, and sorting via
        the `sort` parameter.   


        Sorting is based on the entity ID, which follows the UUID v7 standard,
        ensuring results are returned in chronological order.      
      parameters:
        - name: holder_id
          in: query
          description: Unique ID of the holder.
          required: false
          schema:
            type: string
        - name: metadata
          in: query
          description: The metadata key provided when the Alias Account was created.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: The maximum number of items to include in the response.
          required: false
          schema:
            type: integer
            default: 10
        - name: page
          in: query
          description: The number of the page that you want to retrieve.
          required: false
          schema:
            type: integer
            default: 1
        - name: sort_order
          in: query
          description: The order used to sort the results.
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: include_deleted
          in: query
          description: >-
            If `true`, the Alias Accounts that were logically deleted (soft
            deleted) will also be included.
          required: false
          schema:
            type: string
        - name: account_id
          in: query
          description: Filters Alias Accounts linked to a specific account ID.
          required: false
          schema:
            type: string
        - name: ledger_id
          in: query
          description: Filters Alias Accounts linked to a specific ledger ID.
          required: false
          schema:
            type: string
        - name: document
          in: query
          description: Filters Alias Accounts by document number.
          required: false
          schema:
            type: string
        - name: banking_details_branch
          in: query
          description: Filters Alias Accounts by bank branch.
          required: false
          schema:
            type: string
        - name: banking_details_account
          in: query
          description: Filters Alias Accounts by bank account.
          required: false
          schema:
            type: string
        - name: banking_details_iban
          in: query
          description: Filters Alias Accounts by bank IBAN.
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/XOrganizationId'
      responses:
        '200':
          description: >-
            Indicates that the resource was successfully created and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/AliasResponse'
                    description: List of returned results.
                  page:
                    type: integer
                    description: The number of the page returned.
                    default: 1
                  limit:
                    type: integer
                    description: The maximum number of items to include in the response.
                    default: 10
                required:
                  - items
                  - page
                  - limit
              example:
                items:
                  - id: 01951ad1-9f62-793a-9095-fe7701f94434
                    holderId: 0194f0ea-2cb2-78c9-b9be-704ba20a9cd8
                    document: '08912345965'
                    ledgerId: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
                    accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                    bankingDetails:
                      branch: '0001'
                      account: '123450'
                      type: CACC
                      openingDate: '2010-01-01'
                      iban: US12345678901234567890
                      countryCode: US
                      bankId: '12345'
                    relatedParties:
                      - id: 01951ad2-1234-5678-9abc-def012345678
                        document: '91315026015'
                        name: John Doe
                        role: PRIMARY_HOLDER
                        startDate: '2024-01-01'
                    regulatoryFields:
                      participantDocument: '00000000000191'
                    metadata:
                      key: value
                    createdAt: '2024-12-17T14:34:09.191705548Z'
                    updatedAt: '2024-12-17T14:34:09.191705648Z'
                    deletedAt: null
                  - id: 01951ad2-abcd-ef01-2345-67890abcdef0
                    holderId: 0194f0ea-2cb2-78c9-b9be-704ba20a9cd8
                    document: '08912345965'
                    ledgerId: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
                    accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                    bankingDetails:
                      branch: '0001'
                      account: '123451'
                      type: CACC
                      openingDate: '2010-01-01'
                      closingDate: '2024-06-30'
                      iban: US12345678901234567891
                      countryCode: US
                      bankId: '12345'
                    relatedParties:
                      - id: 01951ad2-5678-9abc-def0-123456789abc
                        document: '98765432100'
                        name: Jane Doe
                        role: LEGAL_REPRESENTATIVE
                        startDate: '2024-01-01'
                        endDate: '2024-06-30'
                    regulatoryFields:
                      participantDocument: '00000000000191'
                    metadata:
                      key: value
                    createdAt: '2024-12-17T14:34:09.191705548Z'
                    updatedAt: '2024-12-17T14:34:09.191705648Z'
                    deletedAt: '2024-12-17T14:34:09.191705648Z'
                page: 1
                limit: 10
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0009:
                  $ref: '#/components/examples/Error0009'
                Error0011:
                  $ref: '#/components/examples/Error0011'
                Error0016:
                  $ref: '#/components/examples/Error0016'
                Error0019:
                  $ref: '#/components/examples/Error0019'
                Error0020:
                  $ref: '#/components/examples/Error0020'
                Error0021:
                  $ref: '#/components/examples/Error0021'
                Error0022:
                  $ref: '#/components/examples/Error0022'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0014:
                  $ref: '#/components/examples/Error0014'
          headers: {}
      security: []
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      description: >-
        The authorization token in the 'Bearer <token>' format.  


        **Important:** This header is required if your environment has Access
        Manager enabled. For more information, refer to the [Access
        Manager](/en/access-manager) documentation.
      required: false
      schema:
        type: string
    XOrganizationId:
      name: X-Organization-id
      in: header
      description: The unique identifier of the Organization associated with the request.
      required: true
      schema:
        type: string
        example: 019c96a0-0a98-7287-9a31-786e0809c769
  schemas:
    AliasResponse:
      description: Information about the Alias Account.
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the Alias Account.
        holderId:
          type: string
          description: Unique identifier of the Holder.
        type:
          type: string
          description: Type of Holder.
          enum:
            - LEGAL_PERSON
            - NATURAL_PERSON
        document:
          type: string
          description: Holder's identification document.
        ledgerId:
          type: string
          description: Unique identifier of the Midaz Ledger of the related Account.
        accountId:
          type: string
          description: Unique identifier of the related Account.
        bankingDetails:
          $ref: '#/components/schemas/BankingDetails'
          description: Details of the Holder's banking account.
        relatedParties:
          description: List of related parties associated with this Alias Account.
          type: array
          items:
            $ref: '#/components/schemas/RelatedPartyResponse'
        regulatoryFields:
          $ref: '#/components/schemas/RegulatoryFields'
          description: Regulatory compliance fields required for specific jurisdictions.
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          type: string
          description: The date when the Alias Account was created.
        updatedAt:
          type: string
          description: The date when the Alias Account was last updated.
        deletedAt:
          type: string
          description: The date when the Alias Account was deleted.
    ErrorMessage:
      description: The response message error.
      type: object
      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.
    BankingDetails:
      description: Banking details linked to the user's account.
      type: object
      properties:
        branch:
          description: Branch number or code where the account is held.
          type: string
        account:
          description: Account number or code used to identify the user's account.
          type: string
        type:
          description: Account type (e.g., CACC for checking account).
          type: string
        openingDate:
          description: 'Date when the account was opened (format: YYYY-MM-DD).'
          type: string
          format: date
        closingDate:
          description: 'Date when the account was closed (format: YYYY-MM-DD).'
          type: string
          format: date
        iban:
          description: International Bank Account Number (IBAN) tied to the account.
          type: string
        countryCode:
          description: ISO 3166-1 alpha-2 country code where the bank is based.
          type: string
        bankId:
          description: Bank identifier used to link the account to its institution.
          type: string
    RelatedPartyResponse:
      description: Information about a related party associated with an Alias Account.
      type: object
      properties:
        id:
          description: Unique identifier of the related party record.
          type: string
        document:
          description: Identification document of the related party (e.g., CPF or CNPJ).
          type: string
        name:
          description: Full legal name of the related party.
          type: string
        role:
          description: >-
            The type of relationship between the related party and the Alias
            Account.

            * `PRIMARY_HOLDER` – The main account holder.

            * `LEGAL_REPRESENTATIVE` – A person legally authorized to represent
            the holder.

            * `RESPONSIBLE_PARTY` – A person responsible for the account on
            behalf of the holder.
          type: string
          enum:
            - PRIMARY_HOLDER
            - LEGAL_REPRESENTATIVE
            - RESPONSIBLE_PARTY
        startDate:
          description: >-
            Start date of the relationship with the Alias Account (format
            YYYY-MM-DD).
          type: string
          format: date
        endDate:
          description: >-
            End date of the relationship with the Alias Account (format
            YYYY-MM-DD).
          type: string
          format: date
    RegulatoryFields:
      description: >-
        Regulatory compliance fields required for specific jurisdictions or
        regulatory frameworks.
      type: object
      properties:
        participantDocument:
          description: >-
            The document number of the participant institution (e.g., CNPJ for
            Brazilian financial institutions).
          type: string
    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:
    Error0009:
      value:
        code: CRM-0009
        title: Pagination Limit Exceeded
        message: >-
          The pagination limit exceeds the maximum allowed of %v items per page.
          Please verify the limit and try again.
      summary: Pagination Limit Exceeded
    Error0011:
      value:
        code: CRM-0011
        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
    Error0016:
      value:
        code: CRM-0016
        title: Invalid Query Parameter
        message: >-
          One or more query parameters are in an incorrect format. Please check
          the following parameters '%v' and ensure they meet the required format
          before trying again.
      summary: Invalid Query Parameter
    Error0019:
      value:
        code: CRM-0019
        title: Invalid Metadata Format
        message: >-
          The metadata parameter format is invalid. Metadata must be provided in
          the 'metadata.field=value' format. Please check the documentation for
          correct usage.
      summary: Invalid Metadata Format
    Error0020:
      value:
        code: CRM-0020
        title: Invalid Metadata Key
        message: >-
          The metadata key '%s' contains invalid characters. Metadata keys must
          use only alphanumeric characters, underscores, and hyphens after the
          'metadata.' prefix.
      summary: Invalid Metadata Key
    Error0021:
      value:
        code: CRM-0021
        title: Potentially Unsafe Metadata Value
        message: >-
          The metadata value '%s' contains characters that could be used for
          database injection attacks. Please remove any MongoDB operators (like
          $where, $regex) from your query.
      summary: Potentially Unsafe Metadata Value
    Error0022:
      value:
        code: CRM-0022
        title: Invalid Header Value
        message: >-
          One or more headers have invalid values. Please check the following
          headers %v and ensure they contain valid UUIDs before trying again.
      summary: Invalid Header Value
    Error0014:
      value:
        code: CRM-0014
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.
      summary: Internal Server Error

````