⚽ Convocados Docs GitHub

Push Notifications API

GET /api/push/vapid-public-key

Get the server's VAPID public key for push subscription.

Response

{ "publicKey": "BPx..." }

POST /api/events/[id]/push

Subscribe to push notifications for an event.

Request body

FieldTypeRequiredDescription
endpointstringYesPush subscription endpoint URL
keys.p256dhstringYesP-256 Diffie-Hellman public key
keys.authstringYesAuthentication secret
localestringNoLanguage for notifications (e.g. "pt-PT"). Defaults to "en"
clientIdstringNoClient ID for self-notification suppression

Response

{ "ok": true }
Upsert behavior: If a subscription with the same endpoint already exists for this event, it is updated with the new keys and locale.

DELETE /api/events/[id]/push

Unsubscribe from push notifications.

Request body

FieldTypeRequiredDescription
endpointstringYesThe push subscription endpoint to remove

Response

{ "ok": true }