Subscriptions
Create or Update Subscription
Registers a new device/subscription or updates an existing one (e.g., when visiting the site again).
- URL:
/subscribe - Method:
POST - Authentication: Public endpoint (Requires
X-Channel-IDheader instead of API Key).
Headers:
Body (JSON):
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | No | Target platform (web, android, ios). Defaults to web. |
endpoint | string | Yes* | The push endpoint URL (for web) or FCM/APNS token. *Required if provider_token is missing. |
provider_token | string | Yes* | FCM/APNS token. *Required if endpoint is missing. |
keys | object | Yes (for Web) | Required only if platform is web. Contains p256dh (max 255 chars) and auth (max 255 chars) strings from the browser. |
attributes | object | No | Custom JSON object for metadata (max 10 keys). Key names max 50 chars, string/number values max 255 chars. |
Response (200 / 201):