Mensajes

Envío y consulta de mensajes (texto, media, plantillas, interactivos, location, contactos).

Base path: /organizations/:orgId/messages·10 endpoints·Source: mosend-wb-backend/src/modules/messages/messages.controller.ts
POST/organizations/:orgId/messages
bearer

Envía un mensaje de WhatsApp (texto, media o plantilla) a un contacto.

Path params

  • orgIdstringrequerido

Body (JSON)

  • typestring
    textimagevideoaudiodocument

    Tipo de mensaje. Si no se especifica, default 'text'.

  • bodystring

    Texto del mensaje (requerido si type='text'; opcional como caption en otros).

  • mediaAssetIdstring · uuid

    Id del MediaAsset previamente subido vía /web-chat/media. Requerido cuando type != 'text'.

  • replyToMessageIdstring

    UUID 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"}'
Response · 200
{
  "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"
}
POST/organizations/:orgId/messages/product
bearer

Envía un mensaje de producto de WhatsApp Commerce (single / multi / catálogo).

Path params

  • orgIdstringrequerido

Body (JSON)

  • phoneNumberIdstring · uuidrequerido
  • tostringrequerido
  • catalogIdstringrequerido

    ID del catálogo conectado a la WABA.

  • bodyTextstring
  • footerTextstring
  • headerTextstring
  • productRetailerIdstring

    SPM: un solo producto.

  • productsstring[]

    MPM (simple): lista plana de SKUs → una sección.

  • sectionsProductSectionDto[]

    MPM (con secciones): título + SKUs por sección.

  • catalogMessageboolean

    Catalog message: muestra el catálogo completo.

  • thumbnailProductRetailerIdstring
  • replyToMessageIdstring · uuid

    Cita 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"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/messages/interactive
bearer

Envía un mensaje de servicio interactivo (lista / botón CTA URL / pedir ubicación).

Path params

  • orgIdstringrequerido

Body (JSON)

  • phoneNumberIdstring · uuidrequerido
  • tostringrequerido
  • kindstringrequerido
    listcta_urllocation_requestrequest_contact_info
  • bodyTextstring
  • headerTextstring
  • footerTextstring
  • buttonTextstring
  • sectionsListSectionDto[]
  • displayTextstring
  • urlstring
  • replyToMessageIdstring · 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"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/messages/flow
bearer

Envía un mensaje de WhatsApp Flow (formulario nativo).

Path params

  • orgIdstringrequerido

Body (JSON)

  • phoneNumberIdstring · uuidrequerido
  • tostringrequerido
  • flowIdstring · uuidrequerido

    Id local del WhatsAppFlow (nuestra tabla).

  • bodyTextstringrequerido
  • ctaTextstringrequerido
  • headerTextstring
  • footerTextstring
  • screenstring
  • dataobject
  • flowActionstring
    navigatedata_exchange
  • replyToMessageIdstring · 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"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Onboarding nuevo cliente",
    "steps": []
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/messages/carousel
bearer

Envía un carrusel multimedia interactivo (hasta 10 tarjetas).

Path params

  • orgIdstringrequerido

Body (JSON)

  • phoneNumberIdstring · uuidrequerido
  • tostringrequerido
  • bodyTextstringrequerido
  • cardsCarouselCardDto[]requerido
  • replyToMessageIdstring · 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"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/messages/:messageId/edit
bearer

Edita el texto de un mensaje ya enviado.

Path params

  • orgIdstringrequerido
  • messageIdstringrequerido

Body

EditMessageDtoparámetro: dto

Respuestas

  • 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"}}'
Response · 200
{
  "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"
}
DELETE/organizations/:orgId/messages/:messageId
bearer

Elimina un mensaje (lo oculta del inbox como tombstone).

Path params

  • orgIdstringrequerido
  • messageIdstringrequerido

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>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/messages/:messageId/restore
bearer

Revierte el tombstone de un mensaje y lo vuelve a mostrar en el inbox.

Path params

  • orgIdstringrequerido
  • messageIdstringrequerido

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>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/messages/upload
bearer

Sube 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>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/messages/:messageId/media
bearer

Descarga y proxyea el media de un mensaje (sirve desde caché S3 o desde Meta).

Path params

  • orgIdstringrequerido
  • messageIdstringrequerido

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>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}