oCoreoCore Docs
API Reference

Push Notifications

Subscribe to push notifications

Creates a new Web Push subscription for the authenticated user.

POST
/push/subscribe

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Request Body

application/jsonRequired

Push subscription request

deviceNamestring
endpointstring
keysobject
userAgentstring
curl -X POST "//api.ocore.dev/api/push/subscribe" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceName": "string",
    "endpoint": "string",
    "keys": {
      "auth": "string",
      "p256dh": "string"
    },
    "userAgent": "string"
  }'

Created

{
  "createdAt": "string",
  "deviceName": "string",
  "endpoint": "string",
  "id": "string",
  "lastUsedAt": "string",
  "userAgent": "string"
}

Unsubscribe from push notifications

Removes a Web Push subscription by endpoint URL.

DELETE
/push/subscribe

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Request Body

application/jsonRequired

Unsubscribe request

endpointstring
curl -X DELETE "//api.ocore.dev/api/push/subscribe" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "endpoint": "string"
  }'

No Content

List push subscriptions

Returns all Web Push subscriptions for the authenticated user.

GET
/push/subscriptions

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

curl -X GET "//api.ocore.dev/api/push/subscriptions" \
  -H "Authorization: <token>"

OK

[
  {
    "createdAt": "string",
    "deviceName": "string",
    "endpoint": "string",
    "id": "string",
    "lastUsedAt": "string",
    "userAgent": "string"
  }
]

Get VAPID public key

Returns the VAPID public key for Web Push subscription.

GET
/push/vapid-key

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

curl -X GET "//api.ocore.dev/api/push/vapid-key" \
  -H "Authorization: <token>"

OK

{
  "publicKey": "string"
}

Was this page helpful?