# API: fans, conversations and messages

_API · 7 min de lectura · Actualizado 2026-10-22 · https://lanachat.ai/guides/es/api-conversations/_

Un **fan** es una usuaria de Telegram que escribió a una de tus creadoras. Una **conversation** es el chat entre ese fan y una cuenta de Telegram. Los mensajes los envía la IA, una compañera o un script. Estos endpoints corresponden a **Live Convs** y **Fans** en la Console.

## Endpoints

| Method | Path | Description | Permission | Status |
|---|---|---|---|---|
| GET | `/fans` | Lista fans (`creator_id=`, `status=`, `list_id=`, `q=`, `spent_min=`) | `can_fan_read` | Planned |
| GET | `/fans/{id}` | Un fan: idiomas, gasto, estado, listas, notas | `can_fan_read` | Planned |
| PATCH | `/fans/{id}` | Cambia el alias, idioma de respuesta o notas del fan | `can_chat` | Planned |
| GET | `/fans/{id}/sales` | Compras del fan | `can_sales_read` | Planned |
| POST | `/fans/import` | Importa fans y mensajes antiguos (nunca envía nada) | `can_fan_import` | Planned |
| GET | `/fan-lists` | Listas (VIPs, win back…) | `can_fan_read` | Planned |
| POST | `/fan-lists` | Crea una lista | `can_chat` | Planned |
| POST | `/fan-lists/{id}/members` | Añade fans a una lista | `can_chat` | Planned |
| DELETE | `/fan-lists/{id}/members` | Quita fans de una lista | `can_chat` | Planned |
| GET | `/conversations` | Lista conversaciones (`creator_id=`, `account_id=`, `state=`, `unread=true`) | `can_fan_read` | Planned |
| GET | `/conversations/{id}` | Una conversación y quién responde | `can_fan_read` | Planned |
| GET | `/conversations/{id}/messages` | Mensajes, el más nuevo primero (`translate=en` añade traducción) | `can_fan_read` | Planned |
| POST | `/conversations/{id}/messages` | Envía un mensaje como la creadora (texto, media, oferta) | `can_chat` | Planned |
| POST | `/conversations/{id}/reactions` | Añade o quita una reacción en un mensaje de fan | `can_chat` | Planned |
| POST | `/conversations/{id}/takeover` | Una persona toma el control: la IA deja de responder a este fan | `can_chat` | Planned |
| POST | `/conversations/{id}/release` | Devuelve la conversación a la IA | `can_chat` | Planned |
| POST | `/conversations/{id}/script` | Ejecuta un script en esta conversación | `can_chat` | Planned |
| POST | `/conversations/{id}/read` | Marca la conversación como leída | `can_chat` | Planned |

## The fan object

```json
{
  "id": "fan_921",
  "display_name": "Marco",
  "username": "marco_dl",
  "creator_id": "cr_lea",
  "purchases": 9,
  "spent": { "stars": 1450, "net_cents": 1885 },
  "lists": ["vip"]
}
```

| Field | Type | Description |
|---|---|---|
| `id` | string | Empieza por `fan_` |
| `display_name` | string | Nombre del fan en Telegram |
| `username` | string o null | El @username de Telegram del fan, sin la @ |
| `creator_id` | string | La creadora a la que escribió este fan |
| `purchases` | number | Compras verificadas hasta ahora |
| `spent` | object | Total gastado: `stars` y `net_cents` en centavos de dólar USA tras la comisión y reembolsos de Telegram |
| `lists` | array of strings | Ids de las listas de fans en las que está este fan |

Un fan también lleva los idiomas en los que escribe, su etiqueta de estado, notas del equipo, un alias y un idioma de respuesta, igual que en la página **Fans**.

## The conversation object

```json
{
  "id": "conv_1001_88231",
  "fan_id": "fan_921",
  "creator_id": "cr_lea",
  "account_id": "acc_1001",
  "state": "ai",
  "status": { "tag": "active", "reason": null },
  "unread": 2,
  "last_message_at": "2026-10-06T14:02:51Z",
  "spent": { "stars": 1450, "net_cents": 1885 },
  "source_link_id": "lnk_3"
}
```

