Chat Integrations

Send Chat Integration Message

Send a contact's message to a group or handle of a Chat integration's server

post
/v1/integration/chat/{chatIntegrationId}/message/send

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Path Parameters

chatIntegrationIdstring* Required

The ID of the Chat integration the contact writes through

Request Body * Required

Request Body Schema: application/json

tostring

The destination, a

textstring

The message text

messageIdstring

An optional UUID chosen by the client for this message. A retry with the same ID and the same message is suppressed while its deduplication state is retained. This is bounded retry suppression, not exactly-once delivery - concurrent retries, a retry after that state expires and a retry after it is evicted can be stored and delivered again

contactIdunknown

The contact who sends the message, as a contact ID or alias, or as a contact object with a fingerprint. Required with owner authentication; ignored with a Chat session token, which always sends as its own contact

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

token: process.env.CHATBOTKIT_API_TOKEN!

})

const response = await cbk.integration.chat.message.send(

chatIntegrationId,
{
"to":"string",
"text":"string",
"messageId":"string",
"contactId":""
}
)
{
"id":"string",
"recipients":[
{
"id":"string",
"handle":"string"
}
]
}
The message was accepted and handed to its recipients