---
title: "POST /api/ee/transform-test"
method: POST
path: "/api/ee/transform-test"
tags: ["/api/ee/transform-test"]
---

# POST /api/ee/transform-test

`POST /api/ee/transform-test`

## Request

- Base URL: `` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ee/transform-test`
- Auth: API key in header `X-API-Key`

Create a transform test.

## Request body

- MetabaseEnterpriseTransformTestingSchemaTransformTestCreate: What a client sends to create a transform test.
  - `description` string, nullable
  - `expectations` MetabaseEnterpriseTransformTestingSchemaExpectation[], required: The checks run against the transform's output. Names must be unique within a test, case-sensitively.
    - union: A check on the output of the transform under test.
      - union: A check that the transform output holds exactly the declared rows, over exactly the declared columns.
        - object: Test data returned by a SQL query run against the transform's source database.
          - `format` 'sql', required
          - `name` string, required: Schema for a string that cannot be blank.
          - `sql` string, required: Schema for a string that cannot be blank.
          - `type` 'equals', required
        - object: Test data written out in the request: the columns, with the type each is cast to, and the rows. A row's keys are the declared column names, exactly: the query reads each row by those names, so a key that names no column would be dropped and a column a row leaves out would become a null cell, neither of which the author asked for.
          - `columns` MetabaseEnterpriseTransformTestingSchemaColumn[], required
            - `cast_type` string, required: Schema for a string that cannot be blank.
            - `name` string, required: Schema for a string that cannot be blank.
          - `format` 'rows', required
          - `name` string, required: Schema for a string that cannot be blank.
          - `rows` MetabaseEnterpriseTransformTestingSchemaRow[], required
          - `type` 'equals', required
      - MetabaseEnterpriseTransformTestingSchemaExpectationEmpty: A check that a SQL query over the transform output returns no rows.
        - `name` string, required: Schema for a string that cannot be blank.
        - `sql` string, required: Schema for a string that cannot be blank.
        - `type` 'empty', required
  - `inputs` MetabaseEnterpriseTransformTestingSchemaInput[], required: Test data for the tables the transform reads. Every table it reads needs one, and an input for a table it does not read is refused.
    - union: An input table of the transform under test, replaced with test data.
      - object: Test data returned by a SQL query run against the transform's source database.
        - `format` 'sql', required
        - `sql` string, required: Schema for a string that cannot be blank.
        - `table` MetabaseEnterpriseTransformTestingSchemaTable, required: A table read by the transform under test, by schema and name.
          - `name` string, required: Schema for a string that cannot be blank.
          - `schema` string: Schema for a string that cannot be blank.
      - object: Test data written out in the request: the columns, with the type each is cast to, and the rows. A row's keys are the declared column names, exactly: the query reads each row by those names, so a key that names no column would be dropped and a column a row leaves out would become a null cell, neither of which the author asked for.
        - `columns` MetabaseEnterpriseTransformTestingSchemaColumn[], required
          - `cast_type` string, required: Schema for a string that cannot be blank.
          - `name` string, required: Schema for a string that cannot be blank.
        - `format` 'rows', required
        - `rows` MetabaseEnterpriseTransformTestingSchemaRow[], required
        - `table` MetabaseEnterpriseTransformTestingSchemaTable, required: A table read by the transform under test, by schema and name.
          - `name` string, required: Schema for a string that cannot be blank.
          - `schema` string: Schema for a string that cannot be blank.
  - `name` string, required: Schema for a string that cannot be blank.
  - `transform_id` integer, required: Valid Transform ID

## Response `2XX`

Successful response

- MetabaseEnterpriseTransformTestingSchemaTransformTest: A saved transform test: the transform it covers, the inputs that stand in for its source tables, and the expectations checked against its output.
  - `created_at` string, date-time, required: value must be a valid date/time/datetime
  - `creator_id` integer, required: Valid User ID
  - `description` string, nullable
  - `entity_id` string, required
  - `expectations` MetabaseEnterpriseTransformTestingSchemaExpectation[], required: The checks run against the transform's output. Names must be unique within a test, case-sensitively.
    - union: A check on the output of the transform under test.
      - union: A check that the transform output holds exactly the declared rows, over exactly the declared columns.
        - object: Test data returned by a SQL query run against the transform's source database.
          - `format` 'sql', required
          - `name` string, required: Schema for a string that cannot be blank.
          - `sql` string, required: Schema for a string that cannot be blank.
          - `type` 'equals', required
        - object: Test data written out in the request: the columns, with the type each is cast to, and the rows. A row's keys are the declared column names, exactly: the query reads each row by those names, so a key that names no column would be dropped and a column a row leaves out would become a null cell, neither of which the author asked for.
          - `columns` MetabaseEnterpriseTransformTestingSchemaColumn[], required
            - `cast_type` string, required: Schema for a string that cannot be blank.
            - `name` string, required: Schema for a string that cannot be blank.
          - `format` 'rows', required
          - `name` string, required: Schema for a string that cannot be blank.
          - `rows` MetabaseEnterpriseTransformTestingSchemaRow[], required
          - `type` 'equals', required
      - MetabaseEnterpriseTransformTestingSchemaExpectationEmpty: A check that a SQL query over the transform output returns no rows.
        - `name` string, required: Schema for a string that cannot be blank.
        - `sql` string, required: Schema for a string that cannot be blank.
        - `type` 'empty', required
  - `id` integer, required: value must be an integer greater than zero.
  - `inputs` MetabaseEnterpriseTransformTestingSchemaInput[], required: Test data for the tables the transform reads. Every table it reads needs one, and an input for a table it does not read is refused.
    - union: An input table of the transform under test, replaced with test data.
      - object: Test data returned by a SQL query run against the transform's source database.
        - `format` 'sql', required
        - `sql` string, required: Schema for a string that cannot be blank.
        - `table` MetabaseEnterpriseTransformTestingSchemaTable, required: A table read by the transform under test, by schema and name.
          - `name` string, required: Schema for a string that cannot be blank.
          - `schema` string: Schema for a string that cannot be blank.
      - object: Test data written out in the request: the columns, with the type each is cast to, and the rows. A row's keys are the declared column names, exactly: the query reads each row by those names, so a key that names no column would be dropped and a column a row leaves out would become a null cell, neither of which the author asked for.
        - `columns` MetabaseEnterpriseTransformTestingSchemaColumn[], required
          - `cast_type` string, required: Schema for a string that cannot be blank.
          - `name` string, required: Schema for a string that cannot be blank.
        - `format` 'rows', required
        - `rows` MetabaseEnterpriseTransformTestingSchemaRow[], required
        - `table` MetabaseEnterpriseTransformTestingSchemaTable, required: A table read by the transform under test, by schema and name.
          - `name` string, required: Schema for a string that cannot be blank.
          - `schema` string: Schema for a string that cannot be blank.
  - `name` string, required: Schema for a string that cannot be blank.
  - `transform_id` integer, required: Valid Transform ID
  - `updated_at` string, date-time, required: value must be a valid date/time/datetime

## Other responses

- `4XX`: Client error response
- `5XX`: Server error response

## Changes

- **2026-11-04** `2e178f5a7934`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/metabase/apis/metabase-api/changes/api/ee/transform-test/post.md)

---

[API](https://skmtc.dev/metabase/apis/metabase-api.md) - [All operations](https://skmtc.dev/metabase/apis/metabase-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metabase/apis/metabase-api/revisions/2e178f5a7934?raw)
