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

# Validate a connection schema

> Validates mapped datasource, table, and field identifiers before a connection is used.



## OpenAPI

````yaml en/openapi/v3-current/connections.yaml post /v1/management/connections/validate-schema
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian
    url: https://github.com/LerianStudio/fetcher/discussions
  description: API documentation for the Fetcher Manager component
  license:
    identifier: Elastic-2.0
    name: Elastic License 2.0 (Source Available)
  title: Fetcher Manager API
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - description: Database connection lifecycle and schema operations.
    name: Connections
  - description: Legacy connection assignment and migration operations.
    name: Migration
  - description: Data extraction job creation and status operations.
    name: Fetcher
paths:
  /v1/management/connections/validate-schema:
    post:
      tags:
        - Connections
      summary: Validate a connection schema
      description: >-
        Validates mapped datasource, table, and field identifiers before a
        connection is used.
      operationId: validate-schema
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaValidationRequest'
        description: Datasource, table, and field mappings to validate.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaValidationResponse'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
components:
  schemas:
    SchemaValidationRequest:
      additionalProperties: false
      properties:
        mappedFields:
          additionalProperties:
            additionalProperties:
              items:
                type: string
              type:
                - array
                - 'null'
            type: object
          description: >-
            Maps each datasource configuration name to tables and the fields
            required from each table.
          examples:
            - midaz_onboarding:
                accounts:
                  - id
                  - name
          type: object
      required:
        - mappedFields
      type: object
    SchemaValidationResponse:
      additionalProperties: false
      properties:
        errors:
          description: Validation failures, omitted when every requested field is valid.
          examples:
            - - dataSourceId: midaz_onboarding
                field: external_id
                table: accounts
                type: FIELD_NOT_FOUND
          items:
            $ref: '#/components/schemas/SchemaValidationError'
          type:
            - array
            - 'null'
        message:
          description: Human-readable schema validation result.
          examples:
            - Schema validation completed successfully
          type: string
        status:
          description: Schema validation outcome.
          examples:
            - success
          type: string
      required:
        - status
        - message
      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
    SchemaValidationError:
      additionalProperties: false
      properties:
        dataSourceId:
          description: Datasource configuration name where validation failed.
          examples:
            - midaz_onboarding
          type: string
        field:
          description: Field that could not be found, when applicable.
          examples:
            - external_id
          type: string
        table:
          description: Table or collection where validation failed.
          examples:
            - accounts
          type: string
        type:
          description: Machine-readable validation failure type.
          examples:
            - FIELD_NOT_FOUND
          type: string
      required:
        - type
        - dataSourceId
      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:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````