POST
/
v1
/
typebots
/
{publicId}
/
startChat
curl --request POST \
  --url https://typebot.io/api/v1/typebots/{publicId}/startChat \
  --header 'Content-Type: application/json' \
  --data '{
  "message": "<string>",
  "isStreamEnabled": true,
  "resultId": "<string>",
  "isOnlyRegistering": true,
  "prefilledVariables": {
    "First name": "John",
    "Email": "[email protected]"
  }
}'
{
  "sessionId": "<string>",
  "resultId": "<string>",
  "typebot": {
    "id": "<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"
      },
      "customCss": "<string>"
    },
    "settings": {
      "general": {
        "isBrandingEnabled": true,
        "isTypingEmulationEnabled": true,
        "isInputPrefillEnabled": true,
        "isHideQueryParamsEnabled": true,
        "isNewResultOnRefreshEnabled": true,
        "rememberUser": {
          "isEnabled": true,
          "storage": "session"
        }
      },
      "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>"
        ]
      }
    }
  },
  "lastMessageNewFormat": "<string>",
  "messages": [
    {
      "id": "<string>",
      "type": "text",
      "content": {
        "html": "<string>",
        "richText": [
          "<any>"
        ],
        "plainText": "<string>"
      }
    }
  ],
  "input": {
    "id": "<string>",
    "outgoingEdgeId": "<string>",
    "type": "text input",
    "options": {
      "labels": {
        "placeholder": "<string>",
        "button": "<string>"
      },
      "variableId": "<string>",
      "isLong": true
    },
    "prefilledValue": "<string>",
    "runtimeOptions": {
      "paymentIntentSecret": "<string>",
      "amountLabel": "<string>",
      "publicKey": "<string>"
    }
  },
  "clientSideActions": [
    {
      "type": "scriptToExecute",
      "scriptToExecute": {
        "content": "<string>",
        "args": [
          {
            "id": "<string>",
            "value": "<string>"
          }
        ]
      },
      "lastBubbleBlockId": "<string>",
      "expectsDedicatedReply": true
    }
  ],
  "logs": [
    {
      "status": "<string>",
      "description": "<string>",
      "details": "<any>"
    }
  ],
  "dynamicTheme": {
    "hostAvatarUrl": "<string>",
    "guestAvatarUrl": "<string>"
  },
  "progress": 123
}

Path Parameters

publicId
string
required

Body

application/json
message
string

Only provide it if your flow starts with an input block and you'd like to directly provide an answer to it.

isStreamEnabled
boolean
default: false

If enabled, you will be required to stream OpenAI completions on a client and send the generated response back to the API.

resultId
string

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

isOnlyRegistering
boolean
default: false

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.

prefilledVariables
object

Response

200 - application/json
sessionId
string
required

To save and use for /continueChat requests.

resultId
string
typebot
object
required
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.

messages
object[]
required
input
object
clientSideActions
object[]

Actions to execute on the client side

logs
object[]

Logs that were saved during the last execution

dynamicTheme
object

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

progress
number

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.