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

# Prepare a Run

> Freeze the Table Pair and its Tests into a new Run and return the values that start it in Fabric. Repeating the request with the same Run ID for the same Table Pair returns the same Run without its report token, which `:regenerate-report-token` replaces until the Run's job starts; the same ID for another pair returns 409. A pipeline can name the pair by its `source` and `target` Tables and their filters in place of `pair_id`: the Run uses the one active Table Pair that compares them, or, with `test_set_id`, creates that pair the first time. A call that no Table Pair matches returns 422 without `test_set_id`, and a call that more than one Table Pair matches returns 409; give `pair_id` then. The Run's `charge` is decided here. Returns 402 `billing.free_runs_used` when the Organization has used its free Runs and has no subscription in effect, and 402 `billing.run_limit_reached` when its metered Runs this month have reached its monthly limit, 10,000 unless an Owner changed it.

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



## OpenAPI

````yaml /api/openapi.json post /api/v1/fabric/runs
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/runs:
    post:
      tags:
        - Runs
      summary: Prepare a Run
      description: >-
        Freeze the Table Pair and its Tests into a new Run and return the values
        that start it in Fabric. Repeating the request with the same Run ID for
        the same Table Pair returns the same Run without its report token, which
        `:regenerate-report-token` replaces until the Run's job starts; the same
        ID for another pair returns 409. A pipeline can name the pair by its
        `source` and `target` Tables and their filters in place of `pair_id`:
        the Run uses the one active Table Pair that compares them, or, with
        `test_set_id`, creates that pair the first time. A call that no Table
        Pair matches returns 422 without `test_set_id`, and a call that more
        than one Table Pair matches returns 409; give `pair_id` then. The Run's
        `charge` is decided here. Returns 402 `billing.free_runs_used` when the
        Organization has used its free Runs and has no subscription in effect,
        and 402 `billing.run_limit_reached` when its metered Runs this month
        have reached its monthly limit, 10,000 unless an Owner changed it.


        Requires the GV.APIContributor application role, or a higher role (Owner
        > Contributor > Reader).
      operationId: prepare_fabric_run
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunPrepare'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreparedFabricRun'
          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:
    RunPrepare:
      additionalProperties: false
      properties:
        id:
          description: >-
            A new UUID you choose for the Run. Repeating the request with the
            same ID returns the same Run.
          format: uuid
          title: Id
          type: string
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[^\x00-\x1f\x7f]+$
              type: string
            - type: 'null'
          description: >-
            With `source`, the name of a Table Pair this call creates. Omit it
            to use `<source> to <target>`, each Table's name followed by ` where
            ` and its filters when it has any, or `<source> to <target>` without
            the filters when that name is longer than 255 characters.
          title: Name
        pair_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            The Table Pair to run. It needs at least one Test. Give this, or the
            pair itself as `source` and `target`.
          title: Pair Id
        source:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/InlineWarehouseTable'
            - $ref: '#/components/schemas/InlineSqlTable'
            - type: 'null'
          description: >-
            In place of `pair_id`, the source Table as `POST
            /api/v1/fabric/pairs` takes it. The Run uses the active Table Pair
            that compares these Tables with the same filters, in any order, and
            creates it when none does and `test_set_id` is given. The prepared
            Run's `pair_id` names that pair.
          title: Source
        source_filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/Filter'
              maxItems: 32
              type: array
            - type: 'null'
          description: With `source`, the filters on source rows. Omit for none.
          title: Source Filters
        target:
          anyOf:
            - $ref: '#/components/schemas/InlineLakehouseTable'
            - $ref: '#/components/schemas/InlineWarehouseTable'
            - $ref: '#/components/schemas/InlineSqlTable'
            - type: 'null'
          description: With `source`, the target Table.
          title: Target
        target_filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/Filter'
              maxItems: 32
              type: array
            - type: 'null'
          description: With `source`, the filters on target rows. Omit for none.
          title: Target Filters
        test_set_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            With `source`, the test set whose join keys and Tests a Table Pair
            that this call creates uses. A Table Pair that already compares
            these Tables keeps the Tests it has, and this is not used.
          title: Test Set Id
      required:
        - id
      title: RunPrepare
      type: object
    PreparedFabricRun:
      properties:
        alerted_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When an alert email named this Run because its Table Pair stopped
            passing, or null.
          title: Alerted At
        charge:
          description: >-
            What the Run was granted when it was prepared: `free` uses one of
            the Organization's free Runs, `unmetered` runs under a plan in
            effect, and `metered` is for a plan with Marketplace meters. It is
            charged only if every Test returns a verdict.
          enum:
            - free
            - metered
            - unmetered
          title: Charge
          type: string
        config:
          $ref: '#/components/schemas/RunConfig'
          description: The Table Pair and Tests this Run froze when it was prepared.
        created_at:
          format: date-time
          title: Created At
          type: string
        error_code:
          anyOf:
            - enum:
                - submission_unknown
                - submission_rejected
                - no_report
                - fabric_job_failed
                - fabric_job_cancelled
                - invalid_arguments
                - invalid_config
                - run_reservation_failed
                - artifact_write_failed
                - summary_too_large
                - execution_failed
              type: string
            - type: 'null'
          description: >-
            Why the Run has no Result. `no_report` means nothing recorded a
            Result or failure within 24 hours of preparing the Run; a Result
            recorded later still replaces it.
          title: Error Code
        id:
          format: uuid
          title: Id
          type: string
        job_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: The Fabric job instance that runs it, once recorded.
          title: Job Id
        pair_id:
          description: The Table Pair this Run validates.
          format: uuid
          title: Pair Id
          type: string
        payload_base64:
          description: >-
            Pass unchanged as the validation pipeline's `payload_base64`
            parameter. Only `POST /api/v1/fabric/runs` returns it.
          title: Payload Base64
          type: string
        provenance:
          const: user_reported
          default: user_reported
          description: >-
            Reported by an authorized caller; the SaaS does not attest the
            Fabric computation.
          title: Provenance
          type: string
        report:
          anyOf:
            - $ref: '#/components/schemas/RunReportCredential'
            - type: 'null'
          description: >-
            Pass `token` unchanged as the validation pipeline's `report_token`
            parameter. Returned only by the call that created the Run; a repeat
            with the same Run ID omits it. `POST
            /api/v1/fabric/runs/{run_id}:regenerate-report-token` issues a new
            one until the Run's job starts.
        result:
          anyOf:
            - $ref: '#/components/schemas/RunResult'
            - type: 'null'
          description: The verdict and each Test's Result, once validation reports them.
        settings:
          $ref: '#/components/schemas/FabricSettings'
          description: The Environment the Run was prepared for.
        status:
          description: >-
            `prepared` or `submitted` while the Run is on its way; `passed`,
            `failed`, or `error` once it ends.
          enum:
            - prepared
            - submitted
            - passed
            - failed
            - error
          title: Status
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - pair_id
        - status
        - config
        - settings
        - job_id
        - error_code
        - result
        - charge
        - alerted_at
        - created_at
        - updated_at
        - payload_base64
      title: PreparedFabricRun
      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
    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
    RunConfig:
      description: The Table Pair and Tests this Run froze when it was prepared.
      properties: {}
      required: []
      title: RunConfig
      type: object
    RunReportCredential:
      additionalProperties: false
      properties:
        token:
          description: >-
            A secret that lets this Run's job report its outcome. Keep it out of
            logs.
          pattern: ^[0-9a-f]{64}$
          title: Token
          type: string
      required:
        - token
      title: RunReportCredential
      type: object
    RunResult:
      description: The Run's verdict and each Test's Result.
      properties:
        pair_id:
          format: uuid
          title: Pair Id
          type: string
        results:
          description: One Result for each Test.
          items:
            $ref: '#/components/schemas/TestResult'
          maxItems: 100
          minItems: 1
          title: Results
          type: array
        run_id:
          format: uuid
          title: Run Id
          type: string
        status:
          description: >-
            `passed` when every Test passed, `failed` when a Test failed and
            none errored, and `error` when a Test errored.
          enum:
            - passed
            - failed
            - error
          title: Status
          type: string
      required:
        - run_id
        - pair_id
        - status
        - results
      title: RunResult
      type: object
    FabricSettings:
      additionalProperties: false
      properties:
        api_connection_id:
          description: >-
            The connection the validation pipeline uses to report each Run's
            outcome to General Validation.
          format: uuid
          title: Api Connection Id
          type: string
        copy_pipeline_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            The Copy pipeline, installed by default by the installer notebook. A
            Run of a Copy Table starts it.
          title: Copy Pipeline Id
        lakehouse_id:
          description: >-
            The Results Lakehouse in that workspace, where Runs save exact
            values and mismatch evidence.
          format: uuid
          title: Lakehouse Id
          type: string
        pipeline_id:
          description: >-
            The validation pipeline. Start it with Fabric's job API to start a
            Run.
          format: uuid
          title: Pipeline Id
          type: string
        run_connection_id:
          description: >-
            The connection the validation pipeline uses to run the Spark Job
            Definition.
          format: uuid
          title: Run Connection Id
          type: string
        sample_data:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether the installer wrote sample Delta tables into the Results
            Lakehouse for a quick first Run.
          title: Sample Data
        spark_job_definition_id:
          description: The Spark Job Definition that runs validation.
          format: uuid
          title: Spark Job Definition Id
          type: string
        workspace_id:
          description: The Environment's dedicated Fabric workspace.
          format: uuid
          title: Workspace Id
          type: string
        workspace_identity_id:
          description: >-
            The workspace identity's service principal object ID. Validation
            reads Tables as this identity.
          format: uuid
          title: Workspace Identity Id
          type: string
      required:
        - workspace_id
        - lakehouse_id
        - spark_job_definition_id
        - pipeline_id
        - run_connection_id
        - api_connection_id
        - workspace_identity_id
      title: FabricSettings
      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
    TestResult:
      additionalProperties: false
      properties:
        compared_count:
          anyOf:
            - maximum: 9007199254740991
              minimum: 0
              type: integer
            - type: 'null'
          description: How much the Test compared, when it counts that.
          title: Compared Count
        function:
          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
        mismatch_count:
          anyOf:
            - maximum: 9007199254740991
              minimum: 0
              type: integer
            - type: 'null'
          description: How many mismatches the Test found, when it counts them.
          title: Mismatch Count
        reason_code:
          description: Why the Test has this status.
          enum:
            - equal
            - different
            - no_common_keys
            - values_equal
            - values_differ
            - set_contained
            - set_not_contained
            - sets_equal
            - sets_differ
            - within_threshold
            - read_failed
            - copy_failed
            - copy_configuration_changed
            - connection_not_shared
            - column_name_refused
            - execution_failed
            - artifact_write_failed
          title: Reason Code
          type: string
        status:
          enum:
            - passed
            - failed
            - error
          title: Status
          type: string
        test_id:
          format: uuid
          title: Test Id
          type: string
      required:
        - test_id
        - function
        - status
        - reason_code
      title: TestResult
      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.