> This page is for For Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://whop.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://whop.ferndocs.com/_mcp/server.

# Push notifications

> Send push notifications to users in your app, scoped by experience or company.

Send push notifications to users in your app. Notifications appear in the Whop mobile app and web interface.

## Pick your notification type

|                              | Experience notification                        | Company notification                            |
| ---------------------------- | ---------------------------------------------- | ----------------------------------------------- |
| **Audience**                 | Users with access to an experience             | Team members of a company                       |
| **Best for**                 | Customer-facing apps (alerts, social, fitness) | Dashboard apps (admin actions, reports, alerts) |
| **Required keying field**    | `experience_id`                                | `company_id`                                    |
| **Filter to specific users** | `user_ids` (must have experience access)       | `user_ids` (must be team members)               |

> **Info**
>
> Sending notifications requires the `notification:create` permission. Add it from the [Permissions guide](/developer/guides/permissions). The experience must belong to your app, or the company must have your app installed.

## Send to everyone in an experience

Send notifications to all users with access to an experience:

**`TypeScript`**

```typescript TypeScript
const result = await client.notifications.create({
  experience_id: 'exp_xxxxxxxxxxxxxx',
  title: 'New Feature Available',
  subtitle: 'Check it out now',
  content: 'We just released a new feature that helps you track your progress better.',
});

console.log(result.success); // true

```

**`Python`**

```python Python
result = client.notifications.create(
    experience_id="exp_xxxxxxxxxxxxxx",
    title="New Feature Available",
    subtitle="Check it out now",
    content="We just released a new feature that helps you track your progress better.",
)

print(result.success)  # True
```

**`Ruby`**

```ruby Ruby
result = client.notifications.create(
  experience_id: "exp_xxxxxxxxxxxxxx",
  title: "New Feature Available",
  subtitle: "Check it out now",
  content: "We just released a new feature that helps you track your progress better."
)

puts result.success  # true
```

> **Note**
>
> **Example use case:** If you're building a fitness tracking app, you could
> send a notification to everyone when a new workout program is released, or
> send targeted notifications to users who completed a 7-day streak to celebrate
> their achievement.

## Send to specific users

Use the `user_ids` parameter to send notifications only to specific users. These users must also have access to the experience.

**`TypeScript`**

```typescript TypeScript
const result = await client.notifications.create({
  experience_id: 'exp_xxxxxxxxxxxxxx',
  title: 'Complete your daily workout',
  content: 'You\'re 50% of the way to your goal. Finish strong!',
  user_ids: ['user_abc123', 'user_def456'],
});
```

**`Python`**

```python Python
result = client.notifications.create(
    experience_id="exp_xxxxxxxxxxxxxx",
    title="Complete your daily workout",
    content="You're 50% of the way to your goal. Finish strong!",
    user_ids=["user_abc123", "user_def456"],
)
```

**`Ruby`**

```ruby Ruby
result = client.notifications.create(
  experience_id: "exp_xxxxxxxxxxxxxx",
  title: "Complete your daily workout",
  content: "You're 50% of the way to your goal. Finish strong!",
  user_ids: ["user_abc123", "user_def456"]
)
```

## Send to company team members

Send notifications to all team members of a company (dashboard app users):

**`TypeScript`**

```typescript TypeScript
const result = await client.notifications.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  title: 'Monthly Report Ready',
  subtitle: 'October 2024',
  content: 'Your monthly analytics report has been generated and is ready to view.',
});
```

**`Python`**

```python Python
result = client.notifications.create(
    company_id="biz_xxxxxxxxxxxxxx",
    title="Monthly Report Ready",
    subtitle="October 2024",
    content="Your monthly analytics report has been generated and is ready to view.",
)
```

**`Ruby`**

```ruby Ruby
result = client.notifications.create(
  company_id: "biz_xxxxxxxxxxxxxx",
  title: "Monthly Report Ready",
  subtitle: "October 2024",
  content: "Your monthly analytics report has been generated and is ready to view."
)
```

> **Note**
>
> **Example use case:** If you're building a tax filing dashboard, you could
> send notifications to all team members when a filing deadline is approaching,
> or send targeted reminders to specific users who still need to complete steps
> in the filing process.

## Send to specific team members

Use the `user_ids` parameter to send notifications only to specific team members. These users must also be team members of the company.

**`TypeScript`**

```typescript TypeScript
const result = await client.notifications.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  title: 'Action Required',
  content: 'Please review and approve the pending invoices.',
  user_ids: ['user_manager1', 'user_manager2'],
});
```

**`Python`**

```python Python
result = client.notifications.create(
    company_id="biz_xxxxxxxxxxxxxx",
    title="Action Required",
    content="Please review and approve the pending invoices.",
    user_ids=["user_manager1", "user_manager2"],
)
```

**`Ruby`**

