Skip to main content
POST
/
dm_channels
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 dmChannel = await client.dmChannels.create({ with_user_ids: ['string'] });

console.log(dmChannel.id);
{
  "id": "<string>",
  "created_at": "123.45",
  "name": "Project Alpha Team",
  "last_message_at": "2023-12-01T05:00:00.401Z"
}

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

Parameters for CreateDmChannelV2

with_user_ids
string[]
required

The list of user identifiers to include in the DM channel. Each entry can be an email, username, or user ID (e.g. 'user_xxxxx').

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.

company_id
string | null

The unique identifier of the company to scope this DM channel to. When set, the channel is visible only within that company context.

Example:

"biz_xxxxxxxxxxxxxx"

custom_name
string | null

A custom display name for the DM channel. For example, 'Project Discussion'.

Response

A successful response

A messaging channel that can be a one-on-one DM, group chat, company support conversation, or platform-level direct message.

id
string
required

The unique identifier for the entity

created_at
string
required

The time the entity was created (in milliseconds since Unix epoch)

Example:

"123.45"

name
string | null
required

A custom display name assigned to this channel by the user. Null if no custom name has been set.

Example:

"Project Alpha Team"

last_message_at
string<date-time> | null
required

The timestamp when the most recent message was sent in this channel. Null if no messages have been sent.

Example:

"2023-12-01T05:00:00.401Z"