> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/classic-api/core-api/simulations/simulation-personas.md).

# Personas

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

{% hint style="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 and role). Tags are editable metadata updated through the update endpoint, outside of versioning. Unit tests always use the latest version of a referenced persona.
{% endhint %}

## Create a Persona

Create a new simulation persona with an initial version. In the `initial_version` body, `background`, `user_models`, `nonsensitive_user_variables`, and `sensitive_user_variables` are required, while `preferred_language` and `timezone` are optional.

```bash
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.",
         "user_models": ["First-time user who needs step-by-step guidance"],
         "nonsensitive_user_variables": {"region": "US-West"},
         "sensitive_user_variables": {},
         "preferred_language": "eng"
       }
     }'
```

**Response (201):**

```json
{
  "simulation_persona_id": "6618791275130b73714e8d1c"
}
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/" method="post" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## 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=+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-50, default 50), `continuation_token` (int, default 0)

```bash
curl --request GET \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/?limit=10&role=patient' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Accept: application/json'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/" method="get" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## 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)

```bash
curl --request GET \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/search?query=confused%20user' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Accept: application/json'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/search" method="get" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Update a Persona

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

```bash
curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/<PERSONA-ID>/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "tags": {"category": "onboarding", "difficulty": "medium"}
     }'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/{simulation\_persona\_id}/" method="post" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## 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.

```bash
curl --request DELETE \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/<PERSONA-ID>/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/{simulation\_persona\_id}/" method="delete" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## 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. This is useful for optimistic concurrency control.

```bash
curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/<PERSONA-ID>/version/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "background": "A 35-year-old first-time user who is unfamiliar with technology in general and needs extra hand-holding through each step.",
       "user_models": ["First-time user who needs extra hand-holding through each step"],
       "nonsensitive_user_variables": {"region": "US-West"},
       "sensitive_user_variables": {},
       "preferred_language": "eng"
     }'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/{simulation\_persona\_id}/version/" method="post" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Get Persona Versions

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

```bash
# Get the latest version
curl --request GET \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/<PERSONA-ID>/version/?version=latest' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Accept: application/json'

# Get versions 1 through 5
curl --request GET \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/persona/<PERSONA-ID>/version/?version=1-5' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Accept: application/json'
```

{% openapi src="<https://api.amigo.ai/v1/openapi.json>" path="/v1/{organization}/simulation/persona/{simulation\_persona\_id}/version/" method="get" %}
<https://api.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Related

* [Simulation Overview](/developer-guide/classic-api/core-api/simulations.md)
* [Simulation Scenarios](/developer-guide/classic-api/core-api/simulations/simulation-scenarios.md)
* [Simulation Unit Tests](/developer-guide/classic-api/core-api/simulations/simulation-unit-tests.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/classic-api/core-api/simulations/simulation-personas.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
