---
title: "Create a test in a project."
method: POST
path: "/projects/{projectId}/tests"
tags: ["Projects"]
---

# Create a test in a project.

`POST /projects/{projectId}/tests`

Create a test.

## Path parameters

- `projectId` string, uuid, required

## Request body

- TestBase
  - `id` string, uuid, required — The test id.
  - `number` integer, required — The test number.
  - `name` string, required — The test name.
  - `dateCreated` string, date-time, required — The creation date.
  - `dateUpdated` string, date-time, required — The last updated date.
  - `description` object, nullable, required — The test description.
  - `evaluationWindow` number, nullable — The evaluation window in seconds. Only applies to tests that use production data.
  - `delayWindow` number, nullable — The delay window in seconds. Only applies to tests that use production data.
  - `type` 'integrity' | 'consistency' | 'performance', required — The test type.
  - `subtype` 'anomalousColumnCount' | 'characterLength' | 'classImbalanceRatio' | 'expectColumnAToBeInColumnB' | 'columnAverage' | 'columnDrift' | 'columnStatistic' | 'columnValuesMatch' | 'conflictingLabelRowCount' | 'containsPii' | 'containsValidUrl' | 'correlatedFeatureCount' | 'customMetricThreshold' | 'duplicateRowCount' | 'emptyFeature' | 'emptyFeatureCount' | 'driftedFeatureCount' | 'featureMissingValues' | 'featureValueValidation' | 'greatExpectations' | 'groupByColumnStatsCheck' | 'illFormedRowCount' | 'isCode' | 'isJson' | 'llmRubricThresholdV2' | 'labelDrift' | 'metricThreshold' | 'newCategoryCount' | 'newLabelCount' | 'nullRowCount' | 'rowCount' | 'ppScoreValueValidation' | 'quasiConstantFeature' | 'quasiConstantFeatureCount' | 'sqlQuery' | 'dtypeValidation' | 'sentenceLength' | 'sizeRatio' | 'specialCharactersRatio' | 'stringValidation' | 'trainValLeakageRowCount', required — The test subtype.
  - `creatorId` string, uuid, nullable, required — The test creator id.
  - `originProjectVersionId` string, uuid, nullable, required — The project version (commit) id where the test was created.
  - `thresholds` object[], required
    - `measurement` string — The measurement to be evaluated.
    - `insightName` 'characterLength' | 'classImbalance' | 'expectColumnAToBeInColumnB' | 'columnAverage' | 'columnDrift' | 'columnValuesMatch' | 'confidenceDistribution' | 'conflictingLabelRowCount' | 'containsPii' | 'containsValidUrl' | 'correlatedFeatures' | 'customMetric' | 'duplicateRowCount' | 'emptyFeatures' | 'featureDrift' | 'featureProfile' | 'greatExpectations' | 'groupByColumnStatsCheck' | 'illFormedRowCount' | 'isCode' | 'isJson' | 'llmRubricV2' | 'labelDrift' | 'metrics' | 'newCategories' | 'newLabels' | 'nullRowCount' | 'ppScore' | 'quasiConstantFeatures' | 'sentenceLength' | 'sizeRatio' | 'specialCharacters' | 'stringValidation' | 'trainValLeakageRowCount' — The insight name to be evaluated.
    - `insightParameters` object[], nullable — The insight parameters. Required only for some test subtypes. For example, for tests that require a column name, the insight parameters will be [{'name': 'column_name', 'value': 'Age'}]
      - `name` string, required — The name of the insight filter.
      - `value` string, required
    - `thresholdMode` 'automatic' | 'manual' — Whether to use automatic anomaly detection or manual thresholds
    - `operator` 'is' | '>' | '>=' | '<' | '<=' | '!=' — The operator to be used for the evaluation.
    - `value` union — The value to be compared.
      - number
      - boolean
      - string
      - string[]
  - `archived` boolean — Whether the test is archived.
  - `dateArchived` string, date-time, nullable, required — The date the test was archived.
  - `suggested` boolean, required — Whether the test is suggested or user-created.
  - `commentCount` integer, required — The number of comments on the test.
  - `usesMlModel` boolean — Whether the test uses an ML model.
  - `usesValidationDataset` boolean — Whether the test uses a validation dataset.
  - `usesTrainingDataset` boolean — Whether the test uses a training dataset.
  - `usesReferenceDataset` boolean — Whether the test uses a reference dataset (monitoring mode only).
  - `usesProductionData` boolean — Whether the test uses production data (monitoring mode only).
  - `includeHistoricalData` boolean, nullable — Whether to include historical data in the test result. Only applies to tests that use production data.
  - `defaultToAllPipelines` boolean, nullable — Whether to apply the test to all pipelines (data sources) or to a specific set of pipelines. Only applies to tests that use production data.
  - `includePipelines` string[], nullable — Array of pipelines (data sources) to which the test should be applied. Only applies to tests that use production data.
  - `excludePipelines` string[], nullable — Array of pipelines (data sources) to which the test should not be applied. Only applies to tests that use production data.

## Response `201`

