Webhooks (salientes)
CRUD de los webhooks que tu organización registra para recibir eventos de Mosend.
/organizations/:orgId/webhooks-outbound·7 endpoints·Source: mosend-wb-backend/src/modules/webhooks-outbound/webhooks-outbound.controller.ts/organizations/:orgId/webhooks-outboundLista los webhooks salientes de la organización (sin el secret).
Path params
orgIdstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound' \ -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/webhooks-outboundCrea un webhook saliente suscrito a eventos.
Path params
orgIdstringrequerido
Body (JSON)
urlstring · urirequeridoeventsstring[]requeridoformatstringGENERICTEAMSSi no se pasa, el service auto-detecta a partir de la URL (Teams si es webhook.office.com etc., GENERIC en cualquier otro caso).
unansweredThresholdMinutesnumberSolo relevante si `events` incluye 'conversation.unanswered'. Min 1 para evitar spam (sub-minuto el cron no lo respeta) y Max 1440 (24h) como sanity check.
phoneNumberIdsstring[]Restricción opcional por phone-number. Vacío/ausente = el hook recibe eventos de TODOS los números (default). Si trae UUIDs, sólo recibe los de esos números.
agentStatusesstring[]Solo relevante si `events` incluye 'agent.status_changed'. Qué estados de jornada notificar. Vacío/ausente = todas las transiciones.
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"url": "https://tu-app.com/endpoint","events": [],"format": "GENERIC","unansweredThresholdMinutes": 0,"phoneNumberIds": [],"agentStatuses": []}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/webhooks-outbound/:idActualiza un webhook saliente (URL, eventos, formato, estado).
Path params
orgIdstringrequeridoidstringrequerido
Body (JSON)
urlstring · urieventsstring[]formatstringGENERICTEAMSactivebooleanunansweredThresholdMinutesnumberphoneNumberIdsstring[]agentStatusesstring[]
Respuestas
- 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound/00000000-0000-0000-0000-000000000000' \
-H 'X-Api-Key: mk_live_<prefix>.<secret>' \
-H 'Content-Type: application/json' \
-d '{"url": "https://tu-app.com/endpoint","events": [],"format": "GENERIC","active": true,"unansweredThresholdMinutes": 0,"phoneNumberIds": [],"agentStatuses": []}'{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string"
},
"timestamp": "2026-05-01T03:42:18.123Z"
}/organizations/:orgId/webhooks-outbound/:idElimina un webhook saliente.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 204
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound/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/webhooks-outbound/:id/testEnvía un evento de prueba (webhook.test) al webhook para verificar que su endpoint lo recibe.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound/00000000-0000-0000-0000-000000000000/test' \ -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/webhooks-outbound/:id/deliveriesLista el historial de entregas de un webhook saliente.
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound/00000000-0000-0000-0000-000000000000/deliveries' \ -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/webhooks-outbound/:id/secretRevela el secret de firma del webhook (no aparece en el listado).
Path params
orgIdstringrequeridoidstringrequerido
Respuestas
- 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/webhooks-outbound/00000000-0000-0000-0000-000000000000/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"
}