For the complete documentation index, see llms.txt. This page is also available as Markdown.

Unit Test Sets

Group unit tests into suites with configurable run counts for batch execution.

Manage grouped collections of unit tests that form a test suite. A unit test set bundles multiple unit tests together, each with a configurable run count, so you can execute an entire suite in a single operation.

Run Counts

Each unit test in a set has a run_count that determines how many times it will be executed during a run. Running tests multiple times gives you statistical significance. For example, running each test 5 times helps distinguish consistent failures from flaky behavior.

Create a Unit Test Set

Create a new simulation unit test set.

curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/unit_test_set/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "name": "Onboarding Suite - Release Validation",
       "description": "Full onboarding test suite for release candidate validation.",
       "unit_test_runs": [
         {"unit_test_id": "6618791275130b73714e8d5d", "run_count": 5},
         {"unit_test_id": "6618791275130b73714e8d6e", "run_count": 3}
       ],
       "tags": {"suite": "onboarding", "stage": "release"}
     }'

Response (201):

Create a simulation unit test set

post
/v1/{organization}/simulation/unit_test_set/

Create a new simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:CreateSimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1Required

The name of the simulation unit test set.

descriptionstring · min: 1 · nullableRequired

The description of the simulation unit test set.

Responses
201

Succeeded.

application/json
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set that was created.

post/v1/{organization}/simulation/unit_test_set/
POST /v1/{organization}/simulation/unit_test_set/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 135

{
  "name": "text",
  "description": "text",
  "unit_test_runs": [
    {
      "unit_test_id": "text",
      "run_count": 1
    }
  ],
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
{
  "simulation_unit_test_set_id": "text"
}

List Unit Test Sets

Retrieve simulation unit test sets that match the given filters. Only sets the authenticated user has Simulation:GetSimulationUnitTestSet permission for are returned.

Common filters:

  • id=<id> (repeatable): filter by specific set IDs

  • is_deleted=true|false: filter by deletion status

  • creator=<org_id,user_id> (repeatable): filter by creator

  • tag=key:value (repeatable; value may be * for any value, or empty for null)

  • sort_by=+updated_at|-updated_at (repeatable; only updated_at is a supported sort field - prefix + for ascending, - for descending; other fields fail validation with 422)

  • limit (0-20, default 20), continuation_token (int, default 0)

Get simulation unit test sets

get
/v1/{organization}/simulation/unit_test_set/

Retrieve the simulation unit test sets that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

  • Only simulation unit test sets that the authenticated user has Simulation:GetSimulationUnitTestSet permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
idstring[]Optional

The IDs of the simulation unit test sets to retrieve.

Default: []
limitinteger · max: 20Optional

The maximum number of simulation unit test sets to return.

Default: 20
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of simulation unit test sets.

Default: 0
is_deletedboolean · nullableOptional

Whether the simulation unit test set is deleted.

unit_test_idstring[]Optional

The IDs of the unit tests that are part of the simulation unit test sets.

Default: []
creatorstring[]Optional

The creators of the simulation unit test sets.

Default: []
tagstring[]Optional

The tags of the simulation unit test sets. 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.

Default: []
sort_bystring[]Optional

The fields to sort the sets by. Supported fields are updated_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more simulation unit test sets to retrieve.

continuation_tokeninteger · nullableRequired

The continuation token to use to retrieve the next page of simulation unit test sets.

get/v1/{organization}/simulation/unit_test_set/
GET /v1/{organization}/simulation/unit_test_set/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
  "simulation_unit_test_sets": [
    {
      "id": "text",
      "org_id": "text",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "name": "text",
      "description": "text",
      "unit_test_runs": [
        {
          "unit_test_id": "text",
          "run_count": 1
        }
      ],
      "last_triggered_run_id": "text",
      "is_deleted": true,
      "tags": [
        {
          "key": "text",
          "value": "text"
        }
      ],
      "creator": {
        "org_id": "text",
        "user_id": "text"
      },
      "updated_by": {
        "org_id": "text",
        "user_id": "text"
      }
    }
  ],
  "has_more": true,
  "continuation_token": 1,
  "filter_values": {
    "creators": [
      {
        "org_id": "text",
        "user_id": "text"
      }
    ],
    "unit_test_ids": [
      "text"
    ],
    "tags": [
      "text"
    ]
  }
}

Search Unit Test Sets

Search for simulation unit test sets by text query. Matches against the set name and description. Returns the top 50 results sorted by relevance.

  • query (required): the search text

  • creator=<org_id,user_id> (repeatable): filter by creator

  • tag=key:value (repeatable)

get
/v1/{organization}/simulation/unit_test_set/search/

Search for simulation unit test sets 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 test sets that the authenticated user has Simulation:GetSimulationUnitTestSet permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
querystring · min: 1Required

The query to search for. Any simulation unit test sets containing the terms in its name or description would be returned.

creatorstring[]Optional

The creators of the simulation unit test sets. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the simulation unit test sets. 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.

Default: []
unit_test_idstring[]Optional

The IDs of the unit tests that are part of the simulation unit test sets.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
get/v1/{organization}/simulation/unit_test_set/search/
GET /v1/{organization}/simulation/unit_test_set/search/?query=text HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
  "simulation_unit_test_sets": [
    {
      "_id": "text",
      "org_id": "text",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "name": "text",
      "description": "text",
      "unit_test_runs": [
        {
          "unit_test_id": "text",
          "run_count": 1
        }
      ],
      "last_triggered_run_id": "text",
      "is_deleted": true,
      "tags": [
        {
          "key": "text",
          "value": "text"
        }
      ],
      "creator": {
        "org_id": "text",
        "user_id": "text"
      },
      "updated_by": {
        "org_id": "text",
        "user_id": "text"
      }
    }
  ]
}

Update a Unit Test Set

Update a simulation unit test set. All fields are optional. Only the fields you include are updated. You can modify the name, description, unit test run list, and tags.

For the description field, pass the new description string to update it, or pass null to clear it. Omitting the field (or passing an empty object {}) leaves the existing description unchanged.

Update a simulation unit test set

post
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

Update a simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set to update.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1 · nullableOptional

The name of the simulation unit test set.

descriptionany of · nullableOptional

The description of the simulation unit test set. If not specified or an empty object is provided, the description will not be updated.

Default: {}
string · min: 1Optional
or
object · _NotSetOptional

A specific type to indicate that a field is not set in the request.

Responses
204

Succeeded.

No content

post/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}
POST /v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id} HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 135

{
  "name": "text",
  "description": "text",
  "unit_test_runs": [
    {
      "unit_test_id": "text",
      "run_count": 1
    }
  ],
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}

No content

Delete a Unit Test Set

Soft-delete a simulation unit test set.

Delete a simulation unit test set

delete
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

Delete a simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:DeleteSimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set to delete.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
204

Succeeded.

No content

delete/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}
DELETE /v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id} HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*

No content

Last updated

Was this helpful?