Fuente: https://crm.begraffic.com/docs/api
Índice para agentes: [llms.txt](https://crm.begraffic.com/llms.txt)

# GET /api/v1/conversations/{id}/messages

URL base: https://crm.begraffic.com. Autenticación: Authorization: Bearer <CLAVE_V1_bcrm_...>.

Definición OpenAPI de la operación (los bloques schema son esquemas, no cuerpos de ejemplo):

```json
{
  "operationId": "conversations.messages",
  "summary": "Mensajes de una conversación",
  "description": "Del más reciente al más antiguo, sin notas internas.",
  "tags": [
    "Conversaciones"
  ],
  "x-scope": "conversations:read",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "`{canal}__{id}` (p. ej. `whatsapp__573001234567`).",
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "pattern": "^[^/]+$"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Elementos por página (1–100, por defecto 50).",
      "schema": {
        "type": "string",
        "pattern": "^\\d+$"
      }
    },
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "`nextCursor` de la página anterior (opaco).",
      "schema": {
        "type": "string",
        "maxLength": 2048
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Página de resultados.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "data",
              "nextCursor"
            ],
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "inbound",
                        "outbound"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "subject": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Solo correo."
                    },
                    "at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sender": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "contact",
                            "user",
                            "bot",
                            "automation",
                            "api"
                          ]
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "email"
                      ]
                    },
                    "messageType": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "deliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "description": "Solo WhatsApp: por qué falló, cuando `deliveryStatus` es `failed` (el mismo `error` que el evento `message.status`); `null` si no hay error.",
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Código de Meta, p. ej. `131042`."
                            },
                            "title": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Título que da Meta, p. ej. «Business eligibility payment issue»."
                            }
                          },
                          "required": [
                            "code",
                            "title"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "replyToMessageId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "interaction": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "id": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "title": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "id",
                            "title",
                            "description"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attachment": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string"
                            },
                            "url": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "url",
                            "name"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "template": {
                      "description": "Solo WhatsApp saliente: la plantilla que se envió y lo que vio el contacto, para pintar la burbuja como el Buzón («Plantilla · nombre» + cuerpo + pie + botones). `null` si el mensaje no es una plantilla. En los mensajes anteriores a guardar la vista de la plantilla solo llegan `name` y `language` (sin cuerpo, cabecera, pie ni botones): el texto sigue en `text`.",
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "Nombre de la plantilla en Meta, p. ej. `be_pedir_resena_v2`."
                            },
                            "language": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Idioma con el que se envió, p. ej. `es`."
                            },
                            "header": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Texto de la cabecera, con sus variables ya sustituidas; `null` si no tiene o no es de texto (imagen, vídeo, documento o ubicación)."
                            },
                            "body": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Cuerpo tal como lo vio el contacto, sin cabecera ni pie. `null` si no se guardó: entonces el texto es `text` (que puede llevar cabecera y pie juntos)."
                            },
                            "footer": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Pie de la plantilla; `null` si no tiene o no se guardó."
                            },
                            "buttons": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "url",
                                      "phone",
                                      "quick_reply",
                                      "copy_code",
                                      "otp",
                                      "other"
                                    ]
                                  },
                                  "label": {
                                    "type": "string",
                                    "description": "Texto del botón, p. ej. «Dejar mi opinión»."
                                  },
                                  "url": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "Solo `url`: enlace http(s) con su variable ya sustituida; `null` si no se sabe."
                                  },
                                  "phone": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "Solo `phone`: teléfono (`+` y dígitos)."
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "url",
                                  "phone"
                                ]
                              },
                              "description": "Botones en su orden. Los de copiar código y OTP salen sin el código (no se expone)."
                            }
                          },
                          "required": [
                            "name",
                            "language",
                            "header",
                            "body",
                            "footer",
                            "buttons"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "direction",
                    "text",
                    "subject",
                    "at",
                    "sender",
                    "attachment"
                  ]
                }
              },
              "nextCursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "`invalid_request`: Petición inválida (cuerpo, parámetros o consulta).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "`unauthorized`: Falta la clave, no existe, está revocada o caducó.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "`insufficient_scope`: La clave no tiene el alcance que exige la ruta.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "`not_found`: No existe (o no es de este workspace).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "`rate_limited`: Demasiadas llamadas (límite por clave y minuto). Ver `Retry-After`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "500": {
      "description": "`internal`: Error interno.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```
