---
title: "Search simulation unit tests"
method: GET
path: "/v1/{organization}/simulation/unit_test/search/"
tags: ["Simulation"]
---

# Search simulation unit tests

`GET /v1/{organization}/simulation/unit_test/search/`

Search for simulation unit tests that match the given filters and whose name or description contains the specified query.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only simulation unit tests that the authenticated user has `Simulation:GetSimulationUnitTest` permission for will be retrieved.

## Path parameters

- `organization` string, required

## Query parameters

- `query` string, required
- `creator` string[] — The creators of the simulation unit tests. Each value must be of the format `org_id,user_id`.
- `tag` string[] — The tags of the simulation unit tests. Must be specified using the syntax `key:value`, which means to match all sets with the given `key` and `value` pair among its tags. If `value` is `*`, it means the `value` does not matter. If `value` is empty, it matches against when the value is `None`.
- `service_id` string[] — The IDs of the services that the simulation unit tests run on.
- `persona_id` string[] — The IDs of the personas that the simulation unit tests use.
- `scenario_id` string[] — The IDs of the scenarios that the simulation unit tests use.
- `metric_id` string[] — The IDs of the metrics that the simulation unit tests use.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

- SrcAppEndpointsSimulationSearchSimulationUnitTestsResponse
  - `simulation_unit_tests` SimulationUnitTest[], required — The retrieved simulation unit tests.
    - `_id` string, required — The ID of the document.
    - `org_id` string, required — The ID of the organization.
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `name` string, required — The name of the unit test.
    - `description` string, required — A description of the unit test.
    - `service_id` string, required — The service that the unit test runs on.
    - `service_version_set_name` string, required — The version set of the service that the unit test runs on.
    - `persona_id` string, required — The persona that unit test uses.
    - `scenario_id` string, required — The scenario that the unit test uses.
    - `max_interactions` integer, required — The max number of interactions after which the unit test fails.
    - `success_criterions` SuccessCriterionOutput[], required — The success criterions for the unit test.
      - `name` string, required
      - `metric_id` string, required
      - `criterion` union, required
        - BooleanMetricSuccessCriterion
          - `type` 'boolean', required
          - `expected_value` boolean, required
        - NumericalMetricSuccessCriterion
          - `type` 'numerical', required
          - `verb` '==' | '!=' | '<=' | '<' | '>=' | '>', required
          - `threshold` number, required
        - CategoricalMetricSuccessCriterionOutput
          - `type` 'categorical', required
          - `expected_values` string[], required
    - `is_deleted` boolean, required — Whether the unit test has been deleted.
    - `tags` Tag[], required — The tags of the simulation persona.
      - `key` string, required
      - `value` string, nullable, required
    - `creator` AmigoLibMongoCollectionsSimulationUnitTestSimulationUnitTestUserInfo, required
      - `org_id` string, required
      - `user_id` string, required
    - `updated_by` AmigoLibMongoCollectionsSimulationUnitTestSimulationUnitTestUserInfo, required
      - `org_id` string, required
      - `user_id` string, required

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization is not found.
- `422` — Invalid request path parameter or request query parameter failed validation.
- `429` — The user has exceeded the rate limit of 50 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

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