# Mensajes de una conversación

GET `https://api.bydomu.com/v1/conversations/{contactId}/messages`

This reference is generated from the API’s code, so descriptions are in Spanish. Names, parameters and examples are the same in every language.

Mensajes con el contacto, del más reciente al más antiguo (`pageSize` por defecto 50, máximo 100).

Permission required

`conversations:read`

Required header

`X-API-Key` · secret key

Access level

Level 2 · automatic on Inmobiliaria Pro

## Path parameters

1 · required

`contactId` string · **required**

ID del contacto

## Query parameters

2 · all optional

`page` integer · optional

Página, desde 1 default 1 · ≥ 1

`pageSize` integer · optional

Mensajes por página (máximo 100) default 50 · 1–100

## Response 200

`ConversationMessage[]` · 7 fields

**`data[]` id · body · direction · type · timestamp · mediaUrl · channel**

`id` string

`body` string

`direction` string INBOUND, OUTBOUND

`type` string TEXT, IMAGE, DOCUMENT, AUDIO, VIDEO, LOCATION

`timestamp` string

`mediaUrl` string

`channel` string WHATSAPP, INSTAGRAM, FACEBOOK, SMS, EMAIL, WEB

**`meta` Paginación por número de página.**

`total` integer Total de registros

`page` integer Página actual

`pageSize` integer Registros por página

`totalPages` integer Total de páginas

## Possible errors

shaped as `{ "error": { "code", "message" } }`

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **403** FORBIDDEN
- **404** NOT_FOUND
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl "https://api.bydomu.com/v1/conversations/clx1con001/messages" \
  -H "X-API-Key: $BYDOMU_API_KEY"
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data, meta } = await bydomu.conversations.listMessages("clx1con001");
```

Python:

```python
import os, requests

r = requests.get(
    "https://api.bydomu.com/v1/conversations/clx1con001/messages",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]}
)
data = r.json()
```

**Response · 200 · example**

```json
{
  "data": [
    {
      "id": "clx1msg001",
      "body": "Hola, ¿sigue disponible el apartamento?",
      "direction": "INBOUND",
      "type": "TEXT",
      "timestamp": "2026-09-25T10:30:00.000Z",
      "mediaUrl": "https://cdn.bydomu.com/wa/media/abc.jpg",
      "channel": "WHATSAPP"
    }
  ],
  "meta": {
    "total": 150,
    "page": 1,
    "pageSize": 20,
    "totalPages": 8
  }
}
```
