scrollScenarios

Define conversation test scripts with objectives, instructions, and initial message types.

Manage simulation scenarios that define what a simulated user is trying to accomplish during a test conversation. Scenarios include an objective, detailed instructions for the simulated user, and the initial message type that determines how the conversation starts.

circle-info

Versioning

Scenarios are versioned independently. When you create a scenario, an initial version is created automatically. Create additional versions to iterate on objectives, instructions, and conversation start behavior. Unit tests always use the latest version of a referenced scenario.

Create a Scenario

Create a new simulation scenario with an initial version.

curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/scenario/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "name": "Account Setup Assistance",
       "tags": {"category": "onboarding", "priority": "high"},
       "initial_version": {
         "objective": "The user needs help setting up their account and configuring preferences.",
         "instructions": "Act confused about the setup process. Ask questions about each step. Express satisfaction when the agent explains things clearly.",
         "initial_message_type": "user-message",
         "conversation_starts_at": null
       }
     }'

Response (201):

Initial Message Types

The initial_message_type field controls how the simulated conversation begins:

Value
Behavior

"user-message"

The simulated persona sends the first message

"external-event"

An external event triggers the conversation

"skip"

The agent speaks first (no initial user message)

Create a simulation scenario

post
/v1/{organization}/simulation/scenario/

Create a simulation scenario.

Permissions

This endpoint requires the following permissions:

  • Simulation:CreateSimulationScenario for the simulation scenario.
  • Simulation:ModifySimulationScenario for the simulation scenario.
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
namestring · min: 1Required

The name of the simulation scenario.

Responses
post
/v1/{organization}/simulation/scenario/

List Scenarios

Retrieve simulation scenarios that match the given filters. Only scenarios the authenticated user has Simulation:GetSimulationScenario permission for are returned.

Common filters:

  • id=<id> (repeatable) -- filter by specific scenario 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=+created_at|-created_at|+name|-name (repeatable)

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

Get simulation scenarios

get
/v1/{organization}/simulation/scenario/

Retrieve simulation scenarios that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

  • Only simulation scenarios that the authenticated user has Simulation:GetSimulationScenario 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 scenarios to retrieve.

Default: []
limitinteger · max: 200Optional

The maximum number of simulation scenarios to return.

Default: 50
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of simulation scenarios.

Default: 0
is_deletedany ofOptional

Whether the simulation scenario is deleted.

booleanOptional
or
nullOptional
creatorstring[]Optional

The creators of the simulation scenarios. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the simulation scenarios. 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 to match any value. 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-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 scenarios to fetch.

continuation_tokenany ofRequired

The continuation token to use to retrieve the next page of simulation scenarios.

anyOptional
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 scenarios, so they might differ from how many scenarios are actually retrieved.

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

Search Scenarios

Search for simulation scenarios by text query. Matches against the scenario name. 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/scenario/search

Search for simulation scenarios that match the given filters and contain the given query in its name. Only the top 50 results will be returned. The results will be sorted by the relevance of the search query.

Permissions

This endpoint may be impacted by the following permissions:

  • Only simulation scenarios that the authenticated user has Simulation:GetSimulationScenario 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 scenarios containing the terms in its name would be returned.

creatorstring[]Optional

The creators of the simulation scenarios. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the simulation scenarios. 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: []
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
get
/v1/{organization}/simulation/scenario/search

Update a Scenario

Update a simulation scenario's metadata (tags). To change the scenario's objective, instructions, or initial message type, create a new version instead.

Update a simulation scenario

post
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/

Update a simulation scenario.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationScenario on the simulation scenario.
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_scenario_idstringRequired

The ID of the simulation scenario to update.

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: []
Body
tagsany ofOptional

The tags of the simulation persona. Both the key and the value can only contain alphanumeric characters, underscores, or spaces.

or
nullOptional
Responses
post
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/

No content

Delete a Scenario

Soft-delete a simulation scenario. Existing references remain valid but the scenario cannot be used in new unit tests. This endpoint returns an error if the scenario is currently used in any simulation unit test.

Delete a simulation scenario

delete
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/

Delete a simulation scenario. This endpoint only soft-deletes the simulation scenario so any existing references to it would still be valid. However, they cannot be used in any new simulations.

This endpoint will error if the simulation scenario is used in any simulation unit tests.

Permissions

This endpoint requires the following permissions:

  • Simulation:DeleteSimulationScenario on the simulation scenario to delete.
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_scenario_idstringRequired

The ID of the simulation scenario to delete.

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/scenario/{simulation_scenario_id}/

No content

Create a Scenario Version

Create a new version of a simulation scenario. Use this to update the scenario's objective, instructions, initial message type, or conversation start time.

The optional version query parameter lets you specify the expected version number for optimistic concurrency control.

Create a new simulation scenario version

post
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/version/

Create a new version of the simulation scenario.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationScenario for the simulation scenario.
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_scenario_idstringRequired

The ID of the simulation scenario to create a version for.

Pattern: ^[a-f0-9]{24}$
Query parameters
versionany ofOptional

The version number of the new version. If specified, this endpoint throws an error if the next version in the database doesn't equal to the value of this parameter.

integerOptional
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: []
Body
objectivestring · min: 1Required

The objective of the simulation scenario.

instructionsstring · min: 1Required

The instructions of the simulation scenario.

initial_message_typestring · enumRequired

The initial message type for the simulation scenario version.

Possible values:
conversation_starts_atany ofRequired

The time at which the conversation starts. This must be a timestamp in UTC. If not specified, the current server time is used.

string · date-timeOptional
or
nullOptional
Responses
post
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/version/

Get Scenario Versions

Retrieve versions of a simulation scenario. You can request a specific version number, latest, or a range (e.g., 2-5 or 1-latest).

Get simulation scenario versions

get
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/version/

Retrieve the versions of a simulation scenario.

Permissions

This endpoint requires the following permissions:

  • Simulation:GetSimulationScenario for the simulation scenario.
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_scenario_idstringRequired

The ID of the simulation scenario to get versions for.

Pattern: ^[a-f0-9]{24}$
Query parameters
versionany ofOptional

The versions of the simulation scenario to retrieve. One can specify an exact version to retrieve, which is either the version number or latest, which retrieves the latest version. Alternatively, one can specify a range of inclusive lower and upper bound for the version number separated by -, and every version within the range would be retrieved.

Example: 1
stringOptional
or
nullOptional
limitinteger · max: 10Optional

The maximum number of simulation scenario versions to return.

Default: 10
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of simulation scenario version.

Default: 0
sort_bystring[]Optional

The fields to sort the versions by. Supported fields are version. 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-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 scenario versions to fetch.

continuation_tokenany ofRequired

A token to supply to the next request to retreive the next page of simulation scenario versions.

anyOptional
or
nullOptional
get
/v1/{organization}/simulation/scenario/{simulation_scenario_id}/version/

Last updated

Was this helpful?