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
string
required
Bearer token con tu API key de organización.
Query Parameters
string
default:"all"
Filtrar por canal. Valores:
api, website, whatsapp, widget, dashboard, agent_builder, instagram, telegram, allnumber
default:"20"
Resultados por página. Máximo 100.
string
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
required
Array de conversaciones
Show Propiedades de cada conversación
Show Propiedades de cada conversación
string
required
ID único de la conversación
string
Título de la conversación
string
required
Canal de origen:
api, website, whatsapp, dashboard, etc.string
required
Estado:
UNRESOLVED, RESOLVED, HUMAN_REQUESTEDstring
ID del agente asociado
number
Cantidad de mensajes en la conversación
object
object
object
Metadata personalizada de la conversación
string
Fecha de creación (ISO 8601)
string
Última actualización (ISO 8601)
object
required
object
{
"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"]
}
