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

# Retrieve a Data Source by id

> Use this endpoint to retrieve the schema structure of a specific data source, including tables and fields, to support dynamic filter creation during report generation.



## OpenAPI

````yaml /en/openapi/v3-current/reporter.yaml get /v1/data-sources/{id}
openapi: 3.1.0
info:
  title: Reporter
  description: ''
  version: 1.2.0
servers:
  - url: https://reporter.sandbox.lerian.net
security: []
tags: []
paths:
  /v1/data-sources/{id}:
    get:
      tags:
        - Database Mapping API
      summary: Retrieve a Data Source by id
      description: >-
        Use this endpoint to retrieve the schema structure of a specific data
        source, including tables and fields, to support dynamic filter creation
        during report generation.
      parameters:
        - name: id
          in: path
          description: The unique identifier of the data source that you want to retrieve.
          required: true
          example: midaz_onboarding
          schema:
            type: string
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/XOrganizationId'
      responses:
        '200':
          description: >-
            If the result is successful, you will receive a list with all data
            sources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceDetails'
              example:
                id: midaz_onboarding
                externalName: onboarding
                type: postgresql
                tables:
                  - name: account
                    fields:
                      - id
                      - name
                      - alias
                      - parent_account_id
                      - created_at
                      - updated_at
                  - name: organization
                    fields:
                      - id
                      - legal_name
                      - status
                      - created_at
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Error0009:
                  $ref: '#/components/examples/Error0009'
                Error0011:
                  $ref: '#/components/examples/Error0011'
                Error0012:
                  $ref: '#/components/examples/Error0012'
                Error0015:
                  $ref: '#/components/examples/Error0015'
                Error0016:
                  $ref: '#/components/examples/Error0016'
                Error0017:
                  $ref: '#/components/examples/Error0017'
                Error0018:
                  $ref: '#/components/examples/Error0018'
                Error0019:
                  $ref: '#/components/examples/Error0019'
                Error0031:
                  $ref: '#/components/examples/Error0031'
          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
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
  schemas:
    DataSourceDetails:
      type: object
      description: Detailed information about a specific data source including its schema.
      required:
        - id
        - externalName
        - type
        - tables
      properties:
        id:
          type: string
          description: Unique internal identifier of the data source.
        externalName:
          type: string
          description: Name of the database or collection.
        type:
          type: string
          description: Type of database system (postgresql, mongodb, mysql).
        tables:
          type: array
          description: List of tables/collections in this data source.
          items:
            type: object
            required:
              - name
              - fields
            properties:
              name:
                type: string
                description: Name of the table or collection.
              fields:
                type: array
                description: List of field names available in this table.
                items:
                  type: string
    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.
      description: Response message error.
      required:
        - code
        - title
        - message
  examples:
    Error0009:
      summary: Invalid Path Parameter
      value:
        code: TPL-0009
        title: Invalid Path Parameter
        message: >-
          Path parameters is in an incorrect format. Please check the following
          parameter %v and ensure they meet the required format before trying
          again.
    Error0011:
      summary: Entity Not Found
      value:
        code: TPL-0011
        title: Entity Not Found
        message: >-
          No %v entity was found for the given ID. Please make sure to use the
          correct ID for the entity you are trying to manage.
    Error0012:
      summary: Invalid templateId
      value:
        code: TPL-0012
        title: Invalid templateId
        message: >-
          The specified templateId is not a valid UUID. Please check the value
          passed.
    Error0015:
      summary: Unexpected Fields in the Request
      value:
        code: TPL-0015
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields as per the documentation. The unexpected fields are
          listed in the fields object.
    Error0016:
      summary: Missing Fields in Request
      value:
        code: TPL-0016
        title: Missing Fields in Request
        message: >-
          Your request is missing one or more required fields. Please refer to
          the documentation to ensure all necessary fields are included in your
          request.
    Error0017:
      summary: Bad Request
      value:
        code: TPL-0017
        title: Bad Request
        message: >-
          The server could not understand the request due to malformed syntax.
          Please check the listed fields and try again.
    Error0018:
      summary: Internal Server Error
      value:
        code: TPL-0018
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.
    Error0019:
      summary: Invalid Query Parameter
      value:
        code: TPL-0019
        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.
    Error0031:
      summary: Missing Data Source Table
      value:
        code: TPL-0031
        title: Missing Data Source Table
        message: The data source %v is missing. Please check the value passed.

````