```ruby Ruby
result = client.notifications.create(
  company_id: "biz_xxxxxxxxxxxxxx",
  title: "Action Required",
  content: "Please review and approve the pending invoices.",
  user_ids: ["user_manager1", "user_manager2"]
)
```

## Deep link with rest\_path

Direct users to specific pages in your app when they tap a notification using the `rest_path` parameter.

## Setting up your app path

First, configure your app path in the dashboard to handle the dynamic route parameter:

1. Go to your app settings in the [developer dashboard](https://whop.com/dashboard/developer)
2. In the hosting section, update your "App path" to include `[restPath]`

**For experience apps:**

```
/experiences/[experienceId]/[restPath]
```

**For dashboard apps:**

```
/companies/[companyId]/[restPath]
```

## Sending notifications with deep links

Add the `rest_path` parameter to your notification. This will be appended to your app's base URL.

**`TypeScript`**

```typescript TypeScript
// Experience app: Direct to a specific workout
await client.notifications.create({
  experience_id: 'exp_xxxxxxxxxxxxxx',
  title: 'Today\'s Recommended Workout',
  content: 'Based on your progress, we recommend this HIIT session.',
  rest_path: '/workouts/hiit-advanced-1',
});

// Dashboard app: Direct to a specific report
await client.notifications.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  title: 'Unusual Activity Detected',
  content: 'Review the flagged transactions in your dashboard.',
  rest_path: '/reports/flagged-transactions',
});

```

**`Python`**

```python Python
# Experience app: Direct to a specific workout
client.notifications.create(
    experience_id="exp_xxxxxxxxxxxxxx",
    title="Today's Recommended Workout",
    content="Based on your progress, we recommend this HIIT session.",
    rest_path="/workouts/hiit-advanced-1",
)

# Dashboard app: Direct to a specific report
client.notifications.create(
    company_id="biz_xxxxxxxxxxxxxx",
    title="Unusual Activity Detected",
    content="Review the flagged transactions in your dashboard.",
    rest_path="/reports/flagged-transactions",
)
```

**`Ruby`**

```ruby Ruby
# Experience app: Direct to a specific workout
client.notifications.create(
  experience_id: "exp_xxxxxxxxxxxxxx",
  title: "Today's Recommended Workout",
  content: "Based on your progress, we recommend this HIIT session.",
  rest_path: "/workouts/hiit-advanced-1"
)

# Dashboard app: Direct to a specific report
client.notifications.create(
  company_id: "biz_xxxxxxxxxxxxxx",
  title: "Unusual Activity Detected",
  content: "Review the flagged transactions in your dashboard.",
  rest_path: "/reports/flagged-transactions"
)
```

## Handling the route in your app

When a user taps the notification, they'll be directed to the full URL constructed from your app path and the `rest_path`.

**Example for experience app:**

If your app is hosted at `https://your-app.com` and you send:

```typescript
rest_path: "/posts/post_123";
```

The user will open:

```
https://your-app.com/experiences/exp_xxxxxxxxxxxxxx/posts/post_123
```

**In Next.js**, create a file at:

```
app/experiences/[experienceId]/posts/[postId]/page.tsx
```

**In Express**, handle the route:

```typescript
app.get("/experiences/:experienceId/posts/:postId", (req, res) => {
	// Handle the notification deep link
});
```

You can also use query parameters:

```typescript
rest_path: "?action=review&id=123";
```

## Custom notification icons

By default, notifications display your experience or company avatar. Customize the icon by providing a Whop user ID whose profile picture will be used.

**`TypeScript`**

```typescript TypeScript
await client.notifications.create({
  experience_id: 'exp_xxxxxxxxxxxxxx',
  title: 'New Comment',
  content: 'Sarah replied to your post: "Great progress!"',
  icon_user_id: 'user_sarah123',
  rest_path: '/posts/my-post-123',
});
```

**`Python`**

```python Python
client.notifications.create(
    experience_id="exp_xxxxxxxxxxxxxx",
    title="New Comment",
    content='Sarah replied to your post: "Great progress!"',
    icon_user_id="user_sarah123",
    rest_path="/posts/my-post-123",
)
```

**`Ruby`**

```ruby Ruby
client.notifications.create(
  experience_id: "exp_xxxxxxxxxxxxxx",
  title: "New Comment",
  content: 'Sarah replied to your post: "Great progress!"',
  icon_user_id: "user_sarah123",
  rest_path: "/posts/my-post-123"
)
```

This is useful for social features where you want to show who performed an action (commented, liked, followed, etc).

## Next steps

#### [Build a chat bot](/developer/guides/chat)

Pair notifications with in-app messages so users get pinged regardless of where they are.

#### [Listen to webhooks](/developer/guides/webhooks)

Trigger notifications off `payment.succeeded`, `membership.activated`, and other server events.

#### [Forums](/developer/guides/forums)

Notify users when new posts or comments land in your forum experience.

#### [Request permissions](/developer/guides/permissions)

Confirm your app's permission setup so notifications send successfully.