| Field | Type | Description |
|---|---|---|
| `id` | string | Empieza por `conv_` |
| `fan_id`, `creator_id`, `account_id` | string | Quién habla con quién, en qué cuenta de Telegram |
| `state` | string | Quién responde: `ai`, `human` (tomada por persona), `script` (ejecutando script) u `off` |
| `status` | object | `tag` (las etiquetas de estado de la página Fans) y el `reason` si hay |
| `unread` | number | Mensajes de fan sin leer |
| `last_message_at` | string | ISO 8601, UTC |
| `spent` | object | Lo que gastó el fan en esta conversación: `stars` y `net_cents` |
| `source_link_id` | string o null | El enlace de seguimiento por el que llegó el fan |

`status.tag` coincide con las etiquetas de estado de la página Fans (`review`, `safety_hold`, `converted`, `lost`, `underage`…). Una conversación en `off` por motivo de seguridad no puede devolverse a la IA (`409`).

## The message object

```json
{
  "id": "msg_77120",
  "from": "creator",
  "sent_by": "ai",
  "text": "Made this one this morning…",
  "media": [ { "id": "med_5521", "locked": true, "stars": 300 } ],
  "at": "2026-10-06T14:02:51Z"
}
```

| Field | Type | Description |
|---|---|---|
| `id` | string | Empieza por `msg_` |
| `from` | string | `creator` o `fan` |
| `sent_by` | string | Para mensajes de creadora: `ai`, `human` o `script` |
| `member_id` | string | La compañera que lo envió, si `sent_by` es `human` desde la Console |
| `token_id` | string | El token de acceso que lo envió, si vino desde la API |
| `text` | string | El texto del mensaje |
| `media` | array | Media enviada: `id`, `locked` (de pago y aún no comprado) y su precio en `stars` |
| `reactions` | array | Reacciones en un mensaje de fan |
| `status` | string | Para mensajes que envías: `queued`, `sent`, `read` o `failed` |
| `at` | string | ISO 8601, UTC |

`sent_by` decide la comisión de una venta, así que lo fija el servidor y nunca tu petición.

## The sale object

```json
{
  "sale_id": "sale_8812",
  "fan_id": "fan_921",
  "creator_id": "cr_lea",
  "account_id": "acc_1001",
  "conversation_id": "conv_1001_88231",
  "stars": 300,
  "net_cents": 390,
  "sent_by": "ai",
  "kind": "offer"
}
```

| Field | Type | Description |
|---|---|---|
| `sale_id` | string | Empieza por `sale_` |
| `fan_id`, `creator_id`, `account_id`, `conversation_id` | string | Quién compró, a quién, dónde |
| `stars` | number | Precio pagado en Telegram Stars |
| `net_cents` | number | Valor neto en centavos de dólar USA (un Star vale $0.013) |
| `sent_by` | string | `ai`, `human` o `script`: quién envió la oferta, define la comisión |
| `kind` | string | Qué se compró, por ejemplo `offer` |

