Skip to main content
POST
/
notifications
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const notification = await client.notifications.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  content: 'content',
  title: 'title',
});

console.log(notification.success);
{
  "success": true
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Autogenerated input type of SendNotificationV2

company_id
string
required

The unique identifier of the company to target. Only team members of this company will receive the notification. Clicking the notification opens your dashboard app view.

Example:

"biz_xxxxxxxxxxxxxx"

content
string
required

The main body text of the notification displayed to the user.

title
string
required

The headline text of the notification, displayed prominently to the user.

user_ids
string[] | null

An optional list of user IDs to narrow the audience. When provided, only these users receive the notification, provided they are in the targeted experience or company.

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

icon_user_id
string | null

The unique identifier of a user whose profile picture will be used as the notification icon. Defaults to the experience or company avatar when not provided.

subtitle
string | null

An optional secondary line of text displayed below the title in the notification.

rest_path
string | null

A path segment appended to the generated deep link that opens your app. Use [restPath] in your app path configuration to read this parameter. For example, '/settings/billing'.

Response

A successful response

Response from queuing a notification

success
boolean
required

Whether the notification was successfully queued for delivery