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

# Start a connection extraction

> Use this endpoint to create an extraction request for a discovered connection and submit it to Fetcher for the authenticated tenant.



## OpenAPI

````yaml en/openapi/v3-current/matcher.yaml post /v1/discovery/connections/{connectionId}/extractions
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.3.0
  license:
    name: Lerian Studio General License
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/discovery/connections/{connectionId}/extractions:
    post:
      tags:
        - Discovery
      summary: Start a connection extraction
      description: >-
        Use this endpoint to create an extraction request for a discovered
        connection and submit it to Fetcher for the authenticated tenant.
      operationId: startDiscoveryExtraction
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartExtractionRequest'
        description: Extraction request payload
        required: true
      responses:
        '201':
          description: Extraction request created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionRequestResponse'
        '400':
          description: Invalid request
          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'
        '503':
          description: Fetcher service is unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    StartExtractionRequest:
      description: >-
        Request payload for starting a data extraction from a discovered
        connection
      properties:
        tables:
          description: >-
            Tables to extract data from, keyed by table name; at least one entry
            is required
          additionalProperties:
            $ref: '#/components/schemas/ExtractionTableRequest'
          minProperties: 1
          type: object
        startDate:
          description: Start of the date range to extract (RFC 3339)
          type: string
        endDate:
          description: End of the date range to extract (RFC 3339)
          type: string
        filters:
          $ref: '#/components/schemas/ExtractionFilters'
      required:
        - tables
      type: object
    ExtractionRequestResponse:
      description: An extraction request submitted to Fetcher
      properties:
        id:
          description: Internal identifier for the extraction request
          type: string
        connectionId:
          description: Connection this extraction was submitted to
          type: string
        status:
          description: Current lifecycle status of the extraction
          type: string
        ingestionJobId:
          description: Job identifier returned by Fetcher
          type: string
        startDate:
          description: Start of the extracted date range
          type: string
        endDate:
          description: End of the extracted date range
          type: string
        tables:
          description: Per-table extraction status
          additionalProperties:
            $ref: '#/components/schemas/ExtractionTableResponse'
          type: object
        filters:
          $ref: '#/components/schemas/ExtractionFilters'
        errorMessage:
          description: Error details if the extraction failed
          type: string
        createdAt:
          description: Timestamp when the extraction was requested
          type: string
        updatedAt:
          description: Timestamp of the last status update
          type: string
      type: object
    ErrorResponse:
      description: Standard error response returned by all API endpoints
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Stable application error code.
          example: MTCH-0001
        title:
          type: string
          description: Human-readable error title.
          example: Bad Request
        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
    ExtractionTableRequest:
      description: Column selection for a single table in an extraction request
      properties:
        columns:
          description: >-
            Optional explicit column projection; when empty or omitted, all
            columns are extracted
          items:
            type: string
          type: array
      type: object
    ExtractionFilters:
      description: Optional row-level filters for an extraction
      properties:
        equals:
          description: >-
            Key-value pairs where all specified fields must equal the given
            values
          additionalProperties:
            type: string
          type: object
      type: object
    ExtractionTableResponse:
      description: Extraction status for a single table
      properties:
        columns:
          description: Columns included in the extraction
          items:
            type: string
          type: array
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````