Disconnect a browser
How a browser tells Push it no longer wants notifications.
POST
/v1/browsers/{id}/disconnectAuth None. The browser's event token in the body is the credential.
Push's service worker calls this when the browser drops or replaces its push subscription (the pushsubscriptionchange event). As a project owner you disconnect a browser from the recipient's page in the dashboard instead. See disconnects.
Request#
Path parameters#
id
stringrequired
The browser's id, the
browserId it received when it connected.- Rules
- UUID
Body#
eventToken
stringrequired
The token the browser received when it connected. It must match
id.- Rules
- 1–128 characters
Response#
200 OK with { "ok": true }.
- The browser is marked disconnected and Push stops sending to it.
- Calling it for a browser that is already disconnected changes nothing and still returns
200. - Attempts still waiting for this browser end as
invalid_subscriptionand leave the month's count. - To receive notifications again, the person connects with a new connect link.
Errors#
| Code | HTTP | When |
|---|---|---|
| VALIDATION_ERROR | 400 | The body is not valid JSON, is over 16,384 bytes or has no valid eventToken. |
| UNAUTHORIZED | 401 | The id is not a UUID or eventToken does not match it. The message is “Invalid event token”. |
| NOT_FOUND | 404 | No browser with that id exists. The message is “Browser not found”. |
| RATE_LIMITED | 429 | More than 300 event and disconnect requests a minute from one IP address. The limit is shared with events. |
| INTERNAL_ERROR | 500 | Something failed on Push's side. It is safe to retry. |
Example#
⫻
curl
⫻
200 OK