Skip to main content

Send a message

To initiate a chat, do not provide a sessionId nor a message.

Continue the conversation by providing the sessionId and the message that should answer the previous question.

Set the isPreview option to true to chat with the non-published version of the typebot.

Request Body REQUIRED
message string

The answer to the previous chat input. Do not provide it if you are starting a new chat.

sessionId string

Session ID that you get from the initial chat request to a bot. If not provided, it will create a new session.

startParams object
typebot REQUIRED

Either a Typebot ID or a Typebot object. If you provide a Typebot object, it will be executed in preview mode. (How can I find my typebot ID?).

isPreview boolean

If set to true, it will start a Preview session with the unpublished bot and it won't be saved in the Results tab. You need to be authenticated with a bearer token for this to work.

resultId string

Provide it if you'd like to overwrite an existing result.

prefilledVariables object
isStreamEnabled boolean

Set this to true if you intend to stream OpenAI completions on a client.

isOnlyRegistering boolean

If set to true, it will only register the session and not start the chat. This is used for other chat platform integration as it can require a session to be registered before sending the first message.

clientLogs object[]

Logs while executing client side actions

status string REQUIRED
description string REQUIRED
details
Responses
200

Successful response

Schema
messages object[]
id string
input object
prefilledValue string
runtimeOptions object
paymentIntentSecret string
amountLabel string
publicKey string
clientSideActions object[]
lastBubbleBlockId string
expectsDedicatedReply boolean
sessionId string
typebot object
id string
theme
settings
resultId string
dynamicTheme object
hostAvatarUrl string
guestAvatarUrl string
logs object[]
status string
description string
details
lastMessageNewFormat string

The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version.

default

Error response

Schema
message string
code string
issues object[]
message string