Notificaciones push

Referencia de 9 endpoints generados desde mosend-wb-backend/src/modules/push/push.controller.ts.

Base path: /push·9 endpoints·Source: mosend-wb-backend/src/modules/push/push.controller.ts
POST/push/device
bearer

Registra el token de push nativo del dispositivo (FCM en Android / APNs en iOS; Expo solo legacy).

Body (JSON)

  • tokenstringrequerido
  • platformstringrequerido
    IOSANDROID
  • appVersionstring

Respuestas

  • 200
curl -X POST 'https://api.mosend.dev/push/device' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"token": "<token>","platform": "IOS","appVersion": "<appVersion>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "email": "info@empresa.com",
    "password": "••••••••",
    "organizationName": "Mi Empresa"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
DELETE/push/device
bearer

Da de baja un token de push nativo (logout en el device).

Body (JSON)

  • tokenstringrequerido

Respuestas

  • 204
curl -X DELETE 'https://api.mosend.dev/push/device' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"token": "<token>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "email": "info@empresa.com",
    "password": "••••••••",
    "organizationName": "Mi Empresa"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/push/config
bearer

VAPID public key y disponibilidad del servicio.

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/push/config' \
  -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/push/subscribe
bearer

Guarda la suscripción Push del browser del usuario.

Body (JSON)

  • endpointstringrequerido
  • p256dhstringrequerido
  • authstringrequerido

Respuestas

  • 200
curl -X POST 'https://api.mosend.dev/push/subscribe' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"endpoint": "<endpoint>","p256dh": "<p256dh>","auth": "<auth>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
DELETE/push/subscribe
bearer

Elimina una suscripción Push (logout en device, toggle off).

Body (JSON)

  • endpointstringrequerido

Respuestas

  • 204
curl -X DELETE 'https://api.mosend.dev/push/subscribe' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"endpoint": "<endpoint>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/push/rotate
público

Re-registra una suscripción tras pushsubscriptionchange.

Body (JSON)

  • oldEndpointstringrequerido
  • endpointstringrequerido
  • p256dhstringrequerido
  • authstringrequerido

Respuestas

  • 200
curl -X POST 'https://api.mosend.dev/push/rotate' \
  -H 'Content-Type: application/json' \
  -d '{"oldEndpoint": "<oldEndpoint>","endpoint": "<endpoint>","p256dh": "<p256dh>","auth": "<auth>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/push/subscriptions
bearer

Lista los devices del usuario con push habilitado.

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/push/subscriptions' \
  -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/push/diagnose
bearer

Estado de un endpoint en el backend (registrado / no).

Query params

  • endpointstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/push/diagnose' \
  -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/push/test
bearer

Envía una notificación de prueba al usuario actual.

Respuestas

  • 200
curl -X POST 'https://api.mosend.dev/push/test' \
  -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"
}