> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalvalidation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Table Pair

> Pair a source and a target Table. Name each Table by a saved Table's ID or give the Table itself, and add the pair's Tests in the same call; the pair, its Tables, and its Tests are saved together or not at all. Or give `test_set_id` to use a test set's join keys and Tests in place of the pair's own. Repeating the request with the same `id` returns the same Table Pair, and the same ID with different content returns 409. Before the first Run, give the Environment's workspace identity read access; `GET /api/v1/fabric/pairs/{resource_id}/read-access` says what it needs.

Requires the GV.APIContributor application role, or a higher role (Owner > Contributor > Reader).



## OpenAPI

````yaml /api/openapi.json post /api/v1/fabric/pairs
openapi: 3.1.0
info:
  description: >-
    General Validation's API for Organization administration, Table Pair and
    Test authoring, Runs, and Result metadata. Microsoft Entra bearer tokens
    authorize every call.
  title: General Validation API
  version: 1.0.0
servers:
  - url: https://api.generalvalidation.com
security: []
tags:
  - description: Saved Fabric Lakehouse and Warehouse Table references.
    name: Tables
  - description: >-
      Source-to-target Table Pairs, join keys, filters, Test Set links, and
      Fabric read-access requirements.
    name: Table Pairs
  - description: Individual validation Tests belonging to a Table Pair or Test Set.
    name: Tests
  - description: Reusable sets of join keys and Tests shared across multiple Table Pairs.
    name: Test Sets
  - description: >-
      Prepare validation Runs, record Fabric job submissions, and read Run
      status and Result metadata.
    name: Runs
  - description: >-
      Read the dedicated Fabric Environment reference and the fixed catalog of
      validation functions.
    name: Environment and Catalog
  - description: >-
      Organization profile, caller role, audit activity, and API workload
      identities.
    name: Organization
  - description: Manage Organization members, roles, and pending invitations.
    name: Members and Invitations
  - description: >-
      Subscription status, free Runs, monthly Run usage, limits, and pricing
      schedule.
    name: Billing
paths:
  /api/v1/fabric/pairs:
    post:
      tags:
        - Table Pairs
      summary: Create a Table Pair
      description: >-
        Pair a source and a target Table. Name each Table by a saved Table's ID
        or give the Table itself, and add the pair's Tests in the same call; the
        pair, its Tables, and its Tests are saved together or not at all. Or
        give `test_set_id` to use a test set's join keys and Tests in place of
        the pair's own. Repeating the request with the same `id` returns the
        same Table Pair, and the same ID with different content returns 409.
        Before the first Run, give the Environment's workspace identity read
        access; `GET /api/v1/fabric/pairs/{resource_id}/read-access` says what
        it needs.


        Requires the GV.APIContributor application role, or a higher role (Owner
        > Contributor > Reader).
      operationId: create_fabric_pair
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PairCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TablePair'
          description: Successful Response
          headers:
            Location:
              schema:
                type: string
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: A valid Microsoft Entra bearer token is required.
        '402':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The organization entitlement does not permit this mutation.
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The authenticated principal does not have the required role.
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The resource does not exist in this tenant.
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The operation conflicts with current resource or Azure state.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The request is syntactically valid but semantically invalid.
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: The bounded application request rate was exceeded.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V1Problem'
          description: A required dependency is temporarily unavailable.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
      security:
        - entraApplication: []