El mismo objeto llega por [webhook](https://lanachat.ai/guides/es/api-webhooks/), evento `sale.completed`.

## Fans

### List fans

`GET /fans` · `can_fan_read`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `creator_id` | string | No | Solo los fans de esta creadora |
| `status` | string | No | Una etiqueta de estado de la página Fans, por ejemplo `converted` |
| `list_id` | string | No | Solo los fans de esta lista |
| `q` | string | No | Parte del nombre o username del fan |
| `spent_min` | number | No | Solo fans que gastaron al menos estos Stars |
| `limit`, `cursor` | number, string | No | [Paginación](https://lanachat.ai/guides/es/api-overview/) |

```bash
curl "https://api.lanachat.ai/v1/fans?creator_id=cr_lea&spent_min=1000&limit=50" \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

```json
{
  "data": [
    { "id": "fan_921", "display_name": "Marco", "username": "marco_dl", "creator_id": "cr_lea", "purchases": 9, "spent": { "stars": 1450, "net_cents": 1885 }, "lists": ["vip"] }
  ],
  "next_cursor": null
}
```

### Get a fan

`GET /fans/{id}` · `can_fan_read`

```bash
curl https://api.lanachat.ai/v1/fans/fan_921 \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

La respuesta es el fan object. Un id desconocido responde `404`.

### Update a fan

`PATCH /fans/{id}` · `can_chat`

Envía solo lo que cambie: alias, idioma de respuesta o notas del fan. La respuesta es el fan actualizado.

```bash
curl -X PATCH https://api.lanachat.ai/v1/fans/fan_921 \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"notes": "Likes beach sets, buys at night"}'
```

### List a fan's purchases

`GET /fans/{id}/sales` · `can_sales_read`

```bash
curl https://api.lanachat.ai/v1/fans/fan_921/sales \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

```json
{
  "data": [
    { "sale_id": "sale_8812", "fan_id": "fan_921", "creator_id": "cr_lea", "account_id": "acc_1001", "conversation_id": "conv_1001_88231", "stars": 300, "net_cents": 390, "sent_by": "ai", "kind": "offer" }
  ],
  "next_cursor": null
}
```

Lista paginada de sale objects. Para totales por día, enlace o fuente, usa [stats](https://lanachat.ai/guides/es/api-tracking/).

### Import fan history

`POST /fans/import` · `can_fan_import`

Añade fans antiguos y sus mensajes a tus registros, por ejemplo desde otra herramienta. Nunca envía mensajes a fans ni confirma compras.

```bash
curl -X POST https://api.lanachat.ai/v1/fans/import \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @fans-history.json
```

## Fan lists

### List fan lists

`GET /fan-lists` · `can_fan_read`

```bash
curl https://api.lanachat.ai/v1/fan-lists \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

```json
{
  "data": [ { "id": "vip", "name": "VIP" } ],
  "next_cursor": null
}
```

### Create a list

`POST /fan-lists` · `can_chat`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | El nombre que se muestra en la página Fans |

```bash
curl -X POST https://api.lanachat.ai/v1/fan-lists \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name": "Win back"}'
```

La respuesta es la nueva lista (`201`).

### Add or remove fans

`POST /fan-lists/{id}/members` y `DELETE /fan-lists/{id}/members` · `can_chat`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `fan_ids` | array of strings | Yes | Los fans a añadir o quitar |

```bash
curl -X POST https://api.lanachat.ai/v1/fan-lists/vip/members \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"fan_ids": ["fan_921"]}'
```

`DELETE` usa el mismo body. Una lista o fan desconocido responde `404`.

## Conversations

### List conversations

`GET /conversations` · `can_fan_read`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `creator_id` | string | No | Solo esta creadora |
| `account_id` | string | No | Solo esta cuenta de Telegram |
| `state` | string | No | `ai`, `human`, `script` u `off` |
| `unread` | boolean | No | `true`: solo conversaciones con mensajes de fan sin leer |
| `limit`, `cursor` | number, string | No | [Paginación](https://lanachat.ai/guides/es/api-overview/) |

```bash
curl "https://api.lanachat.ai/v1/conversations?creator_id=cr_lea&unread=true" \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

```json
{
  "data": [
    { "id": "conv_1001_88231", "fan_id": "fan_921", "creator_id": "cr_lea", "account_id": "acc_1001", "state": "ai", "status": { "tag": "active", "reason": null }, "unread": 2, "last_message_at": "2026-10-06T14:02:51Z", "spent": { "stars": 1450, "net_cents": 1885 }, "source_link_id": "lnk_3" }
  ],
  "next_cursor": null
}
```

### Get a conversation

`GET /conversations/{id}` · `can_fan_read`

```bash
curl https://api.lanachat.ai/v1/conversations/conv_1001_88231 \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

La respuesta es el conversation object; `state` indica quién responde.

### Read messages

`GET /conversations/{id}/messages` · `can_fan_read`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `translate` | string | No | Un código de idioma, por ejemplo `en`: cada mensaje también lleva traducción |
| `limit`, `cursor` | number, string | No | [Paginación](https://lanachat.ai/guides/es/api-overview/), el más nuevo primero |

```bash
curl "https://api.lanachat.ai/v1/conversations/conv_1001_88231/messages?limit=2" \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
```

```json
{
  "data": [
    { "id": "msg_77120", "from": "creator", "sent_by": "ai", "text": "Made this one this morning…", "media": [ { "id": "med_5521", "locked": true, "stars": 300 } ], "at": "2026-10-06T14:02:51Z" },
    { "id": "msg_77119", "from": "fan", "text": "show me more 😍", "reactions": [], "at": "2026-10-06T14:02:10Z" }
  ],
  "next_cursor": "eyJpZCI6Im1zZ183NzExOCJ9"
}
```

`sent_by` puede ser `ai`, `human` (con `member_id`) o `script`.

### Send a message

`POST /conversations/{id}/messages` · `can_chat`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `text` | string | Sí, o `media` | El texto, como la creadora |
| `media` | array | No | Media de Vault: `id` y `stars` para venderla bloqueada a ese precio |
| `send_at` | string o null | No | Hora ISO 8601 para programar (hasta 7 días); `null` envía ahora |

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/messages \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"text": "Only for you, tonight 🔥", "media": [{"id": "med_5522", "stars": 250}], "send_at": null}'
```

```json
{ "id": "msg_77121", "from": "creator", "sent_by": "human", "token_id": "tok_31", "status": "queued", "at": "2026-10-06T14:03:30Z" }
```

- Un mensaje enviado por la API cuenta como enviado por persona (`sent_by: "human"`, con el token que lo envió) y toma el control de la conversación (`state: "human"`) hasta que la liberes.
- `status` pasa por `queued`, `sent` y luego `read`; `failed` lleva el motivo de Telegram (por ejemplo flood wait).
- `send_at` programa el mensaje (hasta 7 días).

### React to a message

`POST /conversations/{id}/reactions` · `can_chat`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `message_id` | string | Sí | El mensaje del fan |
| `emoji` | string | Sí | La reacción |
| `on` | boolean | Sí | `true` la añade, `false` la quita |

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/reactions \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"message_id": "msg_77119", "emoji": "❤️", "on": true}'
```

### Take over

`POST /conversations/{id}/takeover` · `can_chat`

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/takeover \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

```json
{ "id": "conv_1001_88231", "state": "human", "taken_by": "tok_31", "taken_at": "2026-10-06T14:04:00Z" }
```

La IA deja de responder a este fan hasta que devuelvas la conversación.

### Give back to the AI

`POST /conversations/{id}/release` · `can_chat`

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/release \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

La respuesta es la conversación con `state: "ai"`. Una conversación en `off` por seguridad no puede devolverse (`409`).

### Run a script

`POST /conversations/{id}/script` · `can_chat`

| Parameter | Type | Required | Description |
|---|---|---|---|
| `script_id` | string | Sí | Un script de la misma creadora, ver [Scripts](https://lanachat.ai/guides/es/api-scripts/) |

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/script \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"script_id": "scr_204"}'
```

Mientras se ejecuta, el `state` de la conversación es `script`.

### Mark as read

`POST /conversations/{id}/read` · `can_chat`

```bash
curl -X POST https://api.lanachat.ai/v1/conversations/conv_1001_88231/read \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

El `unread` de la conversación vuelve a `0`.

## Artículos relacionados

- [API de LanaChat: inicio rápido, autenticación y errores](https://lanachat.ai/guides/es/api-overview/)
- [Live Convs: leer, responder y tomar el control](https://lanachat.ai/guides/es/live-convs/)
- [Fans: listas, estados y VIPs](https://lanachat.ai/guides/es/fans/)
