Skip to main content
POST
/
messages
JavaScript
import Whopsdk from 'whopsdk';

const client = new Whopsdk({
  apiKey: 'My API Key',
});

const message = await client.messages.create({ content: 'content' });

console.log(message.id);
{
  "id": "<string>",
  "content": "<string>",
  "poll": {
    "options": [
      {
        "id": "<string>",
        "text": "<string>"
      }
    ]
  },
  "replying_to_message_id": "<string>",
  "is_edited": true,
  "is_pinned": true,
  "message_type": "regular",
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "username": "<string>",
    "name": "<string>"
  },
  "view_count": 42,
  "reaction_counts": [
    {
      "emoji": "<string>",
      "count": 42
    }
  ],
  "poll_votes": [
    {
      "option_id": "<string>",
      "count": 42
    }
  ]
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Body

application/json

Parameters for CreateMessage

content
string
required

The content of the message in Markdown format.

channel_id
string | null

The ID of the channel to send to.

experience_id
string | null

The ID of the chat experience to send the message in.

Example:

"exp_xxxxxxxxxxxxxx"

attachments
object[] | null

The attachments for this message, such as videos or images.

poll
object | null

The poll for this message

Response

A successful response

Represents a message in a DM channel

id
string
required

The unique identifier for the entity

content
string | null
required

The content of the message in Markdown format

poll
object | null
required

The poll for this message

replying_to_message_id
string | null
required

The ID of the message this is replying to, if applicable

is_edited
boolean
required

Whether the message has been edited

is_pinned
boolean
required

Whether this message is pinned

message_type
enum<string>
required

The type of post

Available options:
regular,
system,
automated
user
object
required

The user who sent this message

view_count
integer | null
required

The number of times this message has been viewed

Example:

42

reaction_counts
object[]
required

The reaction counts for this message

poll_votes
object[]
required

The reaction counts for this message

I