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

# List tests

> List tests under a project.



## OpenAPI

````yaml get /projects/{projectId}/tests
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/tests:
    get:
      tags:
        - Projects
      summary: List tests in a project.
      description: List tests under a project.
      operationId: listTests
      parameters:
        - $ref: '#/components/parameters/projectId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/goalType'
        - name: suggested
          in: query
          description: Filter for suggested tests.
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/includeArchived'
        - name: originVersionId
          in: query
          description: Retrive tests created by a specific project version.
          schema:
            type: string
            format: uuid
            readOnly: false
            description: The project version (commit) id.
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            nullable: true
        - name: usesProductionData
          in: query
          description: Retrive tests with usesProductionData (monitoring).
          schema:
            type: boolean
            nullable: true
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestBase'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            import os
            from openlayer import Openlayer

            client = Openlayer()
            tests = client.projects.tests.list(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const tests = await openlayer.projects.tests.list({
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            tests, err := client.Projects.Tests.List(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )

            if err != nil {
              panic(err.Error())
            }
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/tests \
              --header 'Authorization: Bearer <token>'
components:
  parameters:
    projectId:
      name: projectId
      in: path
      description: The project id.
      required: true
      schema:
        type: string
        format: uuid
    page:
      name: page
      in: query
      description: The page to return in a paginated query.
      schema:
        type: integer
        minimum: 1
        default: 1
    perPage:
      name: perPage
      in: query
      description: Maximum number of items to return per page.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    goalType:
      name: type
      in: query
      description: >-
        Filter objects by test type. Available types are `integrity`,
        `consistency`, `performance`, `fairness`, and `robustness`.
      required: false
      schema:
        type: string
        enum:
          - integrity
          - consistency
          - performance
          - fairness
          - robustness
    includeArchived:
      name: includeArchived
      in: query
      description: Filter for archived tests.
      schema:
        type: boolean
        default: false
  schemas:
    TestBase:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The test id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        number:
          type: integer
          readOnly: true
          description: The test number.
          example: 1
        name:
          type: string
          maxLength: 100
          description: The test name.
          example: No duplicate rows
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last updated date.
          example: '2024-03-22T11:31:01.185Z'
        description:
          type: object
          nullable: true
          description: The test description.
          example: This test checks for duplicate rows in the dataset.
        evaluationWindow:
          type: number
          nullable: true
          maximum: 2592000
          description: >-
            The evaluation window in seconds. Only applies to tests that use
            production data.
          example: 3600
        delayWindow:
          type: number
          nullable: true
          minimum: 0
          maximum: 2592000
          description: >-
            The delay window in seconds. Only applies to tests that use
            production data.
          example: 0
        type:
          type: string
          description: The test type.
          example: integrity
          enum:
            - integrity
            - consistency
            - performance
        subtype:
          type: string
          description: The test subtype.
          example: duplicateRowCount
          enum:
            - 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
        creatorId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The test creator id.
          example: 589ece63-49a2-41b4-98e1-10547761d4b0
        originProjectVersionId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The project version (commit) id where the test was created.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        thresholds:
          type: array
          required:
            - measurement
            - insightName
            - operator
            - value
          items:
            type: object
            properties:
              measurement:
                type: string
                description: The measurement to be evaluated.
                example: duplicateRowCount
              insightName:
                type: string
                description: The insight name to be evaluated.
                example: duplicateRowCount
                enum:
                  - 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
              insightParameters:
                type: array
                nullable: true
                description: >-
                  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'}]
                items:
                  type: object
                  required:
                    - name
                    - value
                  properties:
                    name:
                      type: string
                      description: The name of the insight filter.
                      example: column_name
                    value:
                      example: Age
              thresholdMode:
                type: string
                enum:
                  - automatic
                  - manual
                description: >-
                  Whether to use automatic anomaly detection or manual
                  thresholds
                default: manual
              operator:
                type: string
                description: The operator to be used for the evaluation.
                example: <=
                enum:
                  - is
                  - '>'
                  - '>='
                  - <
                  - <=
                  - '!='
              value:
                description: The value to be compared.
                example: 0
                oneOf:
                  - type: number
                  - type: boolean
                  - type: string
                  - type: array
                    items:
                      type: string
        archived:
          type: boolean
          description: Whether the test is archived.
          example: false
        dateArchived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The date the test was archived.
          example: '2024-03-22T11:31:01.185Z'
        suggested:
          type: boolean
          readOnly: true
          description: Whether the test is suggested or user-created.
          example: false
        commentCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of comments on the test.
          example: 0
        usesMlModel:
          type: boolean
          description: Whether the test uses an ML model.
          example: false
        usesValidationDataset:
          type: boolean
          description: Whether the test uses a validation dataset.
          example: true
        usesTrainingDataset:
          type: boolean
          description: Whether the test uses a training dataset.
          example: false
        usesReferenceDataset:
          type: boolean
          description: Whether the test uses a reference dataset (monitoring mode only).
          example: false
        usesProductionData:
          type: boolean
          description: Whether the test uses production data (monitoring mode only).
          example: false
        includeHistoricalData:
          type: boolean
          nullable: true
          default: false
          description: >-
            Whether to include historical data in the test result. Only applies
            to tests that use production data.
        defaultToAllPipelines:
          type: boolean
          nullable: true
          default: true
          description: >-
            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:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >-
            Array of pipelines (data sources) to which the test should be
            applied. Only applies to tests that use production data.
        excludePipelines:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >-
            Array of pipelines (data sources) to which the test should not be
            applied. Only applies to tests that use production data.
      required:
        - id
        - number
        - name
        - dateCreated
        - dateUpdated
        - description
        - type
        - subtype
        - creatorId
        - originProjectVersionId
        - thresholds
        - dateArchived
        - suggested
        - commentCount
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````