Skip to content

Mercado Libre - Get Messages

This module allows querying post-sale conversation messages with buyers, either from a specific order or listing recent conversations.

This module requires Mercado Libre (OAuth) credentials with the following fields:

FieldDescription
access_tokenValid OAuth access token
FieldTypeRequiredDescription
credentials_idstringYesCredentials ID
pack_idstringNoPack/cart ID
order_idstringNoOrder ID
user_idstringNoUser ID
rolestringNoseller or buyer
statusstringNounread, unanswered
tagstringNopost_sale, pre_sale
limitnumberNoMessages per page
offsetnumberNoOffset
ValueDescription
unreadUnread
unansweredUnanswered
ValueDescription
post_salePost-sale messages
pre_salePre-sale questions
{
"success": true,
"messages": [
{
"id": "abc123",
"from": {
"user_id": 123456789,
"role": "buyer"
},
"to": {
"user_id": 987654321,
"role": "seller"
},
"text": "Hola, cuando llega mi pedido?",
"date_created": "2024-01-15T10:30:00.000-03:00",
"status": "unread"
}
],
"pack_id": "2000001234567890",
"conversation_status": {...},
"message": "5 messages retrieved"
}
{
"credentials_id": "meli_cuenta",
"order_id": "2000001234567890"
}
{
"credentials_id": "meli_cuenta",
"pack_id": "2000001234567890"
}
{
"credentials_id": "meli_cuenta",
"status": "unread"
}
{
"credentials_id": "meli_cuenta",
"status": "unanswered",
"role": "seller"
}
{
"credentials_id": "meli_cuenta",
"tag": "post_sale",
"limit": 50
}
FieldDescription
idUnique message ID
fromSender (user_id, role)
toRecipient
textMessage content
date_createdSend date
statusStatus (read, unread)
attachmentsFile attachments
[Message webhook] -> [MeliGetMessages] -> [Classify] -> [MeliSendMessage response]
[Schedule every 5min] -> [MeliGetMessages unread] -> [Alert if pending]
[MeliGetMessages order] -> [Analyze sentiment] -> [Classify satisfaction]
// Classify messages by urgency
const mensajes = ctx.data.messages;
const clasificados = {
urgente: [],
normal: [],
resuelto: []
};
const palabrasUrgentes = ['urgente', 'problema', 'reclamo', 'devolucion', 'reembolso'];
mensajes.forEach(m => {
const texto = m.text.toLowerCase();
if (palabrasUrgentes.some(p => texto.includes(p))) {
clasificados.urgente.push(m);
} else if (m.status === 'unread') {
clasificados.normal.push(m);
} else {
clasificados.resuelto.push(m);
}
});
ctx.data = {
total_mensajes: mensajes.length,
urgentes: clasificados.urgente.length,
pendientes: clasificados.normal.length,
resueltos: clasificados.resuelto.length,
mensajes_urgentes: clasificados.urgente
};
  • Messages are linked to orders or packs
  • Response time affects customer service metrics
  • Messages may include file attachments
  • Conversation history is important for claims
  • Deleted messages cannot be recovered