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

# Update tests

> Update tests in a project.



## OpenAPI

````yaml put /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:
    put:
      tags:
        - Projects
      summary: Update tests
      description: Update tests in a project.
      parameters:
        - $ref: '#/components/parameters/projectId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - payloads
              properties:
                payloads:
                  type: array
                  maxLength: 400
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        format: uuid
                      name: 0b66fbd9-b0c7-4fcb-8256-93847567bdaf
                      description: f8657f6d-2feb-43b9-bc2d-ac950182ba7b
                      archived: 36f0c228-b520-4a8d-b0ce-8e9fced53f61
                      thresholds: ec50186a-c3e0-450a-9a9d-5f85b3ed69ef
                      suggested:
                        type: boolean
                        enum:
                          - false
      responses:
        '202':
          description: Response OK. Task queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  taskResultUrl:
                    type: string
                  taskResultId:
                    type: string
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.projects.tests.update(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                payloads=[
                    {
                        "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                        "name": "No duplicate rows",
                        "thresholds": [
                            {
                                "insight_name": "duplicateRowCount",
                                "measurement": "duplicateRowCount",
                                "operator": "<=",
                                "value": 5,
                            }
                        ],
                    }
                ],
            )
            print(response.task_result_id)
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            const response = await
            client.projects.tests.update('3fa85f64-5717-4562-b3fc-2c963f66afa6',
            {
              payloads: [
                {
                  id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
                  name: 'No duplicate rows',
                  archived: false,
                },
              ],
            });


            console.log(response);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\ntask, err := client.Projects.Tests.Update(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectTestUpdateParams{\n\t\tPayloads: openlayer.F([]openlayer.ProjectTestUpdateParamsPayload{{\n\t\t\tID:       openlayer.F(\"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\"),\n\t\t\tName:     openlayer.F(\"No duplicate rows (strict)\"),\n\t\t\tArchived: openlayer.F(false),\n\t\t}}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", task.TaskResultID)\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            import com.openlayer.api.models.projects.tests.TestUpdateParams;

            import com.openlayer.api.models.projects.tests.TestUpdateResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            TestUpdateParams params = TestUpdateParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .addPayload(TestUpdateParams.Payload.builder()
                    .id("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
                    .name("No duplicate rows")
                    .archived(false)
                    .build())
                .build();
            TestUpdateResponse response =
            client.projects().tests().update(params);
        - lang: ruby
          source: |
            require "openlayer"

            openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])

            response = openlayer.projects.tests.update(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              payloads: [{id: "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", name: "No duplicate rows", archived: false}]
            )

            puts(response)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/tests \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "payloads": [
                  {
                    "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                    "name": "No PII in responses",
                    "archived": false
                  }
                ]
              }'
components:
  parameters:
    projectId:
      name: projectId
      in: path
      description: The project id.
      required: true
      schema:
        type: string
        format: uuid
  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.

````

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