Status OK.

- TestBase
  - `id` string, uuid, required — The test id.
  - `number` integer, required — The test number.
  - `name` string, required — The test name.
  - `dateCreated` string, date-time, required — The creation date.
  - `dateUpdated` string, date-time, required — The last updated date.
  - `description` object, nullable, required — The test description.
  - `evaluationWindow` number, nullable — The evaluation window in seconds. Only applies to tests that use production data.
  - `delayWindow` number, nullable — The delay window in seconds. Only applies to tests that use production data.
  - `type` 'integrity' | 'consistency' | 'performance', required — The test type.
  - `subtype` 'anomalousColumnCount' | 'characterLength' | 'classImbalanceRatio' | 'expectColumnAToBeInColumnB' | 'columnAverage' | 'columnDrift' | 'columnStatistic' | 'columnValuesMatch' | 'conflictingLabelRowCount' | 'containsPii' | 'containsValidUrl' | 'correlatedFeatureCount' | 'customMetricThreshold' | 'duplicateRowCount' | 'emptyFeature' | 'emptyFeatureCount' | 'driftedFeatureCount' | 'featureMissingValues' | 'featureValueValidation' | 'greatExpectations' | 'groupByColumnStatsCheck' | 'illFormedRowCount' | 'isCode' | 'isJson' | 'llmRubricThresholdV2' | 'labelDrift' | 'metricThreshold' | 'newCategoryCount' | 'newLabelCount' | 'nullRowCount' | 'rowCount' | 'ppScoreValueValidation' | 'quasiConstantFeature' | 'quasiConstantFeatureCount' | 'sqlQuery' | 'dtypeValidation' | 'sentenceLength' | 'sizeRatio' | 'specialCharactersRatio' | 'stringValidation' | 'trainValLeakageRowCount', required — The test subtype.
  - `creatorId` string, uuid, nullable, required — The test creator id.
  - `originProjectVersionId` string, uuid, nullable, required — The project version (commit) id where the test was created.
  - `thresholds` object[], required
    - `measurement` string — The measurement to be evaluated.
    - `insightName` 'characterLength' | 'classImbalance' | 'expectColumnAToBeInColumnB' | 'columnAverage' | 'columnDrift' | 'columnValuesMatch' | 'confidenceDistribution' | 'conflictingLabelRowCount' | 'containsPii' | 'containsValidUrl' | 'correlatedFeatures' | 'customMetric' | 'duplicateRowCount' | 'emptyFeatures' | 'featureDrift' | 'featureProfile' | 'greatExpectations' | 'groupByColumnStatsCheck' | 'illFormedRowCount' | 'isCode' | 'isJson' | 'llmRubricV2' | 'labelDrift' | 'metrics' | 'newCategories' | 'newLabels' | 'nullRowCount' | 'ppScore' | 'quasiConstantFeatures' | 'sentenceLength' | 'sizeRatio' | 'specialCharacters' | 'stringValidation' | 'trainValLeakageRowCount' — The insight name to be evaluated.
    - `insightParameters` object[], nullable — The insight parameters. Required only for some test subtypes. For example, for tests that require a column name, the insight parameters will be [{'name': 'column_name', 'value': 'Age'}]
      - `name` string, required — The name of the insight filter.
      - `value` string, required
    - `thresholdMode` 'automatic' | 'manual' — Whether to use automatic anomaly detection or manual thresholds
    - `operator` 'is' | '>' | '>=' | '<' | '<=' | '!=' — The operator to be used for the evaluation.
    - `value` union — The value to be compared.
      - number
      - boolean
      - string
      - string[]
  - `archived` boolean — Whether the test is archived.
  - `dateArchived` string, date-time, nullable, required — The date the test was archived.
  - `suggested` boolean, required — Whether the test is suggested or user-created.
  - `commentCount` integer, required — The number of comments on the test.
  - `usesMlModel` boolean — Whether the test uses an ML model.
  - `usesValidationDataset` boolean — Whether the test uses a validation dataset.
  - `usesTrainingDataset` boolean — Whether the test uses a training dataset.
  - `usesReferenceDataset` boolean — Whether the test uses a reference dataset (monitoring mode only).
  - `usesProductionData` boolean — Whether the test uses production data (monitoring mode only).
  - `includeHistoricalData` boolean, nullable — Whether to include historical data in the test result. Only applies to tests that use production data.
  - `defaultToAllPipelines` boolean, nullable — Whether to apply the test to all pipelines (data sources) or to a specific set of pipelines. Only applies to tests that use production data.
  - `includePipelines` string[], nullable — Array of pipelines (data sources) to which the test should be applied. Only applies to tests that use production data.
  - `excludePipelines` string[], nullable — Array of pipelines (data sources) to which the test should not be applied. Only applies to tests that use production data.

## Other responses

- `default` — Unexpected error.

---

[API](https://skmtc.net/openlayer/apis/openlayer-api.md) · [All operations](https://skmtc.net/openlayer/apis/openlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openlayer/openlayer-api/versions/d0e74f00c900/schema)
