# Find experiments

- Operation ID: `FindExperimentsV2`
- HTTP method: `GET`
- Path: `/optimizer/v2/experiments`
- [Human-readable API reference](https://hub.synerise.com/api-reference/ai-suite#tag/Experiments/operation/FindExperimentsV2)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /optimizer/v2/experiments:
    get:
      summary: Find experiments
      description: |
        Find experiments. You can filter the results by campaign type, status, author, or search for a string in the name, or declare the ID of the experiment.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `OPTIMIZER_MANAGER_TESTOPTIMIZER_READ`

        **User role permission required:** `campaigns_test_optimizer: read`
      operationId: FindExperimentsV2
      tags:
        - Experiments
      security:
        - JWT: []
      parameters:
        - in: query
          name: campaignType
          required: false
          description: CampaignType of the experiment
          schema:
            type: string
            enum:
              - ITEMS_SEARCH
              - RECOMMENDATION_CAMPAIGN
        - in: query
          name: status
          required: false
          description: "Requested status of the experiment. One of: NotStarted, Running, Paused, Finished, Draft. May pass more than one status."
          schema:
            type: array
            items:
              type: string
              enum:
                - NotStarted
                - Running
                - Paused
                - Finished
                - Draft
        - in: query
          name: search
          required: false
          description: ID of the experiment or a part of its name.
          schema:
            type: string
      responses:
        "200":
          description: Experiments returned
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    experimentId:
                      type: integer
                      description: ID of the experiment
                    name:
                      type: string
                      description: Experiment name
                    author:
                      type: integer
                      description: Author of the experiment
                    description:
                      type: string
                      description: Experiment description
                    experimentKind:
                      type: string
                      description: The type of the experiment
                      enum:
                        - ITEMS_SEARCH
                        - RECOMMENDATION_CAMPAIGN
                    variantsAllocationMethod:
                      type: string
                      enum:
                        - Manual
                      description: The variant allocation method. Currently, only `Manual` is available.
                    status:
                      type: string
                      enum:
                        - NotStarted
                        - Running
                        - Paused
                        - Finished
                      description: Current status of the experiment. A finished experiment cannot be started again.
                    startedAt:
                      type: string
                      format: date-time
                      description: Time when the experiment was started
                    stoppedAt:
                      type: string
                      format: date-time
                      description: Time when the experiment was stopped
                    createdAt:
                      type: string
                      format: date-time
                      description: Creation time
                    updatedAt:
                      type: string
                      format: date-time
                      description: Last update time
                    variants:
                      type: array
                      description: An array of variants
                      items:
                        type: object
                        properties:
                          variantId:
                            type: integer
                            description: ID of the variant
                          externalId:
                            type: string
                            description: |
                              Identifier of the resource to request with this variant.

                              - For recommendations, this is the recommendation campaign ID.
                              - For items/suggestion search, this is the search/suggestion index ID.
                          name:
                            type: string
                            description: Variant name
                          weight:
                            type: integer
                            maximum: 10000
                            description: |
                              Importance of the variant. Higher value means higher importance.  
                              The total weight of all variants must be <= 10000.
                          metadata:
                            type: string
                            description: Additional data
                          isBaseline:
                            type: boolean
                            description: "`true` if this is the baseline variant. When making a search/recommendation request, you will use the ID of the baseline index/recommendation and then the system will return a result from one of the variants."
                        required:
                          - variantId
                          - externalId
                          - weight
                  required:
                    - experimentId
                    - name
                    - experimentKind
                    - variantsAllocationMethod
                    - status
                    - createdAt
                    - variants
                    - goals
      x-snr-doc-urls:
        - /api-reference/ai-suite#tag/Experiments/operation/FindExperimentsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/optimizer/v2/experiments?campaignType=SOME_STRING_VALUE&status=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/optimizer/v2/experiments?campaignType=SOME_STRING_VALUE&status=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/optimizer/v2/experiments?campaignType=SOME_STRING_VALUE&status=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/optimizer/v2/experiments?campaignType=SOME_STRING_VALUE&status=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/optimizer/v2/experiments');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'campaignType' => 'SOME_STRING_VALUE',
              'status' => 'SOME_ARRAY_VALUE',
              'search' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/optimizer/v2/experiments?campaignType=SOME_STRING_VALUE&status=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Experiments
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
