> ## 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 Metadata Indexes

> Use this endpoint to retrieve all metadata indexes. You can optionally filter the results by entity name.



## OpenAPI

````yaml /en/openapi/v3-current/ledger.yaml get /v1/settings/metadata-indexes
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/settings/metadata-indexes:
    get:
      tags:
        - Metadata Indexes API
      summary: List Metadata Indexes
      description: >-
        Use this endpoint to retrieve all metadata indexes. You can optionally
        filter the results by entity name.
      parameters:
        - name: entity_name
          in: query
          description: The name of the entity to filter the metadata indexes.
          required: false
          example: transaction
          schema:
            type: string
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XRequestId'
      responses:
        '200':
          description: >-
            Indicates that the request was successful and the response contains
            the expected data.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetadataIndexWithStatsResponse'
              example:
                - indexName: metadata.tier_1
                  entityName: transaction
                  metadataKey: tier
                  unique: false
                  sparse: true
                  stats:
                    accesses: 150
                    statsSince: '2024-01-15T10:30:00Z'
                - indexName: metadata.externalId_1
                  entityName: account
                  metadataKey: externalId
                  unique: true
                  sparse: false
                  stats:
                    accesses: 1200
                    statsSince: '2024-01-10T08:00:00Z'
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0138:
                  $ref: '#/components/examples/Error0138'
          headers: {}
        '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'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0046:
                  $ref: '#/components/examples/Error0046'
      security:
        - bearer: []
components:
  parameters:
    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
    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:
    MetadataIndexWithStatsResponse:
      type: object
      description: The response body for a metadata index including usage statistics.
      required:
        - indexName
        - entityName
        - metadataKey
        - unique
        - sparse
        - stats
      properties:
        indexName:
          type: string
          description: The name of the index in the database.
          examples:
            - metadata.tier_1
        entityName:
          type: string
          description: The name of the entity associated with the index.
          examples:
            - transaction
        metadataKey:
          type: string
          description: The metadata key used in the index.
          examples:
            - tier
        unique:
          type: boolean
          description: Indicates whether the index enforces uniqueness.
          examples:
            - false
        sparse:
          type: boolean
          description: >-
            Indicates whether the index is sparse (ignores documents without the
            indexed field).
          examples:
            - true
        stats:
          type: object
          description: Index usage statistics.
          required:
            - accesses
            - statsSince
          properties:
            accesses:
              type: integer
              description: The number of times the index has been accessed.
              examples:
                - 150
            statsSince:
              type: string
              format: date-time
              description: The date and time since when statistics are being collected.
              examples:
                - '2024-01-15T10:30:00Z'
    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.
  examples:
    Error0138:
      summary: Invalid Entity Name
      value:
        code: '0138'
        title: Invalid Entity Name
        message: >-
          The provided entity name is not valid. Accepted values are:
          organization, ledger, asset, segment, portfolio, account, transaction,
          operation, account_type, operation_route, transaction_route.
    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.
    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.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````