> 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.

# Direct messages

> Use DMs for private and group conversations between users

Direct messages are private conversations between two or more users. Use them when your app already has users and you want private messaging inside your product.

For embedded chat, DMs belong to your company context by default. That means users only see conversations created for your app, not unrelated Whop messages.

## When to use direct messages

Use direct messages when the conversation should be limited to specific members.

Examples:

* Buyer-to-seller messaging inside your app
* A private coaching thread between a coach and client
* A small group conversation for a project, cohort, or team
* A marketplace conversation between two matched users
* User-to-user messaging inside your app

### What makes DMs different

DMs are the chat type for private conversations between specific users.

* They can be one-on-one or group conversations with up to 50 members.
* Only the users added as members can see and participate in the conversation.
* They appear in the [DMs list element](/developer/guides/chat/dms-list-element), so users can browse and open their recent conversations.
* They can be scoped to your company, giving your embedded app its own inbox separate from unrelated Whop messages.
* They support custom conversation names and member management.

### Constraints

* DMs do not grant access based on product membership. Add or remove members directly when access changes.
* DMs do not have admin-only, read-only, or room-level moderation controls. Use [channels](/developer/guides/chat/channels) for moderated rooms.
* DMs do not include a support inbox or open/resolved workflow. Use [support chats](/developer/guides/chat/support-chats) for customer support.
* DMs are not designed for large communities, announcements, or member-wide rooms. Use [channels](/developer/guides/chat/channels) for that.

## Access model

Each DM has members. Those members are the only users who can see and participate in the conversation.

When you create DMs for embedded chat, keep them tied to your company. This gives your app its own inbox and keeps conversations separate from the rest of Whop.

> **Note**
>
> DM channel IDs start with `feed_`.

## Set up a direct message

#### Sync or create users

Make sure every participant has a Whop user ID. If your app has its own users, map them to Whop users first. See [Sync your users](/developer/guides/chat/sync-users).

#### Create the DM channel

Use [Create DM Channel](/api-reference/dm-channels/create-dm-channel) to create the conversation with its initial members.

#### Add more members when needed

Use [Create DM Member](/api-reference/dm-members/create-dm-member) to add a user to an existing DM. Use [Delete DM Member](/api-reference/dm-members/delete-dm-member) to remove one.

#### Render the conversation or list

Use the [Chat element](/developer/guides/chat/chat-element) for a single DM, or the [DMs list element](/developer/guides/chat/dms-list-element) to let users pick from their conversations.

Then render the DM with the returned channel ID:

#### React

```tsx
<ChatElement
  options={{ channelId: "feed_XXXXXXXXXXXXXX" }}
  style={{ height: "100dvh", width: "100%" }}
/>
```

#### Vanilla JS

```typescript
const chatElement = session.createElement("chat-element", {
  channelId: "feed_XXXXXXXXXXXXXX",
});

chatElement.mount("#chat-container");
```

#### Swift

```swift
WhopChatView(
    channelId: "feed_XXXXXXXXXXXXXX",
    style: .imessage
)
```

## Manage direct messages

Use [List DM Channels](/api-reference/dm-channels/list-dm-channels), [Update DM Channel](/api-reference/dm-channels/update-dm-channel), and [Delete DM Channel](/api-reference/dm-channels/delete-dm-channel) to manage conversations.

Use [List DM Members](/api-reference/dm-members/list-dm-members), [Create DM Member](/api-reference/dm-members/create-dm-member), and [Delete DM Member](/api-reference/dm-members/delete-dm-member) to manage participants.

> **Tip**
>
> If you use the DMs list element, keep it tied to your company so users only see conversations for your embedded chat experience.

## Next steps

#### [DMs list element](/developer/guides/chat/dms-list-element)

Show DM conversations and handle channel selection.

#### [Sync your users](/developer/guides/chat/sync-users)

Create or map Whop users before creating DM channels.