Conversations
Obtener mensajes
Obtener los mensajes de una conversación específica con paginación.
GET
/
api
/
v2
/
conversations
/
{id}
/
messages
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
Endpoint
GET /api/v2/conversations/{id}/messages
Path Parameters
ID de la conversación
Headers
Bearer token con tu API key de organización.
Alternativa al query param
visitorId para identificar al visitante.Query Parameters
Mensajes por página. Máximo recomendado: 100.
Número de mensajes a saltar para paginación.
ID del mensaje para scroll infinito hacia arriba. Obtiene mensajes anteriores a este ID.
ID del visitante (requerido para agentes públicos sin autenticación).
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
Response
Array de mensajes
Show Propiedades de cada mensaje
Show Propiedades de cada mensaje
ID único del mensaje
Rol del mensaje:
user, assistant, systemContenido del mensaje
Origen:
human, agent, systemTipo:
TEXT, ACTION, TOOL_CALLEvaluación del mensaje:
good, bad, o nullMetadata adicional del mensaje
Fecha de creación (ISO 8601)
Información de la conversación
Show Propiedades de conversation
Show Propiedades de conversation
ID de la conversación
Título
Canal de origen
Estado actual
ID del agente
Información del agente incluyendo configuración actual
Metadata de la conversación
Fecha de creación
Última actualización
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
Was this page helpful?
⌘I
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
