Chat Messages

Post

POST https://threads.com/api/public/postChatMessage

Post a message to a chat sending an array of blocks in markdown.

Headers

NameTypeDescription

Authorization

string

Bearer <your_api_key>

Content-Type

string

application/json

Request Body

NameTypeDescription

chat

string

This is the name of the chat you want to post to

chatID

string

This is ID of the chat you want to post to. An easy way to find a chatID for a chat is to navigate to that chat on the Threads website. The URL will be threads.com/messages/<your_chat_id>

body

string

This is the body of the message. To format the body, you can send markdown.

Example Request

curl \
  -H "Authorization: Bearer ABcD-ur5d6WK5lWZFKF3cKwp" \
  -H "Content-Type: application/json" \
  -X POST https://threads.com/api/public/postChatMessage \
  -d '{"chatID":"cb970001-e537-4a29-a269-37ca5feb86b2", "body":"hi"}'

Example Response

{
    "ok": true,
    "result":
    {
        "chatMessageID": "8d356031-c20a-4cba-9288-55e49c5632e8",
        "chatMessageURL": "https://threads.com/cb970001-e537-4a29-a269-37ca5feb86b2/8d356031-c20a-4cba-9288-55e49c5632e8"
    }
}

Delete

POST https://threads.com/api/public/deleteChatMessage

Delete a chat message posted by the bot user of the Bearer token. Pass in the messageID that you got from the postChatMessage response. Alternatively if you click on copy link on a message on web you'll get the URL pasted to your clipboard.

Headers

NameTypeDescription

Authorization

string

Bearer <your_api_key>

Content-Type

string

application/json

Request Body

NameTypeDescription

messageID

string

This is ID of the message you want to delete

Example Request

curl \
  -H "Authorization: Bearer ABcD-ur5d6WK5lWZFKF3cKwp" \
  -H "Content-Type: application/json" \
  -X POST https://threads.com/api/public/deleteChatMessage \
  -d '{"messageID":"8d356031-c20a-4cba-9288-55e49c5632e8"}'

Example Response

{
    "ok": true
}