Mensajes
Envío y consulta de mensajes (texto, media, plantillas, interactivos, location, contactos).
/organizations/:orgId/messages·10 endpoints·Source: mosend-wb-backend/src/modules/messages/messages.controller.ts/organizations/:orgId/messagesEnvía un mensaje de WhatsApp (texto, media o plantilla) a un contacto.
Path params
orgIdstringrequerido
Body (JSON)
typestringtextimagevideoaudiodocumentTipo de mensaje. Si no se especifica, default 'text'.
bodystringTexto del mensaje (requerido si type='text'; opcional como caption en otros).
mediaAssetIdstring · uuidId del MediaAsset previamente subido vía /web-chat/media. Requerido cuando type != 'text'.
replyToMessageIdstringUUID del Message al que el agente responde (cita visible en widget).
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"type": "text","body": "<body>","mediaAssetId": "00000000-0000-0000-0000-000000000000","replyToMessageId": "00000000-0000-0000-0000-000000000000"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"phoneNumberId": "00000000-0000-0000-0000-000000000000",
"to": "+573000000000",
"type": "text",
"payload": {
"body": "Hola desde Mosend"
}
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/productEnvía un mensaje de producto de WhatsApp Commerce (single / multi / catálogo).
Path params
orgIdstringrequerido
Body (JSON)
phoneNumberIdstring · uuidrequeridotostringrequeridocatalogIdstringrequeridoID del catálogo conectado a la WABA.
bodyTextstringfooterTextstringheaderTextstringproductRetailerIdstringSPM: un solo producto.
productsstring[]MPM (simple): lista plana de SKUs → una sección.
sectionsProductSectionDto[]MPM (con secciones): título + SKUs por sección.
catalogMessagebooleanCatalog message: muestra el catálogo completo.
thumbnailProductRetailerIdstringreplyToMessageIdstring · uuidCita a otro mensaje (context).
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/product' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"phoneNumberId": "00000000-0000-0000-0000-000000000000","to": "<to>","catalogId": "00000000-0000-0000-0000-000000000000","bodyText": "<bodyText>","footerText": "<footerText>","headerText": "<headerText>","productRetailerId": "00000000-0000-0000-0000-000000000000","products": [],"sections": [],"catalogMessage": true,"thumbnailProductRetailerId": "00000000-0000-0000-0000-000000000000","replyToMessageId": "00000000-0000-0000-0000-000000000000"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/interactiveEnvía un mensaje de servicio interactivo (lista / botón CTA URL / pedir ubicación).
Path params
orgIdstringrequerido
Body (JSON)
phoneNumberIdstring · uuidrequeridotostringrequeridokindstringrequeridolistcta_urllocation_requestrequest_contact_infobodyTextstringheaderTextstringfooterTextstringbuttonTextstringsectionsListSectionDto[]displayTextstringurlstringreplyToMessageIdstring · uuid
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/interactive' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"phoneNumberId": "00000000-0000-0000-0000-000000000000","to": "<to>","kind": "list","bodyText": "<bodyText>","headerText": "<headerText>","footerText": "<footerText>","buttonText": "<buttonText>","sections": [],"displayText": "<displayText>","url": "https://tu-app.com/endpoint","replyToMessageId": "00000000-0000-0000-0000-000000000000"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/flowEnvía un mensaje de WhatsApp Flow (formulario nativo).
Path params
orgIdstringrequerido
Body (JSON)
phoneNumberIdstring · uuidrequeridotostringrequeridoflowIdstring · uuidrequeridoId local del WhatsAppFlow (nuestra tabla).
bodyTextstringrequeridoctaTextstringrequeridoheaderTextstringfooterTextstringscreenstringdataobjectflowActionstringnavigatedata_exchangereplyToMessageIdstring · uuid
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/flow' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"phoneNumberId": "00000000-0000-0000-0000-000000000000","to": "<to>","flowId": "00000000-0000-0000-0000-000000000000","bodyText": "<bodyText>","ctaText": "<ctaText>","headerText": "<headerText>","footerText": "<footerText>","screen": "<screen>","data": {},"flowAction": "navigate","replyToMessageId": "00000000-0000-0000-0000-000000000000"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Onboarding nuevo cliente",
"steps": []
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/carouselEnvía un carrusel multimedia interactivo (hasta 10 tarjetas).
Path params
orgIdstringrequerido
Body (JSON)
phoneNumberIdstring · uuidrequeridotostringrequeridobodyTextstringrequeridocardsCarouselCardDto[]requeridoreplyToMessageIdstring · uuid
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/carousel' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"phoneNumberId": "00000000-0000-0000-0000-000000000000","to": "<to>","bodyText": "<bodyText>","cards": [],"replyToMessageId": "00000000-0000-0000-0000-000000000000"}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/:messageId/editEdita el texto de un mensaje ya enviado.
Path params
orgIdstringrequeridomessageIdstringrequerido
Body
EditMessageDtoparámetro: dtoRespuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/00000000-0000-0000-0000-000000000000/edit' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"phoneNumberId": "00000000-0000-0000-0000-000000000000","to": "+573000000000","type": "text","payload": {"body": "Hola desde Mosend"}}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"phoneNumberId": "00000000-0000-0000-0000-000000000000",
"to": "+573000000000",
"type": "text",
"payload": {
"body": "Hola desde Mosend"
}
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/:messageIdElimina un mensaje (lo oculta del inbox como tombstone).
Path params
orgIdstringrequeridomessageIdstringrequerido
Respuestas
- 200
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/00000000-0000-0000-0000-000000000000' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/:messageId/restoreRevierte el tombstone de un mensaje y lo vuelve a mostrar en el inbox.
Path params
orgIdstringrequeridomessageIdstringrequerido
Respuestas
- 200
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/00000000-0000-0000-0000-000000000000/restore' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/uploadSube un archivo a Meta como media adjunto y devuelve el mediaId para usar al enviar.
Path params
orgIdstringrequerido
Query params
phoneNumberIdstringrequerido
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/upload' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/messages/:messageId/mediaDescarga y proxyea el media de un mensaje (sirve desde caché S3 o desde Meta).
Path params
orgIdstringrequeridomessageIdstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/messages/00000000-0000-0000-0000-000000000000/media' \ -H 'X-Api-Key: mk_live_<prefix>.<secret>'
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"createdAt": "2026-05-01T03:42:18.123Z"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}