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

# Create discovery connection

> Provisions a Fetcher connection scoped to Matcher and synchronizes the local discovery cache.



## OpenAPI

````yaml en/openapi/v3-current/matcher.yaml post /v1/discovery/connections
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: 4.1.0
  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:
    post:
      tags:
        - Discovery
      summary: Create discovery connection
      description: >-
        Provisions a Fetcher connection scoped to Matcher and synchronizes the
        local discovery cache.
      operationId: createDiscoveryConnection
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionProvisioningRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionResponse'
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    ConnectionProvisioningRequest:
      additionalProperties: false
      properties:
        configName:
          description: Connection configuration name
          examples:
            - prod-ledger-db
          minLength: 1
          type: string
        databaseName:
          description: Database name
          examples:
            - ledger
          minLength: 1
          type: string
        databaseType:
          description: >-
            Database engine type; canonical token or a common alias (e.g.
            postgres -> POSTGRESQL, mysql -> MYSQL)
          examples:
            - POSTGRESQL
          minLength: 1
          type: string
        host:
          description: Database host
          examples:
            - db.internal.example.com
          minLength: 1
          type: string
        password:
          type: string
        port:
          description: Database TCP port (1-65535)
          examples:
            - 5432
          format: int64
          maximum: 65535
          minimum: 1
          type: integer
        schema:
          description: Optional schema/namespace within the database
          examples:
            - public
          type: string
        userName:
          description: Database user name the connection authenticates as
          examples:
            - matcher_ro
          minLength: 1
          type: string
      required:
        - configName
        - databaseType
        - host
        - port
        - databaseName
        - userName
      type: object
    ConnectionResponse:
      description: A discovered Fetcher database connection
      properties:
        id:
          description: Internal identifier for the connection
          type: string
        configName:
          description: Name of the Fetcher configuration that produced this connection
          type: string
        databaseType:
          description: Type of database (e.g. postgres, mysql)
          type: string
        status:
          description: Current connection status
          type: string
        schemaDiscovered:
          description: Whether the table schema has been discovered for this connection
          type: boolean
        lastSeenAt:
          description: Timestamp when this connection was last observed in Fetcher
          type: string
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````