Start preview chat
Use this endpoint to test your bot. The answers will not be saved. And some blocks like “Send email” will be skipped.
curl --request POST \
--url https://typebot.io/api/v1/typebots/{typebotId}/preview/startChat \
--header 'Content-Type: application/json' \
--data '{
"isStreamEnabled": false,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": [
"<string>"
]
},
"isOnlyRegistering": false,
"typebot": {
"version": "6",
"id": "<string>",
"groups": [
{
"id": "<string>",
"title": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"blocks": [
{
"id": "<string>",
"outgoingEdgeId": "<string>",
"type": "start",
"label": "<string>"
}
]
}
],
"events": [
{
"id": "<string>",
"outgoingEdgeId": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"type": "start"
}
],
"edges": [
{
"id": "<string>",
"from": {
"blockId": "<string>",
"itemId": "<string>"
},
"to": {
"groupId": "<string>",
"blockId": "<string>"
}
}
],
"variables": [
{
"id": "<string>",
"name": "<string>",
"isSessionVariable": true,
"value": "<string>"
}
],
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true,
"storage": "session"
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
},
"metadata": {
"title": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"favIconUrl": "<string>",
"customHeadCode": "<string>",
"googleTagManagerId": "<string>"
},
"whatsApp": {
"isEnabled": true,
"startCondition": {
"logicalOperator": "OR",
"comparisons": [
{
"id": "<string>",
"comparisonOperator": "Equal to",
"value": "<string>"
}
]
},
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"theme": {
"general": {
"font": "<string>",
"background": {
"type": "Color",
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"placement": "Top",
"thickness": 123,
"position": "fixed"
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"hostAvatar": {
"isEnabled": true,
"url": "<string>"
},
"guestAvatar": {
"isEnabled": true,
"url": "<string>"
},
"hostBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"roundness": "none",
"buttonsInput": {
"layout": "wrap"
}
},
"customCss": "<string>"
},
"updatedAt": "<string>",
"workspaceId": "<string>"
},
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"prefilledVariables": {
"First name": "John",
"Email": "[email protected]"
},
"sessionId": "<string>",
"textBubbleContentFormat": "richText"
}'
{
"sessionId": "<string>",
"typebot": {
"id": "<string>",
"version": "3",
"theme": {
"general": {
"font": "<string>",
"background": {
"type": "Color",
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"placement": "Top",
"thickness": 123,
"position": "fixed"
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"hostAvatar": {
"isEnabled": true,
"url": "<string>"
},
"guestAvatar": {
"isEnabled": true,
"url": "<string>"
},
"hostBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"roundness": "none",
"buttonsInput": {
"layout": "wrap"
}
},
"customCss": "<string>"
},
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true,
"storage": "session"
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
},
"metadata": {
"title": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"favIconUrl": "<string>",
"customHeadCode": "<string>",
"googleTagManagerId": "<string>"
},
"whatsApp": {
"isEnabled": true,
"startCondition": {
"logicalOperator": "OR",
"comparisons": [
{
"id": "<string>",
"comparisonOperator": "Equal to",
"value": "<string>"
}
]
},
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"publishedAt": "<string>"
},
"lastMessageNewFormat": "<string>",
"messages": [
{
"id": "<string>",
"type": "text",
"content": {
"type": "richText",
"richText": "<any>"
}
}
],
"input": {
"id": "<string>",
"outgoingEdgeId": "<string>",
"type": "text input",
"options": {
"labels": {
"placeholder": "<string>",
"button": "<string>"
},
"variableId": "<string>",
"isLong": true,
"audioClip": {
"isEnabled": true,
"saveVariableId": "<string>",
"visibility": "Auto"
},
"attachments": {
"isEnabled": true,
"saveVariableId": "<string>",
"visibility": "Auto"
}
},
"prefilledValue": "<string>",
"runtimeOptions": {
"paymentIntentSecret": "<string>",
"amountLabel": "<string>",
"publicKey": "<string>"
}
},
"clientSideActions": [
{
"type": "scriptToExecute",
"scriptToExecute": {
"content": "<string>",
"isCode": true,
"args": [
{
"id": "<string>",
"value": "<string>"
}
]
},
"lastBubbleBlockId": "<string>",
"expectsDedicatedReply": true
}
],
"logs": [
{
"status": "<string>",
"description": "<string>",
"details": "<string>",
"context": "<string>"
}
],
"dynamicTheme": {
"hostAvatarUrl": "<string>",
"guestAvatarUrl": "<string>",
"backgroundUrl": "<string>"
},
"progress": 123
}
Path Parameters
Body
If set to true
, it will only register the session and not start the bot. This is used for 3rd party chat platforms as it can require a session to be registered before sending the first message.
If set, it will override the typebot that is used to start the chat.
6
, 6.1
Expiration delay in hours after latest interaction
0.01 < x < 48
Top
, Bottom
fixed
, absolute
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
Deprecated, use container.border.roundeness
instead
none
, medium
, large
If provided, will be used as the session ID and will overwrite any existing session with the same ID.
richText
, markdown
Response
To save and use for /continueChat requests.
3
, 4
, 5
Top
, Bottom
fixed
, absolute
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
0 < x < 1
none
, sm
, md
, lg
, xl
, 2xl
Deprecated, use container.border.roundeness
instead
none
, medium
, large
Expiration delay in hours after latest interaction
0.01 < x < 48
The sent message is validated and formatted on the backend. For example, if for a date input you replied something like tomorrow
, the backend will convert it to a date string. This field returns the formatted message.
text input
Actions to execute on the client side
scriptToExecute
If progress bar is enabled, this field will return a number between 0 and 100 indicating the current progress based on the longest remaining path of the flow.
curl --request POST \
--url https://typebot.io/api/v1/typebots/{typebotId}/preview/startChat \
--header 'Content-Type: application/json' \
--data '{
"isStreamEnabled": false,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": [
"<string>"
]
},
"isOnlyRegistering": false,
"typebot": {
"version": "6",
"id": "<string>",
"groups": [
{
"id": "<string>",
"title": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"blocks": [
{
"id": "<string>",
"outgoingEdgeId": "<string>",
"type": "start",
"label": "<string>"
}
]
}
],
"events": [
{
"id": "<string>",
"outgoingEdgeId": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"type": "start"
}
],
"edges": [
{
"id": "<string>",
"from": {
"blockId": "<string>",
"itemId": "<string>"
},
"to": {
"groupId": "<string>",
"blockId": "<string>"
}
}
],
"variables": [
{
"id": "<string>",
"name": "<string>",
"isSessionVariable": true,
"value": "<string>"
}
],
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true,
"storage": "session"
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
},
"metadata": {
"title": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"favIconUrl": "<string>",
"customHeadCode": "<string>",
"googleTagManagerId": "<string>"
},
"whatsApp": {
"isEnabled": true,
"startCondition": {
"logicalOperator": "OR",
"comparisons": [
{
"id": "<string>",
"comparisonOperator": "Equal to",
"value": "<string>"
}
]
},
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"theme": {
"general": {
"font": "<string>",
"background": {
"type": "Color",
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"placement": "Top",
"thickness": 123,
"position": "fixed"
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"hostAvatar": {
"isEnabled": true,
"url": "<string>"
},
"guestAvatar": {
"isEnabled": true,
"url": "<string>"
},
"hostBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"roundness": "none",
"buttonsInput": {
"layout": "wrap"
}
},
"customCss": "<string>"
},
"updatedAt": "<string>",
"workspaceId": "<string>"
},
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"prefilledVariables": {
"First name": "John",
"Email": "[email protected]"
},
"sessionId": "<string>",
"textBubbleContentFormat": "richText"
}'
{
"sessionId": "<string>",
"typebot": {
"id": "<string>",
"version": "3",
"theme": {
"general": {
"font": "<string>",
"background": {
"type": "Color",
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"placement": "Top",
"thickness": 123,
"position": "fixed"
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"hostAvatar": {
"isEnabled": true,
"url": "<string>"
},
"guestAvatar": {
"isEnabled": true,
"url": "<string>"
},
"hostBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"shadow": "none",
"border": {
"thickness": 123,
"color": "<string>",
"roundeness": "none",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"roundness": "none",
"buttonsInput": {
"layout": "wrap"
}
},
"customCss": "<string>"
},
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true,
"storage": "session"
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
},
"metadata": {
"title": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"favIconUrl": "<string>",
"customHeadCode": "<string>",
"googleTagManagerId": "<string>"
},
"whatsApp": {
"isEnabled": true,
"startCondition": {
"logicalOperator": "OR",
"comparisons": [
{
"id": "<string>",
"comparisonOperator": "Equal to",
"value": "<string>"
}
]
},
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"publishedAt": "<string>"
},
"lastMessageNewFormat": "<string>",
"messages": [
{
"id": "<string>",
"type": "text",
"content": {
"type": "richText",
"richText": "<any>"
}
}
],
"input": {
"id": "<string>",
"outgoingEdgeId": "<string>",
"type": "text input",
"options": {
"labels": {
"placeholder": "<string>",
"button": "<string>"
},
"variableId": "<string>",
"isLong": true,
"audioClip": {
"isEnabled": true,
"saveVariableId": "<string>",
"visibility": "Auto"
},
"attachments": {
"isEnabled": true,
"saveVariableId": "<string>",
"visibility": "Auto"
}
},
"prefilledValue": "<string>",
"runtimeOptions": {
"paymentIntentSecret": "<string>",
"amountLabel": "<string>",
"publicKey": "<string>"
}
},
"clientSideActions": [
{
"type": "scriptToExecute",
"scriptToExecute": {
"content": "<string>",
"isCode": true,
"args": [
{
"id": "<string>",
"value": "<string>"
}
]
},
"lastBubbleBlockId": "<string>",
"expectsDedicatedReply": true
}
],
"logs": [
{
"status": "<string>",
"description": "<string>",
"details": "<string>",
"context": "<string>"
}
],
"dynamicTheme": {
"hostAvatarUrl": "<string>",
"guestAvatarUrl": "<string>",
"backgroundUrl": "<string>"
},
"progress": 123
}