curl --request POST \
--url https://typebot.io/api/v1/typebots/{typebotId}/preview/startChat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"typebot": {
"id": "<string>",
"groups": [
{
"id": "<string>",
"title": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"blocks": [
{
"id": "<string>",
"type": "start",
"label": "<string>",
"outgoingEdgeId": "<string>"
}
]
}
],
"events": [
{
"id": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"type": "start",
"outgoingEdgeId": "<string>"
}
],
"edges": [
{
"id": "<string>",
"from": {
"blockId": "<string>",
"itemId": "<string>",
"pathId": "<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
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"networkErrorTitle": "<string>",
"networkErrorMessage": "<string>",
"popupBlockedTitle": "<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>",
"allowIndexing": true
},
"whatsApp": {
"isEnabled": true,
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"theme": {
"general": {
"font": "<string>",
"background": {
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"thickness": 123
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"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,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"buttonsInput": {}
},
"customCss": "<string>"
},
"updatedAt": "<string>",
"workspaceId": "<string>",
"publicTypebotId": "<string>"
},
"sessionId": "<string>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"message": {
"type": "text",
"text": "<string>",
"metadata": {
"replyId": "<string>"
},
"attachedFileUrls": [
"<string>"
]
},
"isStreamEnabled": false,
"isOnlyRegistering": false,
"prefilledVariables": {
"First name": "John",
"Email": "[email protected]"
},
"textBubbleContentFormat": "richText"
}
'{
"sessionId": "<string>",
"typebot": {
"id": "<string>",
"theme": {
"general": {
"font": "<string>",
"background": {
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"thickness": 123
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"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,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"buttonsInput": {}
},
"customCss": "<string>"
},
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"networkErrorTitle": "<string>",
"networkErrorMessage": "<string>",
"popupBlockedTitle": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
}
},
"publishedAt": "<string>"
},
"messages": [
{
"id": "<string>",
"type": "text",
"content": {
"type": "richText",
"richText": "<unknown>"
}
}
],
"lastMessageNewFormat": "<string>",
"input": {
"id": "<string>",
"type": "text input",
"outgoingEdgeId": "<string>",
"options": {
"labels": {
"placeholder": "<string>",
"button": "<string>"
},
"variableId": "<string>",
"isLong": true,
"audioClip": {
"isEnabled": true,
"saveVariableId": "<string>"
},
"attachments": {
"isEnabled": true,
"saveVariableId": "<string>"
}
},
"prefilledValue": "<string>",
"runtimeOptions": {
"paymentIntentSecret": "<string>",
"amountLabel": "<string>",
"publicKey": "<string>"
}
},
"clientSideActions": [
{
"type": "scriptToExecute",
"scriptToExecute": {
"content": "<string>",
"args": [
{
"id": "<string>",
"value": "<string>"
}
],
"isUnsafe": true,
"isCode": true
},
"lastBubbleBlockId": "<string>",
"expectsDedicatedReply": true
}
],
"logs": [
{
"description": "<string>",
"status": "<string>",
"details": "<string>",
"context": "<string>"
}
],
"dynamicTheme": {
"hostAvatarUrl": "<string>",
"guestAvatarUrl": "<string>",
"backgroundUrl": "<string>"
},
"progress": 123
}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 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"typebot": {
"id": "<string>",
"groups": [
{
"id": "<string>",
"title": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"blocks": [
{
"id": "<string>",
"type": "start",
"label": "<string>",
"outgoingEdgeId": "<string>"
}
]
}
],
"events": [
{
"id": "<string>",
"graphCoordinates": {
"x": 123,
"y": 123
},
"type": "start",
"outgoingEdgeId": "<string>"
}
],
"edges": [
{
"id": "<string>",
"from": {
"blockId": "<string>",
"itemId": "<string>",
"pathId": "<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
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"networkErrorTitle": "<string>",
"networkErrorMessage": "<string>",
"popupBlockedTitle": "<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>",
"allowIndexing": true
},
"whatsApp": {
"isEnabled": true,
"sessionExpiryTimeout": 24.005
},
"publicShare": {
"isEnabled": true
},
"security": {
"allowedOrigins": [
"<string>"
]
}
},
"theme": {
"general": {
"font": "<string>",
"background": {
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"thickness": 123
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"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,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"buttonsInput": {}
},
"customCss": "<string>"
},
"updatedAt": "<string>",
"workspaceId": "<string>",
"publicTypebotId": "<string>"
},
"sessionId": "<string>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"message": {
"type": "text",
"text": "<string>",
"metadata": {
"replyId": "<string>"
},
"attachedFileUrls": [
"<string>"
]
},
"isStreamEnabled": false,
"isOnlyRegistering": false,
"prefilledVariables": {
"First name": "John",
"Email": "[email protected]"
},
"textBubbleContentFormat": "richText"
}
'{
"sessionId": "<string>",
"typebot": {
"id": "<string>",
"theme": {
"general": {
"font": "<string>",
"background": {
"content": "<string>"
},
"progressBar": {
"isEnabled": true,
"color": "<string>",
"backgroundColor": "<string>",
"thickness": 123
}
},
"chat": {
"container": {
"maxWidth": "<string>",
"maxHeight": "<string>",
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"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,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"guestBubbles": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"buttons": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
}
},
"inputs": {
"backgroundColor": "<string>",
"color": "<string>",
"blur": 123,
"opacity": 0.5,
"border": {
"thickness": 123,
"color": "<string>",
"customRoundeness": 123,
"opacity": 0.5
},
"placeholderColor": "<string>"
},
"buttonsInput": {}
},
"customCss": "<string>"
},
"settings": {
"general": {
"isBrandingEnabled": true,
"isTypingEmulationEnabled": true,
"isInputPrefillEnabled": true,
"isHideQueryParamsEnabled": true,
"isNewResultOnRefreshEnabled": true,
"rememberUser": {
"isEnabled": true
},
"systemMessages": {
"invalidMessage": "<string>",
"botClosed": "<string>",
"networkErrorTitle": "<string>",
"networkErrorMessage": "<string>",
"popupBlockedTitle": "<string>",
"popupBlockedDescription": "<string>",
"popupBlockedButtonLabel": "<string>",
"fileUploadError": "<string>",
"fileUploadSizeError": "<string>",
"whatsAppPictureChoiceSelectLabel": "<string>"
}
},
"typingEmulation": {
"enabled": true,
"speed": 123,
"maxDelay": 123,
"delayBetweenBubbles": 2.5,
"isDisabledOnFirstMessage": true
}
},
"publishedAt": "<string>"
},
"messages": [
{
"id": "<string>",
"type": "text",
"content": {
"type": "richText",
"richText": "<unknown>"
}
}
],
"lastMessageNewFormat": "<string>",
"input": {
"id": "<string>",
"type": "text input",
"outgoingEdgeId": "<string>",
"options": {
"labels": {
"placeholder": "<string>",
"button": "<string>"
},
"variableId": "<string>",
"isLong": true,
"audioClip": {
"isEnabled": true,
"saveVariableId": "<string>"
},
"attachments": {
"isEnabled": true,
"saveVariableId": "<string>"
}
},
"prefilledValue": "<string>",
"runtimeOptions": {
"paymentIntentSecret": "<string>",
"amountLabel": "<string>",
"publicKey": "<string>"
}
},
"clientSideActions": [
{
"type": "scriptToExecute",
"scriptToExecute": {
"content": "<string>",
"args": [
{
"id": "<string>",
"value": "<string>"
}
],
"isUnsafe": true,
"isCode": true
},
"lastBubbleBlockId": "<string>",
"expectsDedicatedReply": true
}
],
"logs": [
{
"description": "<string>",
"status": "<string>",
"details": "<string>",
"context": "<string>"
}
],
"dynamicTheme": {
"hostAvatarUrl": "<string>",
"guestAvatarUrl": "<string>",
"backgroundUrl": "<string>"
},
"progress": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
If set, it will override the typebot that is used to start the chat.
- Typebot V6
- Typebot V5
Show child attributes
Show child attributes
If provided, will be used as the session ID and will overwrite any existing session with the same ID.
- Option 1
- Option 2
Show child attributes
Show child attributes
Only provide it if your flow starts with an input block and you'd like to directly provide an answer to it.
- Text
- Audio
- Command
Show child attributes
Show child attributes
If enabled, you will be required to stream OpenAI completions on a client and send the generated response back to the API.
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.
Show child attributes
Show child attributes
{
"First name": "John",
"Email": "[email protected]"
}richText, markdown Response
Successful response
To save and use for /continueChat requests.
Show child attributes
Show child attributes
- Text
- Image
- Video
- Audio
- Embed
- Custom embed
Show child attributes
Show child attributes
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
- Buttons
- Email
- Number
- URL
- Phone number
- Date
- Time
- Payment
- Rating
- File
- Picture choice
- Option 13
- Buttons v5
- File input v5
- Picture choice v5
Show child attributes
Show child attributes
Actions to execute on the client side
- Script to execute
- Redirect
- Chatwoot
- Google Analytics
- Wait
- Set variable
- Stream OpenAI
- Execute HTTP request
- Inject start props
- Init Pixel
- Exec stream
- Execute code
- Listen to webhook
Show child attributes
Show child attributes
Logs that were saved during the last execution
Show child attributes
Show child attributes
If the typebot contains dynamic avatars, dynamicTheme returns the new avatar URLs whenever their variables are updated.
Show child attributes
Show child attributes
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.