playUnit Test Set Runs

Execute test suites, monitor progress, cancel runs, and download result artifacts.

Execute simulation test suites and retrieve results. A run executes all unit tests in a unit test set according to their configured run counts, evaluates success criteria, and produces downloadable artifacts with the full results.

circle-exclamation

Create a Run

Start a new run for a simulation unit test set. The platform will execute all unit tests in the set, running simulated conversations and evaluating metrics.

curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/unit_test_set_run/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "simulation_unit_test_set_id": "6618791275130b73714e8d7f"
     }'

Response (201):

{
  "simulation_unit_test_set_run_id": "6618791275130b73714e8d9h"
}

Create a simulation unit test set run

post
/v1/{organization}/simulation/unit_test_set_run/

Create a run for a simulation unit test set. The user must not already have an unfinished run for this simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:CreateSimulationUnitTestSetRun for the test set run.
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-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set to run.

Pattern: ^[a-f0-9]{24}$
Responses
post
/v1/{organization}/simulation/unit_test_set_run/

List Runs

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

circle-info

Conditional Fields

The unit_test_run_specs and unit_test_run_results fields are only populated if the authenticated user also has Simulation:GetSimulationUnitTestSet permission. Additional nested fields (scenario_version_info, persona_version_info, metrics_to_evaluate) require Simulation:GetSimulationUnitTest permission.

Common filters:

  • id=<id> (repeatable) -- filter by specific run IDs

  • simulation_unit_test_set_id=<id> (repeatable) -- filter by parent test set

  • is_completed=true|false -- filter by completion status

  • failed_metrics=true|false -- filter by pass/fail status

  • errored=true|false -- filter by error status

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

  • sort_by=+created_at|-created_at (repeatable)

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

Get simulation unit test set runs

get
/v1/{organization}/simulation/unit_test_set_run/

Retrieves simulation unit test set runs.

This endpoint may be impacted by the following permissions:

  • Only the runs that the authenticated user has the Simulation:GetSimulationUnitTestSetRun permission for will be returned.
  • The unit_test_run_specs and unit_test_run_results fields are only populated if the authenticated user has the Simulation:GetSimulationUnitTestSet permission.
  • The fields scenario_version_info, persona_version_info, metrics_to_evaluate in unit_test_run_specs and the field metric_evaluation_results in unit_test_run_results are only populated if the authenticated user has the Simulation:GetSimulationUnitTest permission.
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 ID of the simulation unit test set run to retrieve.

Default: []
limitinteger · max: 50Optional

The maximum number of simulation unit test set runs to return.

Default: 50
continuation_tokenintegerOptional

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

Default: 0
creatorstring[]Optional

The creators of the simulation unit test set runs to retrieve. Each value must be of the format org_id,user_id.

Default: []
sort_bystring[]Optional

The fields to sort the sets by. Supported fields are created_at.

Default: []
simulation_unit_test_set_idstring[]Optional

The IDs of the simulation unit test sets that the simulation unit test set runs belong to.

Default: []
is_completedany ofOptional

Whether the simulation unit test set run is completed.

booleanOptional
or
nullOptional
failed_metricsany ofOptional

Whether the simulation unit test set run has failed due to failing metrics. Note that this field could be True even if the run is still ongoing -- it simply means some unit test runs have failed.

booleanOptional
or
nullOptional
erroredany ofOptional

Whether the simulation unit test set run has encountered an error.

booleanOptional
or
nullOptional
created_afterany ofOptional

Filter for simulation unit test set runs created at or after this time (inclusive).

string · date-timeOptional
or
nullOptional
created_beforeany ofOptional

Filter for simulation unit test set runs created at or before this time (inclusive).

string · date-timeOptional
or
nullOptional
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more simulation unit test set runs to retrieve.

continuation_tokenany ofRequired

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

integerOptional
or
nullOptional
filter_valuesany ofRequired

For each filter that this endpoint supports that can take on dynamic values, this field includes what these values are. This is only provided for the first page in the pagination results.

Note that the values are counted assuming the authenticated user has access to all the simulation unit test set runs, so they might differ from how many sets are actually retrieved.

or
nullOptional
get
/v1/{organization}/simulation/unit_test_set_run/

Cancel a Run

Cancel an in-progress simulation unit test set run. Cancellation is best-effort and may not take effect immediately. The run must still be in progress; attempting to cancel a completed run returns HTTP 409.

Cancel a simulation unit test set run

delete
/v1/{organization}/simulation/unit_test_set_run/{simulation_unit_test_set_run_id}/

Cancel a simulation unit test set run. The run must still be in progress. This cancellation is a best-effort operation, and there's no guarantee that it'll take effect immediately.

Permissions

This endpoint requires the following permissions:

  • Simulation:CancelSimulationUnitTestSetRun for the authenticated user.
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_run_idstringRequired

The ID of the simulation unit test set run to cancel.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
delete
/v1/{organization}/simulation/unit_test_set_run/{simulation_unit_test_set_run_id}/

No content

Get Run Artifacts

Retrieve the artifacts (detailed results) of a completed simulation unit test set run. Returns a pre-signed S3 URL where the artifacts can be downloaded.

circle-exclamation

Response (200):

The presigned_url provides temporary access to download the artifact file. The URL expires at the time indicated in url_expires_at (UTC).

Get simulation unit test set run artifacts

get
/v1/{organization}/simulation/unit_test_set_run/{simulation_unit_test_set_run_id}/artifacts/

Get the artifacts of a simulation unit test set run. A link to the raw artifacts in S3 is returned.

Permissions

This endpoint requires the following permissions:

  • Simulation:GetSimulationUnitTestSetRun for the simulation unit test set run.
  • Organization:GetServiceHierarchicalStateMachine for the state machine that the simulation uses.
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_run_idstringRequired

The ID of the simulation unit test set run to retrieve the artifacts of.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
presigned_urlstringRequired

An URL where the artifacts can be downloaded from.

url_expires_atstring · date-timeRequired

The time in UTC when the presigned URL expires.

get
/v1/{organization}/simulation/unit_test_set_run/{simulation_unit_test_set_run_id}/artifacts/

Run Lifecycle

spinner

Last updated

Was this helpful?