Skip to main content
All notification endpoints require authentication via auth:sanctum.

GET /api/v1/notifications

Fetch paginated notifications for the authenticated user. Unread notifications appear first, then newest first. Middleware: auth:sanctum, throttle:api
Authentication: Required

Response 200 OK

Paginated collection (10 per page) of NotificationResource objects.
data
object[]
curl https://yourdomain.com/api/v1/notifications \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"

GET /api/v1/notifications/count

Return the count of unread notifications for the authenticated user. Middleware: auth:sanctum, throttle:api
Authentication: Required

Response 200 OK

count
integer
Number of notifications where read_at is null.
{ "count": 3 }

PATCH /api/v1/notifications/read-all

Mark all unread notifications as read for the authenticated user. Middleware: auth:sanctum, throttle:api
Authentication: Required

Response 200 OK

status
string
success

PATCH /api/v1/notifications//read

Mark a single notification as read. Middleware: auth:sanctum, throttle:api
Authentication: Required

Path parameters

id
string
required
UUID of the notification to mark as read.

Response 200 OK

status
string
success
curl -X PATCH https://yourdomain.com/api/v1/notifications/550e8400-e29b-41d4-a716-446655440000/read \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"

POST /api/v1/push-subscriptions

Register or update a Web Push (VAPID) subscription for the authenticated user. Middleware: auth:sanctum, throttle:api
Authentication: Required

Request body

endpoint
string
required
The push endpoint URL provided by the browser’s Push API. Maximum 1000 characters.
keys.auth
string
required
VAPID auth key from the browser push subscription. Maximum 255 characters.
keys.p256dh
string
required
VAPID p256dh key from the browser push subscription. Maximum 255 characters.
contentEncoding
string
Optional content encoding (e.g. aesgcm, aes128gcm). Maximum 50 characters.

Response 200 OK

status
string
success
message
string
Web Push subscription updated.
curl -X POST https://yourdomain.com/api/v1/push-subscriptions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "endpoint": "https://fcm.googleapis.com/fcm/send/...",
    "keys": {
      "auth": "auth_key_here",
      "p256dh": "p256dh_key_here"
    }
  }'

DELETE /api/v1/push-subscriptions

Unregister a Web Push subscription. Middleware: auth:sanctum, throttle:api
Authentication: Required

Request body

endpoint
string
required
The push endpoint URL to remove. Maximum 1000 characters.

Response 200 OK

status
string
success
message
string
Web Push subscription deleted.
curl -X DELETE https://yourdomain.com/api/v1/push-subscriptions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"endpoint": "https://fcm.googleapis.com/fcm/send/..."}'

Build docs developers (and LLMs) love