components:
  schemas:
    PairCreate:
      additionalProperties: false
      properties:
        id:
          description: >-
            A new UUID you choose for the Table Pair. Repeating the request with
            the same ID returns the same pair.
          format: uuid
          title: Id
          type: string
        keys:
          description: >-
            Join keys: the columns that match a source row to its target row.
            `VALUE` and `OUTER_VALUE` Tests need them.
          items:
            $ref: '#/components/schemas/KeyMapping'
          maxItems: 16
          title: Keys
          type: array
        name:
          description: The Table Pair's name.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Name
          type: string
        source:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/InlineWarehouseTable'
            - $ref: '#/components/schemas/InlineSqlTable'
            - type: 'null'
          description: >-
            The source Table itself, in place of `source_id`. The API saves it,
            or reuses a saved Table with the same reference.
          title: Source
        source_filters:
          description: >-
            Only source rows that match every filter are compared, in every Test
            of the pair.
          items:
            $ref: '#/components/schemas/Filter'
          maxItems: 32
          title: Source Filters
          type: array
        source_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: The saved source Table's ID. Give this or `source`.
          title: Source Id
        target:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/InlineWarehouseTable'
            - $ref: '#/components/schemas/InlineSqlTable'
            - type: 'null'
          description: The target Table itself, in place of `target_id`.
          title: Target
        target_filters:
          description: >-
            Only target rows that match every filter are compared, in every Test
            of the pair.
          items:
            $ref: '#/components/schemas/Filter'
          maxItems: 32
          title: Target Filters
          type: array
        target_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: The saved target Table's ID. Give this or `target`.
          title: Target Id
        test_set_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            An active test set whose join keys and Tests the pair uses, in place
            of its own. With it, leave `keys` and `tests` empty.
          title: Test Set Id
        tests:
          description: Tests to create with the Table Pair.
          items:
            $ref: '#/components/schemas/TestDefinition'
          maxItems: 100
          title: Tests
          type: array
      required:
        - name
        - id
      title: PairCreate
      type: object
    TablePair:
      additionalProperties: false
      properties:
        id:
          format: uuid
          title: Id
          type: string
        keys:
          description: >-
            Join keys: the columns that match a source row to its target row.
            `VALUE` and `OUTER_VALUE` Tests need them.
          items:
            $ref: '#/components/schemas/KeyMapping'
          maxItems: 16
          title: Keys
          type: array
        name:
          description: The Table Pair's name.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Name
          type: string
        source:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/PairWarehouseTable'
            - $ref: '#/components/schemas/PairSqlTable'
            - $ref: '#/components/schemas/FabricCopyTable'
          description: The source Table.
          title: Source
        source_filters:
          description: >-
            Only source rows that match every filter are compared, in every Test
            of the pair.
          items:
            $ref: '#/components/schemas/Filter'
          maxItems: 32
          title: Source Filters
          type: array
        source_id:
          description: The source Table's ID.
          format: uuid
          title: Source Id
          type: string
        target:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/PairWarehouseTable'
            - $ref: '#/components/schemas/PairSqlTable'
            - $ref: '#/components/schemas/FabricCopyTable'
          description: The target Table.
          title: Target
        target_filters:
          description: >-
            Only target rows that match every filter are compared, in every Test
            of the pair.
          items:
            $ref: '#/components/schemas/Filter'
          maxItems: 32
          title: Target Filters
          type: array
        target_id:
          description: The target Table's ID.
          format: uuid
          title: Target Id
          type: string
        test_set_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            The test set whose join keys and Tests the pair uses. Null when the
            pair has its own.
          title: Test Set Id
      required:
        - name
        - id
        - source_id
        - target_id
        - source
        - target
        - test_set_id
      title: TablePair
      type: object
    V1Problem:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable machine-readable error code, such as `precondition.failed`.
            Branch on this value.
          title: Code
          type: string
        detail:
          description: What went wrong in this request, written for a person.
          title: Detail
          type: string
        diagnostics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            Extra details for some errors, such as `fieldErrors` for an invalid
            request or `requiredRole` for a denied one. Absent when there are
            none.
          title: Diagnostics
        instance:
          description: Path of the request that failed.
          title: Instance
          type: string
        requestId:
          description: >-
            This request's ID, also sent in the `X-Request-Id` response header.
            Quote it when you contact support. A request that sends an
            `X-Request-Id` of 1 to 64 letters, digits, or `_.:-` gets that value
            back.
          title: Requestid
          type: string
        status:
          description: The HTTP status code of this response.
          title: Status
          type: integer
        title:
          description: Short summary of the error code.
          title: Title
          type: string
        type:
          description: Link to the documentation page for this error code.
          title: Type
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
      title: V1Problem
      type: object
    KeyMapping:
      additionalProperties: false
      properties:
        source:
          description: A source column that identifies a row.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Source
          type: string
        target:
          description: The target column that holds the same identifier.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Target
          type: string
      required:
        - source
        - target
      title: KeyMapping
      type: object
    InlineLakehouseTable:
      additionalProperties: false
      properties:
        format:
          const: delta
          description: Always `delta`.
          title: Format
          type: string
        kind:
          const: lakehouse
          default: lakehouse
          description: '`lakehouse`, or omit it.'
          title: Kind
          type: string
        lakehouse_id:
          description: The Lakehouse's item ID.
          format: uuid
          title: Lakehouse Id
          type: string
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: >-
            The Table's name in General Validation. Omit it to use the path
            after `Tables/` with `/` written as `.`: `schema.table`, or `table`
            in a Lakehouse without schemas.
          title: Name
        path:
          description: >-
            The Table's path in the Lakehouse: `Tables/<table>`, or
            `Tables/<schema>/<table>` in a Lakehouse with schemas.
          maxLength: 512
          minLength: 1
          title: Path
          type: string
        version_as_of:
          anyOf:
            - maximum: 9007199254740991
              minimum: 0
              type: integer
            - type: 'null'
          description: >-
            Read this Delta table version at every Run. Omit to read the latest
            version.
          title: Version As Of
        workspace_id:
          description: The Fabric workspace that holds the Lakehouse.
          format: uuid
          title: Workspace Id
          type: string
      required:
        - workspace_id
        - lakehouse_id
        - path
        - format
      title: InlineLakehouseTable
      type: object
    InlineWarehouseTable:
      additionalProperties: false
      properties:
        kind:
          const: warehouse
          title: Kind
          type: string
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: >-
            The Table's name in General Validation. Omit it to use
            `schema.table`.
          title: Name
        schema_name:
          description: The Table's schema, such as `dbo`.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Schema Name
          type: string
        table_name:
          description: The Table's name in the Warehouse.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Table Name
          type: string
        warehouse_id:
          description: The Warehouse's item ID.
          format: uuid
          title: Warehouse Id
          type: string
        warehouse_name:
          description: >-
            The Warehouse's name in Fabric. Validation reads the Table by this
            name.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Warehouse Name
          type: string
        workspace_id:
          description: The Fabric workspace that holds the Warehouse.
          format: uuid
          title: Workspace Id
          type: string
      required:
        - kind
        - workspace_id
        - warehouse_id
        - warehouse_name
        - schema_name
        - table_name
      title: InlineWarehouseTable
      type: object
    InlineSqlTable:
      additionalProperties: false
      description: A SQL database table given with a new Table Pair.
      properties:
        connection_id:
          description: >-
            The Fabric connection to the database. Share it with the
            Environment's workspace identity as a User.
          format: uuid
          title: Connection Id
          type: string
        connector:
          description: >-
            `azure_sql` for Azure SQL Database, `sql_server` for SQL Server,
            `azure_sql_mi` for Azure SQL Managed Instance.
          enum:
            - azure_sql
            - sql_server
            - azure_sql_mi
          title: Connector
          type: string
        kind:
          const: copy
          description: Always `copy`.
          title: Kind
          type: string
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: >-
            The Table's name in General Validation. Omit it to use
            `schema.table`.
          title: Name
        schema_name:
          description: The table's schema, such as `dbo`.
          maxLength: 128
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Schema Name
          type: string
        table_name:
          description: The table's name in that schema.
          maxLength: 128
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Table Name
          type: string
      required:
        - kind
        - connector
        - connection_id
        - schema_name
        - table_name
      title: InlineSqlTable
      type: object
    Filter:
      additionalProperties: false
      properties:
        column:
          description: The column to compare.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Column
          type: string
        operator:
          enum:
            - '='
            - '!='
            - <
            - <=
            - '>'
            - '>='
            - in
            - is_null
            - is_not_null
          title: Operator
          type: string
        value:
          anyOf:
            - maxLength: 1024
              type: string
            - type: boolean
            - type: integer
            - type: number
            - $ref: '#/components/schemas/NumericLiteral'
            - items:
                anyOf:
                  - maxLength: 1024
                    type: string
                  - type: boolean
                  - type: integer
                  - type: number
                  - $ref: '#/components/schemas/NumericLiteral'
              maxItems: 100
              minItems: 1
              type: array
            - type: 'null'
          description: >-
            A string, number, boolean, or exact decimal. `in` takes a list of 1
            to 100 of them; `is_null` and `is_not_null` take none.
          title: Value
      required:
        - column
        - operator
      title: Filter
      type: object
    TestDefinition:
      additionalProperties: false
      properties:
        evidence_limit:
          default: 100
          description: >-
            How many mismatched rows a row or set Test saves to your Results
            Lakehouse. 0 saves none; it never changes the verdict.
          maximum: 10000
          minimum: 0
          title: Evidence Limit
          type: integer
        function:
          description: The validation function. `GET /api/v1/fabric/catalog` lists them.
          enum:
            - COUNT_ROWS
            - COUNT
            - COUNT_DISTINCT
            - MIN
            - MAX
            - AVG
            - SUM
            - VALUE
            - OUTER_VALUE
            - SET_A_IN_B
            - SET_B_IN_A
            - SET_A_EQUALS_B
          title: Function
          type: string
        max_bad_records:
          default: 0
          description: >-
            How many mismatches a row or set Test can have and still pass.
            Aggregate Tests accept only 0.
          maximum: 9007199254740991
          minimum: 0
          title: Max Bad Records
          type: integer
        source_column:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: The source column. Omit for `COUNT_ROWS`.
          title: Source Column
        target_column:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: The target column. Omit for `COUNT_ROWS`.
          title: Target Column
        tolerance:
          default: 0
          description: >-
            The largest absolute difference that still passes, for aggregate and
            row Tests. 0 requires exact equality; set Tests accept only 0.
          maximum: 1000000000000000
          minimum: 0
          title: Tolerance
          type: number
      required:
        - function
      title: TestDefinition
      type: object
    PairWarehouseTable:
      additionalProperties: false
      description: 'A Table Pair''s Warehouse side as the API returns it: its saved Table.'
      properties:
        kind:
          const: warehouse
          title: Kind
          type: string
        name:
          description: The Table's name in General Validation.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Name
          type: string
        schema_name:
          description: The Table's schema, such as `dbo`.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Schema Name
          type: string
        table_name:
          description: The Table's name in the Warehouse.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Table Name
          type: string
        warehouse_id:
          description: The Warehouse's item ID.
          format: uuid
          title: Warehouse Id
          type: string
        warehouse_name:
          description: >-
            The Warehouse's name in Fabric. Validation reads the Table by this
            name.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Warehouse Name
          type: string
        workspace_id:
          description: The Fabric workspace that holds the Warehouse.
          format: uuid
          title: Workspace Id
          type: string
      required:
        - kind
        - workspace_id
        - warehouse_id
        - warehouse_name
        - schema_name
        - table_name
        - name
      title: PairWarehouseTable
      type: object
    PairSqlTable:
      description: 'A Table Pair''s SQL database side as the API returns it: its saved Table.'
      properties:
        connection_id:
          description: The Fabric connection to the database.
          format: uuid
          title: Connection Id
          type: string
        connector:
          description: >-
            `azure_sql` for Azure SQL Database, `sql_server` for SQL Server,
            `azure_sql_mi` for Azure SQL Managed Instance.
          enum:
            - azure_sql
            - sql_server
            - azure_sql_mi
          title: Connector
          type: string
        kind:
          const: copy
          description: Always `copy`.
          title: Kind
          type: string
        name:
          description: The Table's name in General Validation.
          maxLength: 255
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Name
          type: string
        schema_name:
          description: The table's schema, such as `dbo`.
          maxLength: 128
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Schema Name
          type: string
        table_name:
          description: The table's name in that schema.
          maxLength: 128
          minLength: 1
          pattern: ^[^\x00-\x1f\x7f]+$
          title: Table Name
          type: string
      required:
        - kind
        - connector
        - connection_id
        - schema_name
        - table_name
        - name
      title: PairSqlTable
      type: object
    FabricCopyTable:
      description: A Table a connector prepares in the app. Create it in the app.
      properties:
        connector:
          description: The connector that prepares the Table.
          title: Connector
          type: string
        id:
          format: uuid
          title: Id
          type: string
        kind:
          const: copy
          title: Kind
          type: string
        name:
          description: The Table's name in General Validation.
          title: Name
          type: string
      required:
        - id
        - kind
        - connector
        - name
      title: FabricCopyTable
      type: object
    NumericLiteral:
      additionalProperties: false
      description: An exact decimal, for filter values a JSON number cannot hold exactly.
      properties:
        number:
          maxLength: 128
          pattern: ^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$
          title: Number
          type: string
      required:
        - number
      title: NumericLiteral
      type: object
  securitySchemes:
    entraApplication:
      bearerFormat: JWT
      description: >-
        A Microsoft Entra token for your own service principal or managed
        identity, not a signed-in person. Request the .default scope and assign
        it the GV.APIReader, GV.APIContributor, or GV.APIOwner role.
      scheme: bearer
      type: http
      x-gv-app-roles:
        - GV.APIReader
        - GV.APIContributor
        - GV.APIOwner
      x-gv-audience: 78d5d8af-9dd6-49dd-b06c-38c3a3c707af
      x-gv-scope: api://78d5d8af-9dd6-49dd-b06c-38c3a3c707af/.default
      x-gv-token-url-template: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.