Skip to content

Start Preview Chat

Endpoint used to start a preview chat session in Toolzz Bots.

Terminal window
curl --request POST \
--url 'https://bots-viewer.toolzz.ai/api/v1/typebots/{typebotId}/preview/startChat' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'
{
"sessionId": "<string>",
"typebot": {
"id": "<string>",
"theme": {},
"settings": {}
},
"messages": [
{
"id": "<string>",
"type": "<string>",
"content": "<any>"
}
],
"input": {
"id": "<string>",
"outgoingEdgeId": "<string>",
"type": "<string>",
"options": {
"variableId": "<string>"
}
}
}
ParameterTypeDescriptionRequired
AuthorizationStringAccess token (must contain “Bearer” before the token)Yes
ParameterTypeDescriptionRequired
typebotIdstringThe public ID of the bot to start a preview chat for.Yes

KeyTypeDescription
sessionIdstringUnique identifier of the preview session.
typebotobjectThe bot information.
typebot.idstringUnique identifier for the bot.
typebot.themeanyThe visual appearance information of the bot.
typebot.settingsanyThe pre-set configuration of the bot.
messagesobject[]The messages content and information in the bot session.
messages[].idstringUnique identifier for the message of the session.
messages[].typestringThe format of the message sent.
messages[].contentanyThe content of the message sent.
inputobjectThe bot input information.
input.idstringUnique identifier for the input of the session.
input.outgoingEdgeIdstringUnique identifier of the edge that leads out from a specific input block in the bot flow.
input.typestringThe type of content sent.
input.optionsobjectThe input options.
input.options.variableIdobjectThe unique identifier of the variable that will store the user’s selection.

To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request.