# People

> The people of an audience, one person's profile, and a direct conversation with them.

Source: https://imario.ai/docs/api/reference/people

Base URL `https://api.imario.ai/v1`. Each call needs a key that holds the scope shown and acts with at least the role shown ([Authentication](https://imario.ai/docs/api/authentication)). Errors are described in [API errors](https://imario.ai/docs/api/errors).

## List an audience's people

`GET /v1/audiences/{id}/people`

**Scope** `audiences:read` · **Role** any member

The people a study on this audience would seat in this workspace, newest first. An audience whose people are still being found lists those found so far; a market or official audience this workspace never used has none until a study asks for them.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | `integer` | No | How many objects to return (1-100). Default `20`. |
| `cursor` | query | `string` | No | The `next_cursor` of the previous page. Up to 200 characters. |

**Example**

```bash
curl https://api.imario.ai/v1/audiences/AUDIENCE_ID/people \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

**Response**

**The person object**

- `id`, `object: "person"`, `livemode`, `created_at`
- `name`, `age`, `gender`, `country`, `location`, `description` (a line about their situation), `avatar_url`, `audience_id` (the audience they were built in, when it is one you can open)

GET /people/\{id\} adds: `occupation`, `attributes` (`[{key, label, value}]`: gender, age band, education, employment, marital status, income... in plain words), `profile` (other facts about them, `{field: value}`), `based_on` (`your_data`: a real respondent of your file, or `imario`), and for people of your own data `answers` (`[{question, answer}]`) and `quotes` (`[{question, text}]`).

Returns a list: `{"object": "list", "data": [...], "has_more": false, "next_cursor": null}`. See [Pagination](https://imario.ai/docs/api/pagination).

## Retrieve a person

`GET /v1/people/{id}`

**Scope** `audiences:read` · **Role** any member

**Example**

```bash
curl https://api.imario.ai/v1/people/PERSON_ID \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

**Response**

**The person object**

- `id`, `object: "person"`, `livemode`, `created_at`
- `name`, `age`, `gender`, `country`, `location`, `description` (a line about their situation), `avatar_url`, `audience_id` (the audience they were built in, when it is one you can open)

GET /people/\{id\} adds: `occupation`, `attributes` (`[{key, label, value}]`: gender, age band, education, employment, marital status, income... in plain words), `profile` (other facts about them, `{field: value}`), `based_on` (`your_data`: a real respondent of your file, or `imario`), and for people of your own data `answers` (`[{question, answer}]`) and `quotes` (`[{question, text}]`).

## Send a person a message

`POST /v1/people/{id}/messages`

**Scope** `chat:write` · **Role** any member

The person answers in the same response, in character, from who they are (and, with `study_id`, knowing what they answered in that study). 1 credit per message, from the workspace's API daily budget too; nothing is charged when they give no answer (503 `reply_failed`). Viewers may chat. Returns their reply with `in_reply_to` (your message's id) and `credits_charged`.

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `content` | `string` | Yes | What you say to the person. Up to 4,000 characters. |
| `study_id` | `string` | No | A study this person answered in: they then know what they said there (asking why they answered as they did). Up to 64 characters. |

**Example**

```bash
curl https://api.imario.ai/v1/people/PERSON_ID/messages \
  -H "Authorization: Bearer $IMARIO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "What would make you switch to another bank?"
  }'
```

**Response**

**The person message object**

- `id`, `object: "person_message"`, `livemode`, `created_at`, `person_id`
- `role`: `user` (what you sent) or `person` (their answer); `content`

## This key's conversation with a person

`GET /v1/people/{id}/messages`

**Scope** `audiences:read` · **Role** any member

Your messages and their answers, newest first. Each key has its own conversation with each person.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | `integer` | No | How many objects to return (1-100). Default `20`. |
| `cursor` | query | `string` | No | The `next_cursor` of the previous page. Up to 200 characters. |

**Example**

```bash
curl https://api.imario.ai/v1/people/PERSON_ID/messages \
  -H "Authorization: Bearer $IMARIO_API_KEY"
```

**Response**

**The person message object**

- `id`, `object: "person_message"`, `livemode`, `created_at`, `person_id`
- `role`: `user` (what you sent) or `person` (their answer); `content`

Returns a list: `{"object": "list", "data": [...], "has_more": false, "next_cursor": null}`. See [Pagination](https://imario.ai/docs/api/pagination).
