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

# Get connection schema

> Use this endpoint to retrieve all discovered table schemas for a specific connection.



## OpenAPI

````yaml /en/openapi/v3-current/matcher.yaml get /v1/discovery/connections/{connectionId}/schema
openapi: 3.1.0
info:
  title: Matcher APIs
  description: >-
    Complete API reference for the Matcher reconciliation engine, providing
    automated transaction matching between Midaz Ledger and external systems.
  version: v2.1.1
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/discovery/connections/{connectionId}/schema:
    get:
      tags:
        - Discovery
      summary: Get connection schema
      description: >-
        Use this endpoint to retrieve all discovered table schemas for a
        specific connection.
      operationId: getDiscoveryConnectionSchema
      parameters:
        - description: A unique identifier for tracing the request across services.
          in: header
          name: X-Request-Id
          schema:
            type: string
        - description: The unique identifier of the connection.
          in: path
          name: connectionId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Schema for the connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionSchemaResponse'
        '400':
          description: Invalid connection ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The request lacks valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Connection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An unexpected error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ConnectionSchemaResponse:
      description: Discovered table schemas for a connection
      properties:
        connectionId:
          description: Identifier of the connection these schemas belong to
          type: string
        tables:
          description: Discovered tables and their column definitions
          items:
            $ref: '#/components/schemas/SchemaTableResponse'
          type: array
      type: object
    ErrorResponse:
      description: Standard error response returned by all API endpoints
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: HTTP status code as a string.
          example: '404'
        title:
          type: string
          description: Error type identifier.
          example: not_found
        message:
          type: string
          description: Human-readable error message with details.
          example: context not found
        error:
          type: string
          description: Deprecated. Error message for backward compatibility.
          deprecated: true
        details:
          description: Additional error context as key-value pairs
          additionalProperties: {}
          type: object
    SchemaTableResponse:
      description: A discovered table within a connection
      properties:
        tableName:
          description: Name of the table
          type: string
        columns:
          description: Columns in the table
          items:
            $ref: '#/components/schemas/SchemaColumnResponse'
          type: array
      type: object
    SchemaColumnResponse:
      description: A column within a discovered table
      properties:
        name:
          description: Column name
          type: string
        type:
          description: Column data type
          type: string
        nullable:
          description: Whether the column accepts null values
          type: boolean
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````