Whop allows apps to send notifications to users and companies through the API. These get sent to the user’s notification feed on the Whop website, and as a push notification to their mobile device (if they have the Whop app installed).

Usage

To send a notification, you need to make a POST request to the /notifications endpoint.

If you are using our SDK, you can do it easily through the WhopAPI function. Here is an example of how to send the following notification:

Notification feed on whop.com



Topic Identifier

The topic_identifier is a unique identifier for the notification you want to send. You can set that up in the Developer Dashboard:

Notification data

In this object, there are 3 keys: all, in_app, and mobile.

The in_app key is used to send a notification to the user’s notification feed either on the Whop website, or mobile app. This is useful for less important notifications, such as XXX

The mobile key is used to send a push notification to the user’s mobile device. This is useful for important and time-sensitive notifications, such as alerting a user to a sneaker restock.

The all key is used to send a notification to both the user’s notification feed and mobile device.

In each of these, there are the subject and content keys. The subject key is used to specify the subject of the notification, while the content key is used to specify the description of the notification.

If you do not use the all key, you must specify the subject and content keys in both the in_app and mobile keys.

Targets

The targets array is used to specify who should receive the notification. There are 4 different targets you can use:

  • users: This takes in the user_id of the users you want to send the notification to.
  • products: This takes in the product_id of the products you want to send the notification to, and will send it to all users who own that product.
  • companies: This takes in the company_id of the companies you want to send the notification to, and will send it to all users who have an active product.
  • experiences: Uses the experience_id, and will send to all users who have an active product that uses that experience.