web-chat
Configuración del canal Web Chat (widget embebible) por organización.
/·9 endpoints·Source: mosend-wb-backend/src/modules/web-chat/web-chat.controller.ts/organizations/:orgId/web-chat/channelsLista los canales de web chat de la org.
Path params
orgIdstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels' \ -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/web-chat/channelsCrea un canal de web chat.
Path params
orgIdstringrequerido
Body (JSON)
namestringrequeridocolorstringwelcomeMessagestringallowedDomainsstring[]precaptureEnabledbooleanbotEnabledbooleanenabledboolean
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"name": "<name>","color": "<color>","welcomeMessage": "<welcomeMessage>","allowedDomains": [],"precaptureEnabled": true,"botEnabled": true,"enabled": true}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/web-chat/channels/:idActualiza un canal de web chat.
Path params
orgIdstringrequeridoidstringrequerido
Body (JSON)
namestringcolorstringwelcomeMessagestringallowedDomainsstring[]precaptureEnabledbooleanbotEnabledbooleanenabledbooleanidentityRequiredbooleanSi true, exige firma HMAC al recibir identidad pasada por el host site.
operatingHoursobjectofflineActionobjectofflineMessagestringprechatFieldsobject[]departmentsobject[]proactiveTriggersobject[]linkEmailBannerEnabledboolean
Respuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels/00000000-0000-0000-0000-000000000000' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"name": "<name>","color": "<color>","welcomeMessage": "<welcomeMessage>","allowedDomains": [],"precaptureEnabled": true,"botEnabled": true,"enabled": true,"identityRequired": true,"operatingHours": {},"offlineAction": {},"offlineMessage": "<offlineMessage>","prechatFields": [],"departments": [],"proactiveTriggers": [],"linkEmailBannerEnabled": true}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/web-chat/channels/:idElimina un canal de web chat.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels/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/web-chat/channels/:id/snippetDevuelve el snippet de instalación del widget para el canal.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels/00000000-0000-0000-0000-000000000000/snippet' \ -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/web-chat/channels/:id/identity-secretGenera o rota el secreto HMAC de identidad (se muestra una sola vez).
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels/00000000-0000-0000-0000-000000000000/identity-secret' \ -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/web-chat/channels/:id/identity-secretRevoca el secreto HMAC de identidad del canal.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/web-chat/channels/00000000-0000-0000-0000-000000000000/identity-secret' \ -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/conversations/:convId/web-chat/sendEnvía un mensaje del agente a una conversación de web chat.
Path params
orgIdstringrequeridoconvIdstringrequerido
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/conversations/00000000-0000-0000-0000-000000000000/web-chat/send' \
-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/conversations/:convId/web-chat/mediaSube un archivo a S3 para web chat y devuelve su mediaAssetId.
Path params
orgIdstringrequeridoconvIdstringrequerido
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/conversations/00000000-0000-0000-0000-000000000000/web-chat/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"
}