Conversations
Listar conversaciones
Lista todas las conversaciones de tu organización con filtrado por canal y paginación.
GET
/
api
/
v2
/
conversations
curl -X GET "https://app.horneross.com/api/v2/conversations?channel=website&limit=10" \
-H "Authorization: Bearer sk_live_xxx"
async function listConversations(options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await listConversations({
channel: 'website',
limit: 10
});
console.log(result.conversations);
console.log('Has more:', result.pagination.hasMore);
import requests
def list_conversations(channel='all', limit=20, cursor=None):
params = {'channel': channel, 'limit': limit}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://app.horneross.com/api/v2/conversations',
headers={'Authorization': 'Bearer sk_live_xxx'},
params=params
)
return response.json()
result = list_conversations(channel='website', limit=10)
for conv in result['conversations']:
print(f"{conv['id']}: {conv['title']}")
{
"conversations": [
{
"id": "conv_abc123",
"title": "Consulta sobre productos",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"messageCount": 8,
"agent": {
"id": "ag_xyz789",
"name": "Agente de Ventas",
"iconUrl": "https://storage.horneross.com/icons/agent.png"
},
"lastMessage": {
"id": "msg_001",
"text": "Gracias por la información",
"from": "human",
"createdAt": "2024-01-21T15:30:00Z"
},
"metadata": {
"source": "landing_page"
},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T15:30:00Z"
}
],
"pagination": {
"limit": 20,
"cursor": "conv_abc123",
"hasMore": true
},
"filters": {
"channel": "all",
"availableChannels": ["website", "whatsapp", "api", "dashboard", "agent_builder"]
}
}
{
"error": "invalid_channel",
"validChannels": ["api", "website", "whatsapp", "dashboard", "agent_builder", "instagram", "telegram"]
}
Endpoint
GET /api/v2/conversations
Headers
Bearer token con tu API key de organización.
Query Parameters
Filtrar por canal. Valores:
api, website, whatsapp, widget, dashboard, agent_builder, instagram, telegram, allResultados por página. Máximo 100.
Cursor para paginación. Usar el ID de la última conversación de la página anterior.
curl -X GET "https://app.horneross.com/api/v2/conversations?channel=website&limit=10" \
-H "Authorization: Bearer sk_live_xxx"
async function listConversations(options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await listConversations({
channel: 'website',
limit: 10
});
console.log(result.conversations);
console.log('Has more:', result.pagination.hasMore);
import requests
def list_conversations(channel='all', limit=20, cursor=None):
params = {'channel': channel, 'limit': limit}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://app.horneross.com/api/v2/conversations',
headers={'Authorization': 'Bearer sk_live_xxx'},
params=params
)
return response.json()
result = list_conversations(channel='website', limit=10)
for conv in result['conversations']:
print(f"{conv['id']}: {conv['title']}")
Response
Array de conversaciones
Show Propiedades de cada conversación
Show Propiedades de cada conversación
ID único de la conversación
Título de la conversación
Canal de origen:
api, website, whatsapp, dashboard, etc.Estado:
UNRESOLVED, RESOLVED, HUMAN_REQUESTEDID del agente asociado
Cantidad de mensajes en la conversación
Último mensaje de la conversación
Metadata personalizada de la conversación
Fecha de creación (ISO 8601)
Última actualización (ISO 8601)
{
"conversations": [
{
"id": "conv_abc123",
"title": "Consulta sobre productos",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"messageCount": 8,
"agent": {
"id": "ag_xyz789",
"name": "Agente de Ventas",
"iconUrl": "https://storage.horneross.com/icons/agent.png"
},
"lastMessage": {
"id": "msg_001",
"text": "Gracias por la información",
"from": "human",
"createdAt": "2024-01-21T15:30:00Z"
},
"metadata": {
"source": "landing_page"
},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T15:30:00Z"
}
],
"pagination": {
"limit": 20,
"cursor": "conv_abc123",
"hasMore": true
},
"filters": {
"channel": "all",
"availableChannels": ["website", "whatsapp", "api", "dashboard", "agent_builder"]
}
}
{
"error": "invalid_channel",
"validChannels": ["api", "website", "whatsapp", "dashboard", "agent_builder", "instagram", "telegram"]
}
Was this page helpful?
⌘I
curl -X GET "https://app.horneross.com/api/v2/conversations?channel=website&limit=10" \
-H "Authorization: Bearer sk_live_xxx"
async function listConversations(options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await listConversations({
channel: 'website',
limit: 10
});
console.log(result.conversations);
console.log('Has more:', result.pagination.hasMore);
import requests
def list_conversations(channel='all', limit=20, cursor=None):
params = {'channel': channel, 'limit': limit}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://app.horneross.com/api/v2/conversations',
headers={'Authorization': 'Bearer sk_live_xxx'},
params=params
)
return response.json()
result = list_conversations(channel='website', limit=10)
for conv in result['conversations']:
print(f"{conv['id']}: {conv['title']}")
{
"conversations": [
{
"id": "conv_abc123",
"title": "Consulta sobre productos",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"messageCount": 8,
"agent": {
"id": "ag_xyz789",
"name": "Agente de Ventas",
"iconUrl": "https://storage.horneross.com/icons/agent.png"
},
"lastMessage": {
"id": "msg_001",
"text": "Gracias por la información",
"from": "human",
"createdAt": "2024-01-21T15:30:00Z"
},
"metadata": {
"source": "landing_page"
},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T15:30:00Z"
}
],
"pagination": {
"limit": 20,
"cursor": "conv_abc123",
"hasMore": true
},
"filters": {
"channel": "all",
"availableChannels": ["website", "whatsapp", "api", "dashboard", "agent_builder"]
}
}
{
"error": "invalid_channel",
"validChannels": ["api", "website", "whatsapp", "dashboard", "agent_builder", "instagram", "telegram"]
}
