user-secretPersonas

Create and version simulated user profiles with background, role, and language for testing.

Manage simulated user profiles used in simulation testing. Personas define the characteristics of a simulated user -- their background, role, and preferred language -- allowing you to test how your agent interacts with different user archetypes.

circle-info

Versioning

Personas are versioned. When you create a persona, an initial version is created automatically. You can then create additional versions to iterate on the persona's background and language without changing its identity (name, role, tags). Unit tests always use the latest version of a referenced persona.

Create a Persona

Create a new simulation persona with an initial version.

curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "name": "Confused New User",
       "role": "patient",
       "tags": {"category": "onboarding", "difficulty": "low"},
       "initial_version": {
         "background": "A 35-year-old first-time user who is unfamiliar with the platform and tends to ask basic questions.",
         "preferred_language": "eng"
       }
     }'

Response (201):

Create a simulation persona

post
/v1/{organization}/simulation/persona/

Create a simulation persona.

Permissions

  • Simulation:CreateSimulationPersona for the persona to create.
  • Simulation:ModifySimulationPersona for the persona to create.
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 persona.

rolestring · min: 1Required

The role of the simulation persona.

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

List Personas

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

Common filters:

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

  • is_deleted=true|false -- filter by deletion status

  • role=<role> (repeatable) -- filter by persona role

  • 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--50, default 50), continuation_token (int, default 0)

Get simulation personas

get
/v1/{organization}/simulation/persona/

Retrieve simulation personas that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

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

Default: []
limitinteger · max: 50Optional

The maximum number of simulation personas to return.

Default: 50
continuation_tokenintegerOptional

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

Default: 0
is_deletedany ofOptional

Whether the simulation persona is deleted.

booleanOptional
or
nullOptional
rolestring[]Optional

The roles of the simulation personas.

Default: []
creatorstring[]Optional

The creators of the simulation personas to retrieve. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the simulation personas to retrieve. Each value must be of the format key:value. 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-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 personas to fetch.

continuation_tokenany ofRequired

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

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

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

Search Personas

Search for simulation personas by text query. Matches against the persona name and the background of its latest version. Returns the top 50 results sorted by relevance.

  • query (required) -- the search text

  • role=<role> (repeatable) -- filter by role

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

  • tag=key:value (repeatable)

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

Search for simulation personas that match the given filters and contain the given query in its name and the background of its latest version. 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 personas that the authenticated user has Simulation:GetSimulationPersona 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 personas containing the terms in its name and the background of its latest version would be returned.

rolestring[]Optional

The roles of the simulation personas.

Default: []
creatorstring[]Optional

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

Default: []
tagstring[]Optional

The tags of the simulation personas. 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/persona/search

Update a Persona

Update a simulation persona's metadata (tags). To change the persona's background or language, create a new version instead.

Update a simulation persona

post
/v1/{organization}/simulation/persona/{simulation_persona_id}/

Update a simulation persona.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationPersona for the persona to update.
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_persona_idstringRequired

The ID of the simulation persona 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/persona/{simulation_persona_id}/

No content

Delete a Persona

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

Delete a simulation persona

delete
/v1/{organization}/simulation/persona/{simulation_persona_id}/

Delete a simulation persona. This endpoint only soft-deletes the simulation persona 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 persona is used in any simulation unit tests.

Permissions

This endpoint requires the following permissions:

  • Simulation:DeleteSimulationPersona on the simulation persona 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_persona_idstringRequired

The ID of the simulation persona 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/persona/{simulation_persona_id}/

No content

Create a Persona Version

Create a new version of a simulation persona. Use this to update the persona's background or preferred language while preserving version history.

The optional version query parameter lets you specify the expected version number. If the next version in the database does not match this value, the request fails -- useful for optimistic concurrency control.

Create a new simulation persona version

post
/v1/{organization}/simulation/persona/{simulation_persona_id}/version/

Create a new version of the simulation persona.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationPersona for the simulation persona.
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
simulation_persona_idstringRequired

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

Pattern: ^[a-f0-9]{24}$
organizationstringRequired
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
backgroundstring · min: 1Required

The background of the simulation persona.

preferred_languageany ofOptional

The preferred language of the simulation persona in the ISO 639-3 format. If unspecified, the preferred language of the organization is used. If that is unspecified too, the language of the agent is used.

Default: {}
string · enum · min: 3 · max: 3OptionalPossible values:
or
object · _NotSetOptional

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

or
nullOptional
timezoneany ofOptional

The timezone of the simulation persona in the IANA tz database format. If unspecified, the organization's default timezone is used. If the organization's default timezone is not specified, UTC is used.

Default: {}
string · enum · min: 1OptionalPossible values:
or
object · _NotSetOptional

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

or
nullOptional
user_modelsstring[]Required

A list of strings representing the user models associated with the simulation persona.

Responses
post
/v1/{organization}/simulation/persona/{simulation_persona_id}/version/

Get Persona Versions

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

Get simulation persona versions

get
/v1/{organization}/simulation/persona/{simulation_persona_id}/version/

Retrieve versions of a simulation persona.

Permissions

This endpoint requires the following permissions:

  • Simulation:GetSimulationPersona for the simulation persona.
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_persona_idstringRequired

The ID of the simulation persona to get versions for.

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

The versions of the simulation persona 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 persona versions to return.

Default: 10
continuation_tokenintegerOptional

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

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 persona versions to fetch.

continuation_tokenany ofRequired

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

anyOptional
or
nullOptional
get
/v1/{organization}/simulation/persona/{simulation_persona_id}/version/

Last updated

Was this helpful?