Skip to content

Notifications

The Notifications API manages in-app notifications and push token registration for Firebase Cloud Messaging (FCM). All endpoints require authentication.


List notifications for the authenticated user, newest first.

Authentication: Bearer token required.

GET /v1/notifications?page=1&per_page=20&unread=true
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...
Query ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerResults per page (default: 20)
unreadbooleanIf true, only return unread notifications
{
"success": true,
"data": [
{
"id": "01JN2XC2D3E4F5G6H7I8J9K0L1",
"type": "payment_captured",
"title": "Payment Received",
"body": "You earned $16.00 from a call with Alex",
"data": {
"call_session_id": "01JN2X6M0P5H9SRBTXY8ZDKEFG",
"amount": "16.00"
},
"read": false,
"created_at": "2026-03-15T14:10:00Z"
},
{
"id": "01JN2XD3E4F5G6H7I8J9K0L1M2",
"type": "call_incoming",
"title": "Incoming Call",
"body": "Alex is waiting for you",
"data": {
"call_session_id": "01JN2X6M0P5H9SRBTXY8ZDKEFG"
},
"read": true,
"created_at": "2026-03-15T14:00:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 15,
"total_pages": 1
}
}
TypeDescription
call_incomingGuest is waiting --- host should join
call_missedHost did not join within threshold
payment_capturedPayment captured after call
payout_completedPayout sent to bank
payout_failedPayout to bank failed
follow_newNew follower
support_replyAdmin replied to support ticket
broadcastAdmin broadcast notification

Get the count of unread notifications.

Authentication: Bearer token required.

GET /v1/notifications/unread-count
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...
{
"count": 3
}

Mark a single notification as read.

Authentication: Bearer token required.

PUT /v1/notifications/01JN2XC2D3E4F5G6H7I8J9K0L1/read
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...

Returns 204 No Content on success.

CodeStatusDescription
not_found404Notification not found or does not belong to user

Mark all notifications as read for the authenticated user.

Authentication: Bearer token required.

PUT /v1/notifications/read-all
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...

Returns 204 No Content on success.


Register a device push token for FCM push notifications.

Authentication: Bearer token required.

POST /v1/notifications/push-tokens
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...
Content-Type: application/json
{
"token": "fcm_device_token_string",
"platform": "ios"
}
FieldTypeRequiredDescription
tokenstringYesFCM device registration token
platformstringYesios, android, or web
HTTP/1.1 201 Created
{
"id": "01JN2XE4F5G6H7I8J9K0L1M2N3",
"token": "fcm_device_token_string",
"platform": "ios",
"created_at": "2026-03-15T10:00:00Z"
}

List all registered push tokens for the authenticated user.

Authentication: Bearer token required.

GET /v1/notifications/push-tokens
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...

Remove a push token (e.g., when signing out of a device).

Authentication: Bearer token required.

DELETE /v1/notifications/push-tokens/01JN2XE4F5G6H7I8J9K0L1M2N3
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...

Returns 204 No Content on success.


Terminal window
# List notifications
curl "https://api.vidivo.app/v1/notifications?per_page=10" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
# Get unread count
curl "https://api.vidivo.app/v1/notifications/unread-count" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
# Mark all as read
curl -X PUT "https://api.vidivo.app/v1/notifications/read-all" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
# Register push token
curl -X POST "https://api.vidivo.app/v1/notifications/push-tokens" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{"token":"fcm_token_here","platform":"web"}'