POST
/
v1
/
typebots
/
{typebotId}
/
preview
/
startChat
curl --request POST \
  --url https://typebot.io/api/v1/typebots/{typebotId}/preview/startChat \
  --header 'Content-Type: application/json' \
  --data '{
  "isOnlyRegistering": true,
  "isStreamEnabled": true,
  "message": "<string>",
  "startFrom": {
    "groupId": "<string>",
    "type": "group"
  },
  "typebot": {
    "edges": [
      {
        "from": {
          "blockId": "<string>",
          "itemId": "<string>"
        },
        "id": "<string>",
        "to": {
          "blockId": "<string>",
          "groupId": "<string>"
        }
      }
    ],
    "events": [
      "<any>"
    ],
    "groups": [
      {
        "blocks": [
          {
            "id": "<string>",
            "label": "<string>",
            "outgoingEdgeId": "<string>",
            "type": "start"
          }
        ],
        "graphCoordinates": {
          "true": 123,
          "x": 123
        },
        "id": "<string>",
        "title": "<string>"
      }
    ],
    "id": "<string>",
    "settings": {
      "general": {
        "isBrandingEnabled": true,
        "isHideQueryParamsEnabled": true,
        "isInputPrefillEnabled": true,
        "isNewResultOnRefreshEnabled": true,
        "isTypingEmulationEnabled": true,
        "rememberUser": {
          "isEnabled": true,
          "storage": "session"
        }
      },
      "metadata": {
        "customHeadCode": "<string>",
        "description": "<string>",
        "favIconUrl": "<string>",
        "googleTagManagerId": "<string>",
        "imageUrl": "<string>",
        "title": "<string>"
      },
      "publicShare": {
        "isEnabled": true
      },
      "security": {
        "allowedOrigins": [
          "<string>"
        ]
      },
      "typingEmulation": {
        "delayBetweenBubbles": 4,
        "enabled": true,
        "isDisabledOnFirstMessage": true,
        "maxDelay": 123,
        "speed": 123
      },
      "whatsApp": {
        "isEnabled": true,
        "sessionExpiryTimeout": 47,
        "startCondition": {
          "comparisons": [
            {
              "comparisonOperator": "Equal to",
              "id": "<string>",
              "value": "<string>"
            }
          ],
          "logicalOperator": "OR"
        }
      }
    },
    "theme": {
      "chat": {
        "buttons": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "guestAvatar": {
          "isEnabled": true,
          "url": "<string>"
        },
        "guestBubbles": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "hostAvatar": {
          "isEnabled": true,
          "url": "<string>"
        },
        "hostBubbles": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "inputs": {
          "backgroundColor": "<string>",
          "color": "<string>",
          "placeholderColor": "<string>"
        },
        "roundness": "none"
      },
      "customCss": "<string>",
      "general": {
        "background": {
          "content": "<string>",
          "type": "Color"
        },
        "font": "<string>"
      }
    },
    "variables": [
      {
        "id": "<string>",
        "name": "<string>",
        "value": "<string>"
      }
    ],
    "version": "3"
  }
}'
{
  "clientSideActions": [
    {
      "expectsDedicatedReply": true,
      "lastBubbleBlockId": "<string>",
      "scriptToExecute": {
        "args": [
          {
            "id": "<string>",
            "value": "<string>"
          }
        ],
        "content": "<string>"
      },
      "type": "scriptToExecute"
    }
  ],
  "dynamicTheme": {
    "guestAvatarUrl": "<string>",
    "hostAvatarUrl": "<string>"
  },
  "input": {
    "id": "<string>",
    "options": {
      "isLong": true,
      "labels": {
        "button": "<string>",
        "placeholder": "<string>"
      },
      "variableId": "<string>"
    },
    "outgoingEdgeId": "<string>",
    "type": "text input",
    "prefilledValue": "<string>",
    "runtimeOptions": {
      "amountLabel": "<string>",
      "paymentIntentSecret": "<string>",
      "publicKey": "<string>"
    }
  },
  "lastMessageNewFormat": "<string>",
  "logs": [
    {
      "description": "<string>",
      "details": "<any>",
      "status": "<string>"
    }
  ],
  "messages": [
    {
      "id": "<string>",
      "content": {
        "html": "<string>",
        "plainText": "<string>",
        "richText": [
          "<any>"
        ]
      },
      "type": "text"
    }
  ],
  "sessionId": "<string>",
  "typebot": {
    "id": "<string>",
    "settings": {
      "general": {
        "isBrandingEnabled": true,
        "isHideQueryParamsEnabled": true,
        "isInputPrefillEnabled": true,
        "isNewResultOnRefreshEnabled": true,
        "isTypingEmulationEnabled": true,
        "rememberUser": {
          "isEnabled": true,
          "storage": "session"
        }
      },
      "metadata": {
        "customHeadCode": "<string>",
        "description": "<string>",
        "favIconUrl": "<string>",
        "googleTagManagerId": "<string>",
        "imageUrl": "<string>",
        "title": "<string>"
      },
      "publicShare": {
        "isEnabled": true
      },
      "security": {
        "allowedOrigins": [
          "<string>"
        ]
      },
      "typingEmulation": {
        "delayBetweenBubbles": 4,
        "enabled": true,
        "isDisabledOnFirstMessage": true,
        "maxDelay": 123,
        "speed": 123
      },
      "whatsApp": {
        "isEnabled": true,
        "sessionExpiryTimeout": 47,
        "startCondition": {
          "comparisons": [
            {
              "comparisonOperator": "Equal to",
              "id": "<string>",
              "value": "<string>"
            }
          ],
          "logicalOperator": "OR"
        }
      }
    },
    "theme": {
      "chat": {
        "buttons": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "guestAvatar": {
          "isEnabled": true,
          "url": "<string>"
        },
        "guestBubbles": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "hostAvatar": {
          "isEnabled": true,
          "url": "<string>"
        },
        "hostBubbles": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "inputs": {
          "backgroundColor": "<string>",
          "color": "<string>",
          "placeholderColor": "<string>"
        },
        "roundness": "none"
      },
      "customCss": "<string>",
      "general": {
        "background": {
          "content": "<string>",
          "type": "Color"
        },
        "font": "<string>"
      }
    }
  }
}

Path Parameters

typebotId
string
required

Body

application/json
isOnlyRegistering
boolean

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.

isStreamEnabled
boolean
message
string
startFrom
object
  • Option 1

  • Option 2

typebot
object

If set, it will override the typebot that is used to start the chat.

  • Typebot V5

  • Typebot V6

Response

200 - application/json
clientSideActions
object[]

Actions to execute on the client side

  • Script to execute

  • Redirect

  • Chatwoot

  • Google Analytics

  • Wait

  • Set variable

  • Stream OpenAI

  • Execute webhook

  • Inject start props

  • Init Pixel

  • Exec stream

  • Execute code

dynamicTheme
object

If the typebot contains dynamic avatars, dynamicTheme returns the new avatar URLs whenever their variables are updated.

input
object
  • Text

  • Buttons

  • Email

  • Number

  • URL

  • Phone number

  • Date

  • Payment

  • Rating

  • File

  • Picture choice

  • Buttons v5

  • File input v5

  • Picture choice v5

lastMessageNewFormat
string

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.

logs
object[]

Logs that were saved during the last execution

messages
object[]
required
  • Text

  • Image

  • Video

  • Audio

  • Embed

  • Custom embed

sessionId
string
required

To save and use for /continueChat requests.

typebot
object
required