import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const supportChannel = await client.supportChannels.create({
company_id: 'biz_xxxxxxxxxxxxxx',
user_id: 'user_xxxxxxxxxxxxx',
});
console.log(supportChannel.id);{
"id": "<string>",
"company_id": "<string>",
"custom_name": "Project Alpha Team",
"customer_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"resolved_at": "2023-12-01T05:00:00.401Z",
"last_message_at": "2023-12-01T05:00:00.401Z"
}Open a new support channel between a company team member and a customer. Returns the existing channel if one already exists for that user.
Required permissions:
support_chat:createimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const supportChannel = await client.supportChannels.create({
company_id: 'biz_xxxxxxxxxxxxxx',
user_id: 'user_xxxxxxxxxxxxx',
});
console.log(supportChannel.id);{
"id": "<string>",
"company_id": "<string>",
"custom_name": "Project Alpha Team",
"customer_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"resolved_at": "2023-12-01T05:00:00.401Z",
"last_message_at": "2023-12-01T05:00:00.401Z"
}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 ***************************
Parameters for CreateSupportChatForUser
The unique identifier of the company to create the support channel in.
"biz_xxxxxxxxxxxxxx"
The user ID (e.g. 'user_xxxxx') or username of the customer to open a support channel for.
"user_xxxxxxxxxxxxx"
Optional custom display name for the support channel.
A successful response
A messaging channel that can be a one-on-one DM, group chat, company support conversation, or platform-level direct message.
The unique identifier for the entity
The unique identifier of the company associated with this channel. Null if this is not a support or company-scoped conversation.
A custom display name assigned to this channel by the user. Null if no custom name has been set.
"Project Alpha Team"
The customer who initiated this support conversation. Null if this is not a support chat.
Show child attributes
The timestamp when the linked support ticket was marked as resolved. Null if unresolved or not a support chat.
"2023-12-01T05:00:00.401Z"
The timestamp when the most recent message was sent in this channel. Null if no messages have been sent.
"2023-12-01T05:00:00.401Z"
Was this page helpful?