Notifications

Overview

The Notifications API provides endpoints for managing push notification settings for users, specifically related to Firebase Cloud Messaging (FCM) tokens.

Endpoints

Update User FCM Token

POST /api/v1/notifications/user-fcm-token

Description: Updates or registers the Firebase Cloud Messaging (FCM) token for the authenticated user's device, enabling push notifications.

Authentication Required: Yes (Requires Privy Session and Profile)

Parameters

Path Parameters

None

Query Parameters

None

Request Body

{
  "token": "string", // The FCM registration token from the client device
  "deviceIdentifier": "string" // A unique identifier for the client device/browser instance
}
Property
Type
Required
Description

token

string

Yes

The Firebase Cloud Messaging registration token.

deviceIdentifier

string

Yes

A unique identifier for the client device/browser instance.

Responses

Success Response

Code: 200 OK

Returns an object indicating the result of the operation.

Property
Type
Description

ok

boolean

Indicates if the API call itself was successful.

data

object

Container for the response data.

data.result

string

Result status: 'unchanged' (token already exists for device), 'updated' (token updated), 'created' (new token/device registered).

Error Responses

Code: 400 Bad Request

Code: 401 Unauthorized

Example

Request

Response (Example: Token Created)

Notes

  • Requires authentication.

  • Associates the provided FCM token with the authenticated user's profile and a specific device identifier.

  • Allows the backend to send push notifications to the user's device via Firebase.

  • Manages token updates and enforces a limit of 10 registered devices per profile.

Last updated