Skip to content
Rigel docs
Open Rigel

Remove this browser's push subscription

me.push_subscription.delete

DELETE/api/v1/me/push-subscription

  • Route

Removes your push subscription with this endpoint. Succeeds when there is none, and never touches a subscription that belongs to someone else.

Request body#

JSON, as application/json.

Remove this browser's push subscription: request body fields
FieldDescription
endpointstringrequired

The push service URL from the browser's PushSubscription. It must be on a known push service (Google, Mozilla, Apple or Microsoft) and use https.

at most 2,048 characters

Response#

204 Removed, or there was nothing to remove. No body.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Remove this browser's push subscription: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401Read error.codeDescribed above.
401unauthenticatedThe request has no valid session.

Examples#

These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.

Remove this browser's push subscription

Request, curl
curl -X DELETE 'https://rigel.house/api/v1/me/push-subscription' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://fcm.googleapis.com/fcm/send/dQw4w9WgXcQ:APA91bHn7s3kT0example"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/me/push-subscription", {
  method: "DELETE",
  headers: {
    "Content-Type": "application/json",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    endpoint: "https://fcm.googleapis.com/fcm/send/dQw4w9WgXcQ:APA91bHn7s3kT0example",
  }),
});
const data = await response.json();
Request, HTTP
DELETE /api/v1/me/push-subscription HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json

{
  "endpoint": "https://fcm.googleapis.com/fcm/send/dQw4w9WgXcQ:APA91bHn7s3kT0example"
}
Response, 204
HTTP/1.1 204 No Content
X-Request-Id: req_01M6V9CSTB7QK3S2MCVK9RJNYM

Rigel is in early access, and sign-up is by invitation. Open Rigel