Delivery · unsubscribeWebPush
Turn off browser notifications
DELETE /v1/web-push/subscriptions
Removes this browser's subscription (no error if there was none).
- Who may call it
- any signed-in human
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
The browser to unsubscribe. Strict.
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint | string | required | 0–2048 chars |
{
"endpoint": "https://fcm.googleapis.com/fcm/send/c1KrmpTuRm4:APA91bGq3nYdF8wN2xH5kL7mP9rT1vY3zB6"
}
Example#
curl -s -X DELETE "https://api.logu.dev/v1/web-push/subscriptions" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"endpoint":"https://fcm.googleapis.com/fcm/send/c1KrmpTuRm4:APA91bGq3nYdF8wN2xH5kL7mP9rT1vY3zB6"}'
Responses#
204
Removed.
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 400 | unknown_field | The body has a field the endpoint doesn't know (often a typo or snake_case). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 500 | internal_error | Something went wrong on Logu's side. |