diff --git a/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts b/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts
index f08d4e3eed2..0cbd7040089 100644
--- a/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts
+++ b/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts
@@ -4,8 +4,8 @@ import * as Sentry from '@sentry/nextjs'
import { User } from '@typebot.io/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getServerSession } from 'next-auth'
-import { mockedUser } from '../mockedUser'
import { env } from '@typebot.io/env'
+import { mockedUser } from '@typebot.io/lib/mockedUser'
export const getAuthenticatedUser = async (
req: NextApiRequest,
diff --git a/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleNode.tsx b/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleNode.tsx
index 8c6599756ff..450db2b892e 100644
--- a/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleNode.tsx
+++ b/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleNode.tsx
@@ -12,8 +12,6 @@ export const AudioBubbleNode = ({ url }: Props) => {
return isDefined(url) ? (
) : (
-
- {t('editor.blocks.bubbles.audio.node.clickToEdit.text')}
-
+ {t('clickToEdit')}
)
}
diff --git a/apps/builder/src/features/blocks/bubbles/embed/components/EmbedBubbleContent.tsx b/apps/builder/src/features/blocks/bubbles/embed/components/EmbedBubbleContent.tsx
index d2dbdde86cf..66f1499ee86 100644
--- a/apps/builder/src/features/blocks/bubbles/embed/components/EmbedBubbleContent.tsx
+++ b/apps/builder/src/features/blocks/bubbles/embed/components/EmbedBubbleContent.tsx
@@ -9,10 +9,6 @@ type Props = {
export const EmbedBubbleContent = ({ block }: Props) => {
const { t } = useTranslate()
if (!block.content?.url)
- return (
-
- {t('editor.blocks.bubbles.embed.node.clickToEdit.text')}
-
- )
+ return {t('clickToEdit')}
return {t('editor.blocks.bubbles.embed.node.show.text')}
}
diff --git a/apps/builder/src/features/blocks/bubbles/image/components/ImageBubbleContent.tsx b/apps/builder/src/features/blocks/bubbles/image/components/ImageBubbleContent.tsx
index dc9a686ab75..0c1be255d65 100644
--- a/apps/builder/src/features/blocks/bubbles/image/components/ImageBubbleContent.tsx
+++ b/apps/builder/src/features/blocks/bubbles/image/components/ImageBubbleContent.tsx
@@ -11,9 +11,7 @@ export const ImageBubbleContent = ({ block }: Props) => {
const containsVariables =
block.content?.url?.includes('{{') && block.content.url.includes('}}')
return !block.content?.url ? (
-
- {t('editor.blocks.bubbles.image.node.clickToEdit.text')}
-
+ {t('clickToEdit')}
) : (
{
const { t } = useTranslate()
if (!block.content?.url || !block.content.type)
- return (
-
- {t('editor.blocks.bubbles.video.node.clickToEdit.text')}
-
- )
+ return {t('clickToEdit')}
const containsVariables =
block.content?.url?.includes('{{') && block.content.url.includes('}}')
switch (block.content.type) {
diff --git a/apps/builder/src/features/blocks/logic/typebotLink/typebotLink.spec.ts b/apps/builder/src/features/blocks/logic/typebotLink/typebotLink.spec.ts
index 208385b2022..b8f6ceaca21 100644
--- a/apps/builder/src/features/blocks/logic/typebotLink/typebotLink.spec.ts
+++ b/apps/builder/src/features/blocks/logic/typebotLink/typebotLink.spec.ts
@@ -32,7 +32,7 @@ test('should be configurable', async ({ page }) => {
await expect(page.getByTestId('selected-item-label').first()).toHaveText(
'My link typebot 2'
)
- await page.click('input[placeholder="Select a block"]')
+ await page.click('input[placeholder="Select a group"]')
await page.click('text=Group #2')
await page.click('text=Preview')
diff --git a/apps/builder/src/features/preview/components/WebPreview.tsx b/apps/builder/src/features/preview/components/WebPreview.tsx
index 02429a2ede7..a2e975e7d3b 100644
--- a/apps/builder/src/features/preview/components/WebPreview.tsx
+++ b/apps/builder/src/features/preview/components/WebPreview.tsx
@@ -4,7 +4,7 @@ import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { useGraph } from '@/features/graph/providers/GraphProvider'
import { useToast } from '@/hooks/useToast'
import { Standard } from '@typebot.io/nextjs'
-import { ChatReply } from '@typebot.io/schemas'
+import { ContinueChatResponse } from '@typebot.io/schemas'
export const WebPreview = () => {
const { typebot } = useTypebot()
@@ -13,7 +13,7 @@ export const WebPreview = () => {
const { showToast } = useToast()
- const handleNewLogs = (logs: ChatReply['logs']) => {
+ const handleNewLogs = (logs: ContinueChatResponse['logs']) => {
logs?.forEach((log) => {
showToast({
icon: ,
@@ -40,8 +40,13 @@ export const WebPreview = () => {
setPreviewingBlock({
id: block.id,
diff --git a/apps/builder/src/features/preview/components/WhatsAppPreviewInstructions.tsx b/apps/builder/src/features/preview/components/WhatsAppPreviewInstructions.tsx
index 40679450066..0994dd311d2 100644
--- a/apps/builder/src/features/preview/components/WhatsAppPreviewInstructions.tsx
+++ b/apps/builder/src/features/preview/components/WhatsAppPreviewInstructions.tsx
@@ -24,7 +24,7 @@ import { BuoyIcon, ExternalLinkIcon } from '@/components/icons'
export const WhatsAppPreviewInstructions = (props: StackProps) => {
const { typebot, save } = useTypebot()
- const { startPreviewAtGroup } = useEditor()
+ const { startPreviewAtGroup, startPreviewAtEvent } = useEditor()
const [phoneNumber, setPhoneNumber] = useState(
getPhoneNumberFromLocalStorage() ?? ''
)
@@ -56,7 +56,11 @@ export const WhatsAppPreviewInstructions = (props: StackProps) => {
mutate({
to: phoneNumber,
typebotId: typebot.id,
- startGroupId: startPreviewAtGroup,
+ startFrom: startPreviewAtGroup
+ ? { type: 'group', groupId: startPreviewAtGroup }
+ : startPreviewAtEvent
+ ? { type: 'event', eventId: startPreviewAtEvent }
+ : undefined,
})
}
diff --git a/apps/builder/src/features/whatsapp/startWhatsAppPreview.ts b/apps/builder/src/features/whatsapp/startWhatsAppPreview.ts
index 184a3d3ea12..2f6af8b1c3a 100644
--- a/apps/builder/src/features/whatsapp/startWhatsAppPreview.ts
+++ b/apps/builder/src/features/whatsapp/startWhatsAppPreview.ts
@@ -10,7 +10,7 @@ import { restartSession } from '@typebot.io/bot-engine/queries/restartSession'
import { sendChatReplyToWhatsApp } from '@typebot.io/bot-engine/whatsapp/sendChatReplyToWhatsApp'
import { sendWhatsAppMessage } from '@typebot.io/bot-engine/whatsapp/sendWhatsAppMessage'
import { isReadTypebotForbidden } from '../typebot/helpers/isReadTypebotForbidden'
-import { SessionState } from '@typebot.io/schemas'
+import { SessionState, startFromSchema } from '@typebot.io/schemas'
export const startWhatsAppPreview = authenticatedProcedure
.meta({
@@ -31,7 +31,7 @@ export const startWhatsAppPreview = authenticatedProcedure
value.replace(/\s/g, '').replace(/\+/g, '').replace(/-/g, '')
),
typebotId: z.string(),
- startGroupId: z.string().optional(),
+ startFrom: startFromSchema.optional(),
})
)
.output(
@@ -39,135 +39,133 @@ export const startWhatsAppPreview = authenticatedProcedure
message: z.string(),
})
)
- .mutation(
- async ({ input: { to, typebotId, startGroupId }, ctx: { user } }) => {
- if (
- !env.WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID ||
- !env.META_SYSTEM_USER_TOKEN ||
- !env.WHATSAPP_PREVIEW_TEMPLATE_NAME
- )
- throw new TRPCError({
- code: 'BAD_REQUEST',
- message:
- 'Missing WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID or META_SYSTEM_USER_TOKEN or WHATSAPP_PREVIEW_TEMPLATE_NAME env variables',
- })
+ .mutation(async ({ input: { to, typebotId, startFrom }, ctx: { user } }) => {
+ if (
+ !env.WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID ||
+ !env.META_SYSTEM_USER_TOKEN ||
+ !env.WHATSAPP_PREVIEW_TEMPLATE_NAME
+ )
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message:
+ 'Missing WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID or META_SYSTEM_USER_TOKEN or WHATSAPP_PREVIEW_TEMPLATE_NAME env variables',
+ })
- const existingTypebot = await prisma.typebot.findFirst({
- where: {
- id: typebotId,
- },
- select: {
- id: true,
- workspaceId: true,
- collaborators: {
- select: {
- userId: true,
- },
+ const existingTypebot = await prisma.typebot.findFirst({
+ where: {
+ id: typebotId,
+ },
+ select: {
+ id: true,
+ workspaceId: true,
+ collaborators: {
+ select: {
+ userId: true,
},
},
- })
- if (
- !existingTypebot?.id ||
- (await isReadTypebotForbidden(existingTypebot, user))
- )
- throw new TRPCError({ code: 'NOT_FOUND', message: 'Typebot not found' })
+ },
+ })
+ if (
+ !existingTypebot?.id ||
+ (await isReadTypebotForbidden(existingTypebot, user))
+ )
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Typebot not found' })
- const sessionId = `wa-preview-${to}`
+ const sessionId = `wa-preview-${to}`
- const existingSession = await prisma.chatSession.findFirst({
- where: {
- id: sessionId,
- },
- select: {
- updatedAt: true,
- state: true,
- },
- })
+ const existingSession = await prisma.chatSession.findFirst({
+ where: {
+ id: sessionId,
+ },
+ select: {
+ updatedAt: true,
+ state: true,
+ },
+ })
- // For users that did not interact with the bot in the last 24 hours, we need to send a template message.
- const canSendDirectMessagesToUser =
- (existingSession?.updatedAt.getTime() ?? 0) >
- Date.now() - 24 * 60 * 60 * 1000
+ // For users that did not interact with the bot in the last 24 hours, we need to send a template message.
+ const canSendDirectMessagesToUser =
+ (existingSession?.updatedAt.getTime() ?? 0) >
+ Date.now() - 24 * 60 * 60 * 1000
- const {
- newSessionState,
+ const {
+ newSessionState,
+ messages,
+ input,
+ clientSideActions,
+ logs,
+ visitedEdges,
+ } = await startSession({
+ version: 2,
+ message: undefined,
+ startParams: {
+ isOnlyRegistering: !canSendDirectMessagesToUser,
+ type: 'preview',
+ typebotId,
+ startFrom,
+ userId: user.id,
+ },
+ initialSessionState: {
+ whatsApp: (existingSession?.state as SessionState | undefined)
+ ?.whatsApp,
+ },
+ })
+
+ if (canSendDirectMessagesToUser) {
+ await sendChatReplyToWhatsApp({
+ to,
+ typingEmulation: newSessionState.typingEmulation,
messages,
input,
clientSideActions,
- logs,
- visitedEdges,
- } = await startSession({
- version: 2,
- message: undefined,
- startParams: {
- isOnlyRegistering: !canSendDirectMessagesToUser,
- typebot: typebotId,
- isPreview: true,
- startGroupId,
+ credentials: {
+ phoneNumberId: env.WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID,
+ systemUserAccessToken: env.META_SYSTEM_USER_TOKEN,
},
- userId: user.id,
- initialSessionState: {
- whatsApp: (existingSession?.state as SessionState | undefined)
- ?.whatsApp,
+ state: newSessionState,
+ })
+ await saveStateToDatabase({
+ clientSideActions: [],
+ input,
+ logs,
+ session: {
+ id: sessionId,
+ state: newSessionState,
},
+ visitedEdges,
})
-
- if (canSendDirectMessagesToUser) {
- await sendChatReplyToWhatsApp({
+ } else {
+ await restartSession({
+ state: newSessionState,
+ id: sessionId,
+ })
+ try {
+ await sendWhatsAppMessage({
to,
- typingEmulation: newSessionState.typingEmulation,
- messages,
- input,
- clientSideActions,
+ message: {
+ type: 'template',
+ template: {
+ language: {
+ code: env.WHATSAPP_PREVIEW_TEMPLATE_LANG,
+ },
+ name: env.WHATSAPP_PREVIEW_TEMPLATE_NAME,
+ },
+ },
credentials: {
phoneNumberId: env.WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID,
systemUserAccessToken: env.META_SYSTEM_USER_TOKEN,
},
- state: newSessionState,
- })
- await saveStateToDatabase({
- clientSideActions: [],
- input,
- logs,
- session: {
- id: sessionId,
- state: newSessionState,
- },
- visitedEdges,
})
- } else {
- await restartSession({
- state: newSessionState,
- id: sessionId,
+ } catch (err) {
+ if (err instanceof HTTPError) console.log(err.response.body)
+ throw new TRPCError({
+ code: 'INTERNAL_SERVER_ERROR',
+ message: 'Request to Meta to send preview message failed',
+ cause: err,
})
- try {
- await sendWhatsAppMessage({
- to,
- message: {
- type: 'template',
- template: {
- language: {
- code: env.WHATSAPP_PREVIEW_TEMPLATE_LANG,
- },
- name: env.WHATSAPP_PREVIEW_TEMPLATE_NAME,
- },
- },
- credentials: {
- phoneNumberId: env.WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID,
- systemUserAccessToken: env.META_SYSTEM_USER_TOKEN,
- },
- })
- } catch (err) {
- if (err instanceof HTTPError) console.log(err.response.body)
- throw new TRPCError({
- code: 'INTERNAL_SERVER_ERROR',
- message: 'Request to Meta to send preview message failed',
- cause: err,
- })
- }
- }
- return {
- message: 'success',
}
}
- )
+ return {
+ message: 'success',
+ }
+ })
diff --git a/apps/builder/src/pages/api/auth/[...nextauth].ts b/apps/builder/src/pages/api/auth/[...nextauth].ts
index e2ebd133931..30f43c02676 100644
--- a/apps/builder/src/pages/api/auth/[...nextauth].ts
+++ b/apps/builder/src/pages/api/auth/[...nextauth].ts
@@ -11,7 +11,7 @@ import { NextApiRequest, NextApiResponse } from 'next'
import { customAdapter } from '../../../features/auth/api/customAdapter'
import { User } from '@typebot.io/prisma'
import { getAtPath, isDefined } from '@typebot.io/lib'
-import { mockedUser } from '@/features/auth/mockedUser'
+import { mockedUser } from '@typebot.io/lib/mockedUser'
import { getNewUserInvitations } from '@/features/auth/helpers/getNewUserInvitations'
import { sendVerificationRequest } from '@/features/auth/helpers/sendVerificationRequest'
import { Ratelimit } from '@upstash/ratelimit'
diff --git a/apps/docs/openapi/builder/_spec_.json b/apps/docs/openapi/builder/_spec_.json
index 4c1cc411e49..0631ae97d97 100644
--- a/apps/docs/openapi/builder/_spec_.json
+++ b/apps/docs/openapi/builder/_spec_.json
@@ -624,7 +624,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -634,6 +636,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -3929,7 +3937,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -3939,6 +3949,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -8007,7 +8023,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -8017,6 +8035,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -11708,7 +11732,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -11718,6 +11744,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -15497,7 +15529,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -15507,6 +15541,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -19195,7 +19235,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -19205,6 +19247,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -22918,7 +22966,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -22928,6 +22978,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -26647,7 +26703,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -26657,6 +26715,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -30203,7 +30267,6 @@
"version",
"id",
"name",
- "events",
"groups",
"edges",
"variables",
@@ -30425,7 +30488,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -30435,6 +30500,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -34213,7 +34284,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -34223,6 +34296,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -37878,7 +37957,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -37888,6 +37969,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -41678,7 +41765,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -41688,6 +41777,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -45166,10 +45261,6 @@
"type": "string",
"nullable": true
},
- "publicId": {
- "type": "string",
- "nullable": true
- },
"resultsTablePreferences": {
"type": "object",
"properties": {
@@ -45208,15 +45299,13 @@
"required": [
"version",
"name",
- "events",
"groups",
"edges",
"variables",
"theme",
"settings",
"icon",
- "folderId",
- "publicId"
+ "folderId"
],
"additionalProperties": false
},
@@ -45418,7 +45507,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -45428,6 +45519,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -48816,10 +48913,6 @@
"type": "string",
"nullable": true
},
- "publicId": {
- "type": "string",
- "nullable": true
- },
"resultsTablePreferences": {
"type": "object",
"properties": {
@@ -48865,8 +48958,7 @@
"theme",
"settings",
"icon",
- "folderId",
- "publicId"
+ "folderId"
],
"additionalProperties": false
}
@@ -49092,7 +49184,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -49102,6 +49196,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -55954,8 +56054,47 @@
"type": "string",
"minLength": 1
},
- "startGroupId": {
- "type": "string"
+ "startFrom": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "group"
+ ]
+ },
+ "groupId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "groupId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "event"
+ ]
+ },
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
}
},
"required": [
diff --git a/apps/docs/openapi/chat/_spec_.json b/apps/docs/openapi/chat/_spec_.json
index 447ac6ba729..83d5df60614 100644
--- a/apps/docs/openapi/chat/_spec_.json
+++ b/apps/docs/openapi/chat/_spec_.json
@@ -2,19 +2,22 @@
"openapi": "3.0.3",
"info": {
"title": "Chat API",
- "version": "2.0.0"
+ "version": "3.0.0"
},
"servers": [
{
- "url": "https://typebot.io/api/v2"
+ "url": "https://typebot.io/api"
}
],
"paths": {
- "/sendMessage": {
+ "/v1/sendMessage": {
"post": {
- "operationId": "sendMessageV2",
+ "operationId": "sendMessageV1",
"summary": "Send a message",
"description": "To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.",
+ "tags": [
+ "Deprecated"
+ ],
"requestBody": {
"required": true,
"content": {
@@ -219,7 +222,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -229,6 +234,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -3710,7 +3721,6 @@
"version",
"id",
"groups",
- "events",
"edges",
"variables",
"settings",
@@ -3870,7 +3880,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -3880,6 +3892,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -7540,7 +7558,9 @@
"enum": [
"url",
"youtube",
- "vimeo"
+ "vimeo",
+ "tiktok",
+ "gumlet"
]
},
"height": {
@@ -7550,6 +7570,12 @@
},
{}
]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
}
},
"additionalProperties": false
@@ -10563,84 +10589,18 @@
"default": {
"$ref": "#/components/responses/error"
}
- }
- }
- },
- "/typebots/{typebotId}/blocks/{blockId}/storage/upload-url": {
- "get": {
- "operationId": "getUploadUrl",
- "summary": "Get upload URL for a file",
- "description": "Used for the web client to get the bucket upload file.",
- "parameters": [
- {
- "name": "typebotId",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "blockId",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "filePath",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "fileType",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "presignedUrl": {
- "type": "string"
- },
- "hasReachedStorageLimit": {
- "type": "boolean"
- }
- },
- "required": [
- "presignedUrl",
- "hasReachedStorageLimit"
- ],
- "additionalProperties": false
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
},
"deprecated": true
}
},
- "/generate-upload-url": {
+ "/v2/sendMessage": {
"post": {
- "operationId": "generateUploadUrl",
- "summary": "Generate upload URL",
- "description": "Used to upload anything from the client to S3 bucket",
+ "operationId": "sendMessageV2",
+ "summary": "Send a message",
+ "description": "To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.",
+ "tags": [
+ "Deprecated"
+ ],
"requestBody": {
"required": true,
"content": {
@@ -10648,165 +10608,27149 @@
"schema": {
"type": "object",
"properties": {
- "filePathProps": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "typebotId": {
- "type": "string"
- },
- "blockId": {
- "type": "string"
- },
- "resultId": {
- "type": "string"
- },
- "fileName": {
- "type": "string"
- }
- },
- "required": [
- "typebotId",
- "blockId",
- "resultId",
- "fileName"
- ],
- "additionalProperties": false
- },
+ "message": {
+ "type": "string",
+ "description": "The answer to the previous chat input. Do not provide it if you are starting a new chat."
+ },
+ "sessionId": {
+ "type": "string",
+ "description": "Session ID that you get from the initial chat request to a bot. If not provided, it will create a new session."
+ },
+ "startParams": {
+ "allOf": [
{
"type": "object",
"properties": {
- "sessionId": {
- "type": "string"
- },
- "fileName": {
- "type": "string"
- }
- },
- "required": [
- "sessionId",
- "fileName"
- ],
- "additionalProperties": false
- }
- ]
- },
- "fileType": {
- "type": "string"
- }
- },
- "required": [
- "filePathProps"
- ],
- "additionalProperties": false
- }
- }
- }
- },
- "parameters": [],
- "responses": {
- "200": {
- "description": "Successful response",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "presignedUrl": {
- "type": "string"
- },
- "formData": {
- "type": "object",
- "additionalProperties": {}
- },
- "fileUrl": {
- "type": "string"
- }
- },
- "required": [
- "presignedUrl",
- "formData",
- "fileUrl"
- ],
- "additionalProperties": false
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- }
- }
- },
- "/sessions/{sessionId}/updateTypebot": {
- "post": {
- "operationId": "updateTypebotInSession",
- "summary": "Update typebot in session",
- "description": "Update chat session with latest typebot modifications. This is useful when you want to update the typebot in an ongoing session after making changes to it.",
- "security": [
- {
- "Authorization": []
- }
- ],
- "parameters": [
- {
- "name": "sessionId",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "message": {
- "type": "string",
- "enum": [
- "success"
- ]
- }
- },
- "required": [
- "message"
- ],
- "additionalProperties": false
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- }
- }
- },
- "/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook": {
- "get": {
- "operationId": "whatsAppRouter-subscribeWebhook",
- "summary": "Subscribe webhook",
- "tags": [
- "WhatsApp"
- ],
- "security": [
- {
- "Authorization": []
- }
- ],
- "parameters": [
- {
- "name": "workspaceId",
- "in": "path",
- "required": true,
- "schema": {
+ "typebot": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "enum": [
+ "3",
+ "4",
+ "5"
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "blocks": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "start"
+ ]
+ },
+ "label": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "label"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Code"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "shouldExecuteInParentContext": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Condition"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "not": {}
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Redirect"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Set variable"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "not": {}
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Today",
+ "Now",
+ "Yesterday",
+ "Tomorrow",
+ "Moment of the day",
+ "Empty",
+ "Environment name",
+ "User ID",
+ "Random ID",
+ "Phone number",
+ "Contact name"
+ ]
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Map item with same index"
+ ]
+ },
+ "mapListItemParams": {
+ "type": "object",
+ "properties": {
+ "baseItemVariableId": {
+ "type": "string"
+ },
+ "baseListVariableId": {
+ "type": "string"
+ },
+ "targetListVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Append value(s)"
+ ]
+ },
+ "item": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Typebot link"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "typebotId": {
+ "type": "string"
+ },
+ "groupId": {
+ "type": "string"
+ },
+ "mergeResults": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Wait"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "string"
+ },
+ "shouldPause": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Jump"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "AB test"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "minItems": 2,
+ "maxItems": 2,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "a"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "b"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "aPercent": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Chatwoot"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Show widget",
+ "Close widget"
+ ]
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "websiteToken": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "avatarUrl": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Analytics"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Sheets"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Get data from sheet"
+ ]
+ },
+ "referenceCell": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cellsToExtract": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "totalRowsToExtract": {
+ "type": "string",
+ "enum": [
+ "All",
+ "First",
+ "Last",
+ "Random"
+ ]
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Insert a row"
+ ]
+ },
+ "cellsToInsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Update a row"
+ ]
+ },
+ "cellsToUpsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "referenceCell": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Make.com"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "OpenAI"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "not": {}
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create chat completion"
+ ]
+ },
+ "model": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ },
+ "content": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Messages sequence ✨"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "assistantMessagesVariableId": {
+ "type": "string"
+ },
+ "userMessagesVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Dialogue"
+ ]
+ },
+ "dialogueVariableId": {
+ "type": "string"
+ },
+ "startsBy": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "advancedSettings": {
+ "type": "object",
+ "properties": {
+ "temperature": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Message content",
+ "Total tokens"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create image"
+ ]
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "advancedOptions": {
+ "type": "object",
+ "properties": {
+ "size": {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Image URL"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "valueToExtract"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task",
+ "advancedOptions",
+ "responseMapping"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pabbly"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Email"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isBodyCode": {
+ "type": "boolean"
+ },
+ "recipients": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "subject": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ },
+ "replyTo": {
+ "type": "string"
+ },
+ "cc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "bcc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attachmentsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Webhook"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zapier"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pixel"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zemantic AI"
+ ]
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "projectId": {
+ "type": "string"
+ },
+ "systemPrompt": {
+ "type": "string"
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "maxResults": {
+ "type": "integer"
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Summary",
+ "Results"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "id",
+ "title",
+ "graphCoordinates",
+ "blocks"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "events": {
+ "enum": [
+ "null"
+ ],
+ "nullable": true
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "from": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "blockId": {
+ "type": "string"
+ },
+ "itemId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "to": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "groupId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "from",
+ "to"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "variables": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "settings": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "version",
+ "id",
+ "groups",
+ "edges",
+ "variables",
+ "settings",
+ "theme"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "enum": [
+ "6"
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "blocks": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Code"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "shouldExecuteInParentContext": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Condition"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "not": {}
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Redirect"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Set variable"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "not": {}
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Today",
+ "Now",
+ "Yesterday",
+ "Tomorrow",
+ "Moment of the day",
+ "Empty",
+ "Environment name",
+ "User ID",
+ "Random ID",
+ "Phone number",
+ "Contact name"
+ ]
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Map item with same index"
+ ]
+ },
+ "mapListItemParams": {
+ "type": "object",
+ "properties": {
+ "baseItemVariableId": {
+ "type": "string"
+ },
+ "baseListVariableId": {
+ "type": "string"
+ },
+ "targetListVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Append value(s)"
+ ]
+ },
+ "item": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Typebot link"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "typebotId": {
+ "type": "string"
+ },
+ "groupId": {
+ "type": "string"
+ },
+ "mergeResults": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Wait"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "string"
+ },
+ "shouldPause": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Jump"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "AB test"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "minItems": 2,
+ "maxItems": 2,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "a"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "b"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "aPercent": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Chatwoot"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Show widget",
+ "Close widget"
+ ]
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "websiteToken": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "avatarUrl": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Analytics"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Sheets"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Get data from sheet"
+ ]
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cellsToExtract": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "totalRowsToExtract": {
+ "type": "string",
+ "enum": [
+ "All",
+ "First",
+ "Last",
+ "Random"
+ ]
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Insert a row"
+ ]
+ },
+ "cellsToInsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Update a row"
+ ]
+ },
+ "cellsToUpsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Make.com"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "OpenAI"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "not": {}
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create chat completion"
+ ]
+ },
+ "model": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ },
+ "content": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Messages sequence ✨"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "assistantMessagesVariableId": {
+ "type": "string"
+ },
+ "userMessagesVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Dialogue"
+ ]
+ },
+ "dialogueVariableId": {
+ "type": "string"
+ },
+ "startsBy": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "advancedSettings": {
+ "type": "object",
+ "properties": {
+ "temperature": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Message content",
+ "Total tokens"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create image"
+ ]
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "advancedOptions": {
+ "type": "object",
+ "properties": {
+ "size": {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Image URL"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "valueToExtract"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task",
+ "advancedOptions",
+ "responseMapping"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pabbly"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Email"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isBodyCode": {
+ "type": "boolean"
+ },
+ "recipients": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "subject": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ },
+ "replyTo": {
+ "type": "string"
+ },
+ "cc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "bcc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attachmentsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Webhook"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zapier"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pixel"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zemantic AI"
+ ]
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "projectId": {
+ "type": "string"
+ },
+ "systemPrompt": {
+ "type": "string"
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "maxResults": {
+ "type": "integer"
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Summary",
+ "Results"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "id",
+ "title",
+ "graphCoordinates",
+ "blocks"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "events": {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "start"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "graphCoordinates",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "from": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "blockId": {
+ "type": "string"
+ },
+ "itemId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "to": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "groupId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "from",
+ "to"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "variables": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "settings": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "version",
+ "id",
+ "groups",
+ "events",
+ "edges",
+ "variables",
+ "settings",
+ "theme"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "Either a Typebot ID or a Typebot object. If you provide a Typebot object, it will be executed in preview mode. ([How can I find my typebot ID?](https://docs.typebot.io/api#how-to-find-my-typebotid))."
+ },
+ "isPreview": {
+ "type": "boolean",
+ "description": "If set to `true`, it will start a Preview session with the unpublished bot and it won't be saved in the Results tab. You need to be authenticated with a bearer token for this to work."
+ },
+ "resultId": {
+ "type": "string",
+ "description": "Provide it if you'd like to overwrite an existing result."
+ },
+ "prefilledVariables": {
+ "type": "object",
+ "additionalProperties": {},
+ "description": "[More info about prefilled variables.](https://docs.typebot.io/editor/variables#prefilled-variables)"
+ },
+ "isStreamEnabled": {
+ "type": "boolean",
+ "description": "Set this to `true` if you intend to stream OpenAI completions on a client."
+ },
+ "isOnlyRegistering": {
+ "type": "boolean",
+ "description": "If set to `true`, it will only register the session and not start the chat. This is used for other chat platform integration as it can require a session to be registered before sending the first message."
+ }
+ },
+ "required": [
+ "typebot"
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "startGroupId": {
+ "type": "string",
+ "description": "Start chat from a specific group."
+ },
+ "startEventId": {
+ "not": {}
+ }
+ },
+ "required": [
+ "startGroupId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "startEventId": {
+ "type": "string",
+ "description": "Start chat from a specific event."
+ },
+ "startGroupId": {
+ "not": {}
+ }
+ },
+ "required": [
+ "startEventId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {},
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ },
+ "clientLogs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ },
+ "description": "Logs while executing client side actions"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "input": {
+ "allOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "prefilledValue": {
+ "type": "string"
+ },
+ "runtimeOptions": {
+ "type": "object",
+ "properties": {
+ "paymentIntentSecret": {
+ "type": "string"
+ },
+ "amountLabel": {
+ "type": "string"
+ },
+ "publicKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "paymentIntentSecret",
+ "amountLabel",
+ "publicKey"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ ]
+ },
+ "clientSideActions": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "lastBubbleBlockId": {
+ "type": "string"
+ },
+ "expectsDedicatedReply": {
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "redirect": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "redirect"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "chatwoot": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "chatwoot"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "googleAnalytics": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "googleAnalytics"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "wait": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "secondsToWaitFor"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "wait"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "setVariable": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "setVariable"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "streamOpenAiChatCompletion": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "streamOpenAiChatCompletion"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "webhookToExecute": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "body": {},
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "webhookToExecute"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "startPropsToInject": {
+ "type": "object",
+ "properties": {
+ "googleAnalyticsId": {
+ "type": "string"
+ },
+ "pixelIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "gtmId": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "startPropsToInject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixel": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "pixel"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "sessionId": {
+ "type": "string"
+ },
+ "typebot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "theme": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "settings": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "theme",
+ "settings"
+ ],
+ "additionalProperties": false
+ },
+ "resultId": {
+ "type": "string"
+ },
+ "dynamicTheme": {
+ "type": "object",
+ "properties": {
+ "hostAvatarUrl": {
+ "type": "string"
+ },
+ "guestAvatarUrl": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "logs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "lastMessageNewFormat": {
+ "type": "string",
+ "description": "The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version."
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "deprecated": true
+ }
+ },
+ "/v1/typebots/{publicId}/startChat": {
+ "post": {
+ "operationId": "startChat",
+ "summary": "Start chat",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "isStreamEnabled": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "resultId": {
+ "type": "string",
+ "description": "Provide it if you'd like to overwrite an existing result."
+ },
+ "isOnlyRegistering": {
+ "type": "boolean",
+ "description": "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": {
+ "type": "object",
+ "additionalProperties": {},
+ "description": "[More info about prefilled variables.](https://docs.typebot.io/editor/variables#prefilled-variables)"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "publicId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "lastMessageNewFormat": {
+ "type": "string",
+ "description": "The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version."
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "input": {
+ "allOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "prefilledValue": {
+ "type": "string"
+ },
+ "runtimeOptions": {
+ "type": "object",
+ "properties": {
+ "paymentIntentSecret": {
+ "type": "string"
+ },
+ "amountLabel": {
+ "type": "string"
+ },
+ "publicKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "paymentIntentSecret",
+ "amountLabel",
+ "publicKey"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ ]
+ },
+ "clientSideActions": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "lastBubbleBlockId": {
+ "type": "string"
+ },
+ "expectsDedicatedReply": {
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "redirect": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "redirect"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "chatwoot": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "chatwoot"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "googleAnalytics": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "googleAnalytics"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "wait": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "secondsToWaitFor"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "wait"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "setVariable": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "setVariable"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "streamOpenAiChatCompletion": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "streamOpenAiChatCompletion"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "webhookToExecute": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "body": {},
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "webhookToExecute"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "startPropsToInject": {
+ "type": "object",
+ "properties": {
+ "googleAnalyticsId": {
+ "type": "string"
+ },
+ "pixelIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "gtmId": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "startPropsToInject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixel": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "pixel"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "logs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "dynamicTheme": {
+ "type": "object",
+ "properties": {
+ "hostAvatarUrl": {
+ "type": "string"
+ },
+ "guestAvatarUrl": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sessionId": {
+ "type": "string"
+ },
+ "typebot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "theme": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "settings": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "theme",
+ "settings"
+ ],
+ "additionalProperties": false
+ },
+ "resultId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages",
+ "typebot"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
+ },
+ "/v1/sessions/{sessionId}/continueChat": {
+ "post": {
+ "operationId": "continueChat",
+ "summary": "Continue chat",
+ "description": "To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "sessionId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "lastMessageNewFormat": {
+ "type": "string",
+ "description": "The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version."
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "input": {
+ "allOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "prefilledValue": {
+ "type": "string"
+ },
+ "runtimeOptions": {
+ "type": "object",
+ "properties": {
+ "paymentIntentSecret": {
+ "type": "string"
+ },
+ "amountLabel": {
+ "type": "string"
+ },
+ "publicKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "paymentIntentSecret",
+ "amountLabel",
+ "publicKey"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ ]
+ },
+ "clientSideActions": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "lastBubbleBlockId": {
+ "type": "string"
+ },
+ "expectsDedicatedReply": {
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "redirect": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "redirect"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "chatwoot": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "chatwoot"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "googleAnalytics": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "googleAnalytics"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "wait": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "secondsToWaitFor"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "wait"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "setVariable": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "setVariable"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "streamOpenAiChatCompletion": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "streamOpenAiChatCompletion"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "webhookToExecute": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "body": {},
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "webhookToExecute"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "startPropsToInject": {
+ "type": "object",
+ "properties": {
+ "googleAnalyticsId": {
+ "type": "string"
+ },
+ "pixelIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "gtmId": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "startPropsToInject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixel": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "pixel"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "logs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "dynamicTheme": {
+ "type": "object",
+ "properties": {
+ "hostAvatarUrl": {
+ "type": "string"
+ },
+ "guestAvatarUrl": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
+ },
+ "/v1/typebots/{typebotId}/preview/startChat": {
+ "post": {
+ "operationId": "startChatPreview",
+ "summary": "Start preview chat",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "isStreamEnabled": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "isOnlyRegistering": {
+ "type": "boolean",
+ "description": "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."
+ },
+ "typebot": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "enum": [
+ "3",
+ "4",
+ "5"
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "blocks": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "start"
+ ]
+ },
+ "label": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "label"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Code"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "shouldExecuteInParentContext": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Condition"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "not": {}
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Redirect"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Set variable"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "not": {}
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Today",
+ "Now",
+ "Yesterday",
+ "Tomorrow",
+ "Moment of the day",
+ "Empty",
+ "Environment name",
+ "User ID",
+ "Random ID",
+ "Phone number",
+ "Contact name"
+ ]
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Map item with same index"
+ ]
+ },
+ "mapListItemParams": {
+ "type": "object",
+ "properties": {
+ "baseItemVariableId": {
+ "type": "string"
+ },
+ "baseListVariableId": {
+ "type": "string"
+ },
+ "targetListVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Append value(s)"
+ ]
+ },
+ "item": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Typebot link"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "typebotId": {
+ "type": "string"
+ },
+ "groupId": {
+ "type": "string"
+ },
+ "mergeResults": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Wait"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "string"
+ },
+ "shouldPause": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Jump"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "AB test"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "minItems": 2,
+ "maxItems": 2,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "a"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "b"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "aPercent": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Chatwoot"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Show widget",
+ "Close widget"
+ ]
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "websiteToken": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "avatarUrl": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Analytics"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Sheets"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Get data from sheet"
+ ]
+ },
+ "referenceCell": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cellsToExtract": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "totalRowsToExtract": {
+ "type": "string",
+ "enum": [
+ "All",
+ "First",
+ "Last",
+ "Random"
+ ]
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Insert a row"
+ ]
+ },
+ "cellsToInsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Update a row"
+ ]
+ },
+ "cellsToUpsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "referenceCell": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Make.com"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "OpenAI"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "not": {}
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create chat completion"
+ ]
+ },
+ "model": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ },
+ "content": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Messages sequence ✨"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "assistantMessagesVariableId": {
+ "type": "string"
+ },
+ "userMessagesVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Dialogue"
+ ]
+ },
+ "dialogueVariableId": {
+ "type": "string"
+ },
+ "startsBy": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "advancedSettings": {
+ "type": "object",
+ "properties": {
+ "temperature": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Message content",
+ "Total tokens"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create image"
+ ]
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "advancedOptions": {
+ "type": "object",
+ "properties": {
+ "size": {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Image URL"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "valueToExtract"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task",
+ "advancedOptions",
+ "responseMapping"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pabbly"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Email"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isBodyCode": {
+ "type": "boolean"
+ },
+ "recipients": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "subject": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ },
+ "replyTo": {
+ "type": "string"
+ },
+ "cc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "bcc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attachmentsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Webhook"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zapier"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "webhookId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pixel"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zemantic AI"
+ ]
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "projectId": {
+ "type": "string"
+ },
+ "systemPrompt": {
+ "type": "string"
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "maxResults": {
+ "type": "integer"
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Summary",
+ "Results"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "id",
+ "title",
+ "graphCoordinates",
+ "blocks"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "events": {
+ "enum": [
+ "null"
+ ],
+ "nullable": true
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "from": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "blockId": {
+ "type": "string"
+ },
+ "itemId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "to": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "groupId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "from",
+ "to"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "variables": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "settings": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "version",
+ "id",
+ "groups",
+ "edges",
+ "variables",
+ "settings",
+ "theme"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "enum": [
+ "6"
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "blocks": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Code"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "shouldExecuteInParentContext": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Condition"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "not": {}
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Redirect"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Set variable"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "not": {}
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Today",
+ "Now",
+ "Yesterday",
+ "Tomorrow",
+ "Moment of the day",
+ "Empty",
+ "Environment name",
+ "User ID",
+ "Random ID",
+ "Phone number",
+ "Contact name"
+ ]
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "expressionToEvaluate": {
+ "type": "string"
+ },
+ "isCode": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Map item with same index"
+ ]
+ },
+ "mapListItemParams": {
+ "type": "object",
+ "properties": {
+ "baseItemVariableId": {
+ "type": "string"
+ },
+ "baseListVariableId": {
+ "type": "string"
+ },
+ "targetListVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Append value(s)"
+ ]
+ },
+ "item": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Typebot link"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "typebotId": {
+ "type": "string"
+ },
+ "groupId": {
+ "type": "string"
+ },
+ "mergeResults": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Wait"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "string"
+ },
+ "shouldPause": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Jump"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "AB test"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "minItems": 2,
+ "maxItems": 2,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "a"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string",
+ "enum": [
+ "b"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "path"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "aPercent": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Chatwoot"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Show widget",
+ "Close widget"
+ ]
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "websiteToken": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "avatarUrl": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Analytics"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Google Sheets"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Get data from sheet"
+ ]
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cellsToExtract": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "totalRowsToExtract": {
+ "type": "string",
+ "enum": [
+ "All",
+ "First",
+ "Last",
+ "Random"
+ ]
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Insert a row"
+ ]
+ },
+ "cellsToInsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string",
+ "enum": [
+ "Update a row"
+ ]
+ },
+ "cellsToUpsert": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "column": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "filter": {
+ "type": "object",
+ "properties": {
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "column": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "sheetId": {
+ "type": "string"
+ },
+ "spreadsheetId": {
+ "type": "string"
+ },
+ "action": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Make.com"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "OpenAI"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "not": {}
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create chat completion"
+ ]
+ },
+ "model": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ },
+ "content": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Messages sequence ✨"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "assistantMessagesVariableId": {
+ "type": "string"
+ },
+ "userMessagesVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "Dialogue"
+ ]
+ },
+ "dialogueVariableId": {
+ "type": "string"
+ },
+ "startsBy": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "role"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "advancedSettings": {
+ "type": "object",
+ "properties": {
+ "temperature": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Message content",
+ "Total tokens"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "enum": [
+ "Create image"
+ ]
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "advancedOptions": {
+ "type": "object",
+ "properties": {
+ "size": {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Image URL"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "valueToExtract"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "apiVersion": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "task",
+ "advancedOptions",
+ "responseMapping"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pabbly"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Email"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isBodyCode": {
+ "type": "boolean"
+ },
+ "recipients": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "subject": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ },
+ "replyTo": {
+ "type": "string"
+ },
+ "cc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "bcc": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attachmentsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Webhook"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zapier"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variablesForTest": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "responseVariableMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "bodyPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "isAdvancedConfig": {
+ "type": "boolean"
+ },
+ "isCustomBody": {
+ "type": "boolean"
+ },
+ "isExecutedOnClient": {
+ "type": "boolean"
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "queryParams": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ },
+ "url": {
+ "type": "string"
+ },
+ "body": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Pixel"
+ ]
+ },
+ "options": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "Zemantic AI"
+ ]
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "credentialsId": {
+ "type": "string"
+ },
+ "projectId": {
+ "type": "string"
+ },
+ "systemPrompt": {
+ "type": "string"
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "maxResults": {
+ "type": "integer"
+ },
+ "responseMapping": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "valueToExtract": {
+ "type": "string",
+ "enum": [
+ "Summary",
+ "Results"
+ ]
+ },
+ "variableId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "id",
+ "title",
+ "graphCoordinates",
+ "blocks"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "events": {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "graphCoordinates": {
+ "type": "object",
+ "properties": {
+ "x": {
+ "type": "number"
+ },
+ "y": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y"
+ ],
+ "additionalProperties": false
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "start"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "graphCoordinates",
+ "type"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "from": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "blockId": {
+ "type": "string"
+ },
+ "itemId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "to": {
+ "type": "object",
+ "properties": {
+ "groupId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "groupId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "from",
+ "to"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "variables": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "settings": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "version",
+ "id",
+ "groups",
+ "events",
+ "edges",
+ "variables",
+ "settings",
+ "theme"
+ ],
+ "additionalProperties": false
+ }
+ ],
+ "description": "If set, it will override the typebot that is used to start the chat."
+ },
+ "startFrom": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "group"
+ ]
+ },
+ "groupId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "groupId"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "event"
+ ]
+ },
+ "eventId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "eventId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "typebotId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "lastMessageNewFormat": {
+ "type": "string",
+ "description": "The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version."
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ },
+ "richText": {
+ "type": "array"
+ },
+ "plainText": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "image"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "clickLink": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "alt": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "video"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "youtube",
+ "vimeo",
+ "tiktok",
+ "gumlet"
+ ]
+ },
+ "height": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "aspectRatio": {
+ "type": "string"
+ },
+ "maxWidth": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "audio"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isAutoplayEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "embed"
+ ]
+ },
+ "content": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "height": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "input": {
+ "allOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizeLimit": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "text input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "isLong": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "dynamicVariableId": {
+ "type": "string"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "email input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "min": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "max": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "step": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "phone number input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "retryMessageContent": {
+ "type": "string"
+ },
+ "defaultCountryCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "date input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hasTime": {
+ "type": "boolean"
+ },
+ "isRange": {
+ "type": "boolean"
+ },
+ "format": {
+ "type": "string"
+ },
+ "min": {
+ "type": "string"
+ },
+ "max": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "payment input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string",
+ "enum": [
+ "Stripe"
+ ]
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "button": {
+ "type": "string"
+ },
+ "success": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "additionalInformation": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "phoneNumber": {
+ "type": "string"
+ },
+ "address": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string"
+ },
+ "line1": {
+ "type": "string"
+ },
+ "line2": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string"
+ },
+ "city": {
+ "type": "string"
+ },
+ "postalCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "credentialsId": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "retryMessageContent": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "rating input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "buttonType": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Icons"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Numbers"
+ ]
+ }
+ ]
+ },
+ "length": {
+ "type": "number"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "left": {
+ "type": "string"
+ },
+ "right": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "customIcon": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "svg": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "isOneClickSubmitEnabled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file input"
+ ]
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isRequired": {
+ "type": "boolean"
+ },
+ "isMultipleAllowed": {
+ "type": "boolean"
+ },
+ "labels": {
+ "type": "object",
+ "properties": {
+ "placeholder": {
+ "type": "string"
+ },
+ "button": {
+ "type": "string"
+ },
+ "clear": {
+ "type": "string"
+ },
+ "skip": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "picture choice input"
+ ]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "outgoingEdgeId": {
+ "type": "string"
+ },
+ "pictureSrc": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "displayCondition": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "condition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "variableId": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "variableId": {
+ "type": "string"
+ },
+ "isMultipleChoice": {
+ "type": "boolean"
+ },
+ "isSearchable": {
+ "type": "boolean"
+ },
+ "buttonLabel": {
+ "type": "string"
+ },
+ "searchInputPlaceholder": {
+ "type": "string"
+ },
+ "dynamicItems": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "titlesVariableId": {
+ "type": "string"
+ },
+ "descriptionsVariableId": {
+ "type": "string"
+ },
+ "pictureSrcsVariableId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "type",
+ "items"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "prefilledValue": {
+ "type": "string"
+ },
+ "runtimeOptions": {
+ "type": "object",
+ "properties": {
+ "paymentIntentSecret": {
+ "type": "string"
+ },
+ "amountLabel": {
+ "type": "string"
+ },
+ "publicKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "paymentIntentSecret",
+ "amountLabel",
+ "publicKey"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ ]
+ },
+ "clientSideActions": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "lastBubbleBlockId": {
+ "type": "string"
+ },
+ "expectsDedicatedReply": {
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "redirect": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "isNewTab": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "redirect"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "chatwoot": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "chatwoot"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "googleAnalytics": {
+ "type": "object",
+ "properties": {
+ "trackingId": {
+ "type": "string"
+ },
+ "category": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {}
+ ]
+ },
+ "sendTo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "googleAnalytics"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "wait": {
+ "type": "object",
+ "properties": {
+ "secondsToWaitFor": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "secondsToWaitFor"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "wait"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "setVariable": {
+ "type": "object",
+ "properties": {
+ "scriptToExecute": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "value": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ ],
+ "nullable": true
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "content",
+ "args"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "scriptToExecute"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "setVariable"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "streamOpenAiChatCompletion": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "system",
+ "user",
+ "assistant"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "messages"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "streamOpenAiChatCompletion"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "webhookToExecute": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "body": {},
+ "method": {
+ "type": "string",
+ "enum": [
+ "POST",
+ "GET",
+ "PUT",
+ "DELETE",
+ "PATCH",
+ "HEAD",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE"
+ ]
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "webhookToExecute"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "startPropsToInject": {
+ "type": "object",
+ "properties": {
+ "googleAnalyticsId": {
+ "type": "string"
+ },
+ "pixelIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "gtmId": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "startPropsToInject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixel": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "not": {}
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Lead",
+ "Contact",
+ "CompleteRegistration",
+ "Schedule",
+ "SubmitApplication",
+ "ViewContent",
+ "AddPaymentInfo",
+ "AddToCart",
+ "AddToWishlist",
+ "CustomizeProduct",
+ "Donate",
+ "FindLocation",
+ "InitiateCheckout",
+ "Purchase",
+ "Search",
+ "StartTrial",
+ "Subscribe"
+ ]
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "pixelId": {
+ "type": "string"
+ },
+ "isInitSkip": {
+ "type": "boolean"
+ },
+ "params": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "value": {}
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "eventType": {
+ "type": "string",
+ "enum": [
+ "Custom"
+ ]
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "pixel"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "logs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "dynamicTheme": {
+ "type": "object",
+ "properties": {
+ "hostAvatarUrl": {
+ "type": "string"
+ },
+ "guestAvatarUrl": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "sessionId": {
+ "type": "string"
+ },
+ "typebot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "theme": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "font": {
+ "type": "string"
+ },
+ "background": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Color",
+ "Image",
+ "None"
+ ]
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "chat": {
+ "type": "object",
+ "properties": {
+ "hostAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestAvatar": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "hostBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestBubbles": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "buttons": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "inputs": {
+ "type": "object",
+ "properties": {
+ "backgroundColor": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "placeholderColor": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "roundness": {
+ "type": "string",
+ "enum": [
+ "none",
+ "medium",
+ "large"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "customCss": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "settings": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "isBrandingEnabled": {
+ "type": "boolean"
+ },
+ "isTypingEmulationEnabled": {
+ "type": "boolean"
+ },
+ "isInputPrefillEnabled": {
+ "type": "boolean"
+ },
+ "isHideQueryParamsEnabled": {
+ "type": "boolean"
+ },
+ "isNewResultOnRefreshEnabled": {
+ "type": "boolean"
+ },
+ "rememberUser": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "storage": {
+ "type": "string",
+ "enum": [
+ "session",
+ "local"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "typingEmulation": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "speed": {
+ "type": "number"
+ },
+ "maxDelay": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "imageUrl": {
+ "type": "string"
+ },
+ "favIconUrl": {
+ "type": "string"
+ },
+ "customHeadCode": {
+ "type": "string"
+ },
+ "googleTagManagerId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "whatsApp": {
+ "type": "object",
+ "properties": {
+ "isEnabled": {
+ "type": "boolean"
+ },
+ "startCondition": {
+ "type": "object",
+ "properties": {
+ "logicalOperator": {
+ "type": "string",
+ "enum": [
+ "OR",
+ "AND"
+ ]
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "comparisonOperator": {
+ "type": "string",
+ "enum": [
+ "Equal to",
+ "Not equal",
+ "Contains",
+ "Does not contain",
+ "Greater than",
+ "Less than",
+ "Is set",
+ "Is empty",
+ "Starts with",
+ "Ends with",
+ "Matches regex",
+ "Does not match regex"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "logicalOperator",
+ "comparisons"
+ ],
+ "additionalProperties": false
+ },
+ "sessionExpiryTimeout": {
+ "type": "number",
+ "maximum": 48,
+ "minimum": 0.01,
+ "description": "Expiration delay in hours after latest interaction"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "theme",
+ "settings"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "messages",
+ "typebot"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
+ },
+ "/v1/typebots/{typebotId}/blocks/{blockId}/storage/upload-url": {
+ "get": {
+ "operationId": "getUploadUrl",
+ "summary": "Get upload URL for a file",
+ "description": "Used for the web client to get the bucket upload file.",
+ "tags": [
+ "Deprecated"
+ ],
+ "parameters": [
+ {
+ "name": "typebotId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "blockId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "filePath",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "fileType",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "presignedUrl": {
+ "type": "string"
+ },
+ "hasReachedStorageLimit": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "presignedUrl",
+ "hasReachedStorageLimit"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "deprecated": true
+ }
+ },
+ "/v1/generate-upload-url": {
+ "post": {
+ "operationId": "generateUploadUrl",
+ "summary": "Generate upload URL",
+ "description": "Used to upload anything from the client to S3 bucket",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "filePathProps": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "typebotId": {
+ "type": "string"
+ },
+ "blockId": {
+ "type": "string"
+ },
+ "resultId": {
+ "type": "string"
+ },
+ "fileName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "typebotId",
+ "blockId",
+ "resultId",
+ "fileName"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "sessionId": {
+ "type": "string"
+ },
+ "fileName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "sessionId",
+ "fileName"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "fileType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "filePathProps"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "presignedUrl": {
+ "type": "string"
+ },
+ "formData": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "fileUrl": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "presignedUrl",
+ "formData",
+ "fileUrl"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
+ },
+ "/v1/sessions/{sessionId}/updateTypebot": {
+ "post": {
+ "operationId": "updateTypebotInSession",
+ "summary": "Update typebot in session",
+ "description": "Update chat session with latest typebot modifications. This is useful when you want to update the typebot in an ongoing session after making changes to it.",
+ "security": [
+ {
+ "Authorization": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "sessionId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string",
+ "enum": [
+ "success"
+ ]
+ }
+ },
+ "required": [
+ "message"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
+ },
+ "/v1/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook": {
+ "get": {
+ "operationId": "whatsAppRouter-subscribeWebhook",
+ "summary": "Subscribe webhook",
+ "tags": [
+ "WhatsApp"
+ ],
+ "security": [
+ {
+ "Authorization": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "workspaceId",
+ "in": "path",
+ "required": true,
+ "schema": {
"type": "string"
}
},
@@ -11261,6 +38205,82 @@
}
}
}
+ },
+ "/v1/sessions/{sessionId}/clientLogs": {
+ "post": {
+ "operationId": "saveClientLogs",
+ "summary": "Save client logs",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "clientLogs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "details": {}
+ },
+ "required": [
+ "status",
+ "description"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "clientLogs"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "sessionId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ }
+ }
}
},
"components": {
diff --git a/apps/viewer/src/features/chat/api/continueChat.ts b/apps/viewer/src/features/chat/api/continueChat.ts
new file mode 100644
index 00000000000..35a0bb7688c
--- /dev/null
+++ b/apps/viewer/src/features/chat/api/continueChat.ts
@@ -0,0 +1,79 @@
+import { publicProcedure } from '@/helpers/server/trpc'
+import { continueChatResponseSchema } from '@typebot.io/schemas/features/chat/schema'
+import { TRPCError } from '@trpc/server'
+import { getSession } from '@typebot.io/bot-engine/queries/getSession'
+import { saveStateToDatabase } from '@typebot.io/bot-engine/saveStateToDatabase'
+import { continueBotFlow } from '@typebot.io/bot-engine/continueBotFlow'
+import { parseDynamicTheme } from '@typebot.io/bot-engine/parseDynamicTheme'
+import { isDefined } from '@typebot.io/lib/utils'
+import { z } from 'zod'
+
+export const continueChat = publicProcedure
+ .meta({
+ openapi: {
+ method: 'POST',
+ path: '/v1/sessions/{sessionId}/continueChat',
+ summary: 'Continue chat',
+ description:
+ 'To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.',
+ },
+ })
+ .input(
+ z.object({
+ message: z.string().optional(),
+ sessionId: z.string(),
+ })
+ )
+ .output(continueChatResponseSchema)
+ .mutation(async ({ input: { sessionId, message } }) => {
+ const session = await getSession(sessionId)
+
+ if (!session) {
+ throw new TRPCError({
+ code: 'NOT_FOUND',
+ message: 'Session not found.',
+ })
+ }
+
+ const isSessionExpired =
+ session &&
+ isDefined(session.state.expiryTimeout) &&
+ session.updatedAt.getTime() + session.state.expiryTimeout < Date.now()
+
+ if (isSessionExpired)
+ throw new TRPCError({
+ code: 'NOT_FOUND',
+ message: 'Session expired. You need to start a new session.',
+ })
+
+ const {
+ messages,
+ input,
+ clientSideActions,
+ newSessionState,
+ logs,
+ lastMessageNewFormat,
+ visitedEdges,
+ } = await continueBotFlow(message, { version: 2, state: session.state })
+
+ if (newSessionState)
+ await saveStateToDatabase({
+ session: {
+ id: session.id,
+ state: newSessionState,
+ },
+ input,
+ logs,
+ clientSideActions,
+ visitedEdges,
+ })
+
+ return {
+ messages,
+ input,
+ clientSideActions,
+ dynamicTheme: parseDynamicTheme(newSessionState),
+ logs,
+ lastMessageNewFormat,
+ }
+ })
diff --git a/apps/viewer/src/features/chat/api/sendMessageV1.ts b/apps/viewer/src/features/chat/api/legacy/sendMessageV1.ts
similarity index 65%
rename from apps/viewer/src/features/chat/api/sendMessageV1.ts
rename to apps/viewer/src/features/chat/api/legacy/sendMessageV1.ts
index 79cc8d8f1da..5da5b169a7a 100644
--- a/apps/viewer/src/features/chat/api/sendMessageV1.ts
+++ b/apps/viewer/src/features/chat/api/legacy/sendMessageV1.ts
@@ -1,8 +1,8 @@
import { publicProcedure } from '@/helpers/server/trpc'
import {
- chatReplySchema,
sendMessageInputSchema,
-} from '@typebot.io/schemas/features/chat/schema'
+ chatReplySchema,
+} from '@typebot.io/schemas/features/chat/legacy/schema'
import { TRPCError } from '@trpc/server'
import { getSession } from '@typebot.io/bot-engine/queries/getSession'
import { startSession } from '@typebot.io/bot-engine/startSession'
@@ -16,10 +16,12 @@ export const sendMessageV1 = publicProcedure
.meta({
openapi: {
method: 'POST',
- path: '/sendMessage',
+ path: '/v1/sendMessage',
summary: 'Send a message',
description:
'To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.',
+ tags: ['Deprecated'],
+ deprecated: true,
},
})
.input(sendMessageInputSchema)
@@ -60,8 +62,45 @@ export const sendMessageV1 = publicProcedure
visitedEdges,
} = await startSession({
version: 1,
- startParams,
- userId: user?.id,
+ startParams:
+ startParams.isPreview || typeof startParams.typebot !== 'string'
+ ? {
+ type: 'preview',
+ isOnlyRegistering: startParams.isOnlyRegistering ?? false,
+ isStreamEnabled: startParams.isStreamEnabled,
+ startFrom:
+ 'startGroupId' in startParams && startParams.startGroupId
+ ? {
+ type: 'group',
+ groupId: startParams.startGroupId,
+ }
+ : 'startEventId' in startParams &&
+ startParams.startEventId
+ ? {
+ type: 'event',
+ eventId: startParams.startEventId,
+ }
+ : undefined,
+ typebotId:
+ typeof startParams.typebot === 'string'
+ ? startParams.typebot
+ : startParams.typebot.id,
+ typebot:
+ typeof startParams.typebot === 'string'
+ ? undefined
+ : startParams.typebot,
+ message,
+ userId: parseUserId(user?.id),
+ }
+ : {
+ type: 'live',
+ isOnlyRegistering: startParams.isOnlyRegistering ?? false,
+ isStreamEnabled: startParams.isStreamEnabled,
+ publicId: startParams.typebot,
+ prefilledVariables: startParams.prefilledVariables,
+ resultId: startParams.resultId,
+ message,
+ },
message,
})
@@ -133,3 +172,13 @@ export const sendMessageV1 = publicProcedure
}
}
)
+
+const parseUserId = (userId?: string): string => {
+ if (!userId)
+ throw new TRPCError({
+ code: 'UNAUTHORIZED',
+ message: 'You need to be authenticated to perform this action',
+ })
+
+ return userId
+}
diff --git a/apps/viewer/src/features/chat/api/sendMessageV2.ts b/apps/viewer/src/features/chat/api/legacy/sendMessageV2.ts
similarity index 65%
rename from apps/viewer/src/features/chat/api/sendMessageV2.ts
rename to apps/viewer/src/features/chat/api/legacy/sendMessageV2.ts
index 43d2f88c3e6..6d18c69b042 100644
--- a/apps/viewer/src/features/chat/api/sendMessageV2.ts
+++ b/apps/viewer/src/features/chat/api/legacy/sendMessageV2.ts
@@ -1,8 +1,4 @@
import { publicProcedure } from '@/helpers/server/trpc'
-import {
- chatReplySchema,
- sendMessageInputSchema,
-} from '@typebot.io/schemas/features/chat/schema'
import { TRPCError } from '@trpc/server'
import { getSession } from '@typebot.io/bot-engine/queries/getSession'
import { startSession } from '@typebot.io/bot-engine/startSession'
@@ -11,15 +7,21 @@ import { restartSession } from '@typebot.io/bot-engine/queries/restartSession'
import { continueBotFlow } from '@typebot.io/bot-engine/continueBotFlow'
import { parseDynamicTheme } from '@typebot.io/bot-engine/parseDynamicTheme'
import { isDefined } from '@typebot.io/lib/utils'
+import {
+ chatReplySchema,
+ sendMessageInputSchema,
+} from '@typebot.io/schemas/features/chat/legacy/schema'
export const sendMessageV2 = publicProcedure
.meta({
openapi: {
method: 'POST',
- path: '/sendMessage',
+ path: '/v2/sendMessage',
summary: 'Send a message',
description:
'To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.',
+ tags: ['Deprecated'],
+ deprecated: true,
},
})
.input(sendMessageInputSchema)
@@ -60,8 +62,45 @@ export const sendMessageV2 = publicProcedure
visitedEdges,
} = await startSession({
version: 2,
- startParams,
- userId: user?.id,
+ startParams:
+ startParams.isPreview || typeof startParams.typebot !== 'string'
+ ? {
+ type: 'preview',
+ isOnlyRegistering: startParams.isOnlyRegistering ?? false,
+ isStreamEnabled: startParams.isStreamEnabled,
+ startFrom:
+ 'startGroupId' in startParams && startParams.startGroupId
+ ? {
+ type: 'group',
+ groupId: startParams.startGroupId,
+ }
+ : 'startEventId' in startParams &&
+ startParams.startEventId
+ ? {
+ type: 'event',
+ eventId: startParams.startEventId,
+ }
+ : undefined,
+ typebotId:
+ typeof startParams.typebot === 'string'
+ ? startParams.typebot
+ : startParams.typebot.id,
+ typebot:
+ typeof startParams.typebot === 'string'
+ ? undefined
+ : startParams.typebot,
+ message,
+ userId: parseUserId(user?.id),
+ }
+ : {
+ type: 'live',
+ isOnlyRegistering: startParams.isOnlyRegistering ?? false,
+ isStreamEnabled: startParams.isStreamEnabled,
+ publicId: startParams.typebot,
+ prefilledVariables: startParams.prefilledVariables,
+ resultId: startParams.resultId,
+ message,
+ },
message,
})
@@ -133,3 +172,13 @@ export const sendMessageV2 = publicProcedure
}
}
)
+
+const parseUserId = (userId?: string): string => {
+ if (!userId)
+ throw new TRPCError({
+ code: 'UNAUTHORIZED',
+ message: 'You need to be authenticated to perform this action',
+ })
+
+ return userId
+}
diff --git a/apps/viewer/src/features/chat/api/saveClientLogs.ts b/apps/viewer/src/features/chat/api/saveClientLogs.ts
new file mode 100644
index 00000000000..d5132dcc402
--- /dev/null
+++ b/apps/viewer/src/features/chat/api/saveClientLogs.ts
@@ -0,0 +1,63 @@
+import { publicProcedure } from '@/helpers/server/trpc'
+import { chatLogSchema } from '@typebot.io/schemas/features/chat/schema'
+import { TRPCError } from '@trpc/server'
+import { getSession } from '@typebot.io/bot-engine/queries/getSession'
+import { z } from 'zod'
+import { saveLogs } from '@typebot.io/bot-engine/queries/saveLogs'
+import { formatLogDetails } from '@typebot.io/bot-engine/logs/helpers/formatLogDetails'
+import * as Sentry from '@sentry/nextjs'
+
+export const saveClientLogs = publicProcedure
+ .meta({
+ openapi: {
+ method: 'POST',
+ path: '/v1/sessions/{sessionId}/clientLogs',
+ summary: 'Save client logs',
+ },
+ })
+ .input(
+ z.object({
+ sessionId: z.string(),
+ clientLogs: z.array(chatLogSchema),
+ })
+ )
+ .output(z.object({ message: z.string() }))
+ .mutation(async ({ input: { sessionId, clientLogs } }) => {
+ const session = await getSession(sessionId)
+
+ if (!session) {
+ throw new TRPCError({
+ code: 'NOT_FOUND',
+ message: 'Session not found.',
+ })
+ }
+
+ const resultId = session.state.typebotsQueue[0].resultId
+
+ if (!resultId) {
+ throw new TRPCError({
+ code: 'NOT_FOUND',
+ message: 'Result not found.',
+ })
+ }
+
+ try {
+ await saveLogs(
+ clientLogs.map((log) => ({
+ ...log,
+ resultId,
+ details: formatLogDetails(log.details),
+ }))
+ )
+ return {
+ message: 'Logs successfully saved.',
+ }
+ } catch (e) {
+ console.error('Failed to save logs', e)
+ Sentry.captureException(e)
+ throw new TRPCError({
+ code: 'INTERNAL_SERVER_ERROR',
+ message: 'Failed to save logs.',
+ })
+ }
+ })
diff --git a/apps/viewer/src/features/chat/api/startChat.ts b/apps/viewer/src/features/chat/api/startChat.ts
new file mode 100644
index 00000000000..956148b0c09
--- /dev/null
+++ b/apps/viewer/src/features/chat/api/startChat.ts
@@ -0,0 +1,83 @@
+import { publicProcedure } from '@/helpers/server/trpc'
+import {
+ startChatInputSchema,
+ startChatResponseSchema,
+} from '@typebot.io/schemas/features/chat/schema'
+import { startSession } from '@typebot.io/bot-engine/startSession'
+import { saveStateToDatabase } from '@typebot.io/bot-engine/saveStateToDatabase'
+import { restartSession } from '@typebot.io/bot-engine/queries/restartSession'
+
+export const startChat = publicProcedure
+ .meta({
+ openapi: {
+ method: 'POST',
+ path: '/v1/typebots/{publicId}/startChat',
+ summary: 'Start chat',
+ },
+ })
+ .input(startChatInputSchema)
+ .output(startChatResponseSchema)
+ .mutation(
+ async ({
+ input: {
+ message,
+ isOnlyRegistering,
+ publicId,
+ isStreamEnabled,
+ prefilledVariables,
+ resultId: startResultId,
+ },
+ }) => {
+ const {
+ typebot,
+ messages,
+ input,
+ resultId,
+ dynamicTheme,
+ logs,
+ clientSideActions,
+ newSessionState,
+ visitedEdges,
+ } = await startSession({
+ version: 2,
+ startParams: {
+ type: 'live',
+ isOnlyRegistering,
+ isStreamEnabled,
+ publicId,
+ prefilledVariables,
+ resultId: startResultId,
+ },
+ message,
+ })
+
+ const session = isOnlyRegistering
+ ? await restartSession({
+ state: newSessionState,
+ })
+ : await saveStateToDatabase({
+ session: {
+ state: newSessionState,
+ },
+ input,
+ logs,
+ clientSideActions,
+ visitedEdges,
+ })
+
+ return {
+ sessionId: session.id,
+ typebot: {
+ id: typebot.id,
+ theme: typebot.theme,
+ settings: typebot.settings,
+ },
+ messages,
+ input,
+ resultId,
+ dynamicTheme,
+ logs,
+ clientSideActions,
+ }
+ }
+ )
diff --git a/apps/viewer/src/features/chat/api/startChatPreview.ts b/apps/viewer/src/features/chat/api/startChatPreview.ts
new file mode 100644
index 00000000000..43be02c7b25
--- /dev/null
+++ b/apps/viewer/src/features/chat/api/startChatPreview.ts
@@ -0,0 +1,83 @@
+import { authenticatedProcedure } from '@/helpers/server/trpc'
+import {
+ startPreviewChatInputSchema,
+ startPreviewChatResponseSchema,
+} from '@typebot.io/schemas/features/chat/schema'
+import { startSession } from '@typebot.io/bot-engine/startSession'
+import { saveStateToDatabase } from '@typebot.io/bot-engine/saveStateToDatabase'
+import { restartSession } from '@typebot.io/bot-engine/queries/restartSession'
+
+export const startChatPreview = authenticatedProcedure
+ .meta({
+ openapi: {
+ method: 'POST',
+ path: '/v1/typebots/{typebotId}/preview/startChat',
+ summary: 'Start preview chat',
+ },
+ })
+ .input(startPreviewChatInputSchema)
+ .output(startPreviewChatResponseSchema)
+ .mutation(
+ async ({
+ input: {
+ message,
+ isOnlyRegistering,
+ isStreamEnabled,
+ startFrom,
+ typebotId,
+ typebot: startTypebot,
+ },
+ ctx: { user },
+ }) => {
+ const {
+ typebot,
+ messages,
+ input,
+ dynamicTheme,
+ logs,
+ clientSideActions,
+ newSessionState,
+ visitedEdges,
+ } = await startSession({
+ version: 2,
+ startParams: {
+ type: 'preview',
+ isOnlyRegistering,
+ isStreamEnabled,
+ startFrom,
+ typebotId,
+ typebot: startTypebot,
+ userId: user.id,
+ },
+ message,
+ })
+
+ const session = isOnlyRegistering
+ ? await restartSession({
+ state: newSessionState,
+ })
+ : await saveStateToDatabase({
+ session: {
+ state: newSessionState,
+ },
+ input,
+ logs,
+ clientSideActions,
+ visitedEdges,
+ })
+
+ return {
+ sessionId: session.id,
+ typebot: {
+ id: typebot.id,
+ theme: typebot.theme,
+ settings: typebot.settings,
+ },
+ messages,
+ input,
+ dynamicTheme,
+ logs,
+ clientSideActions,
+ }
+ }
+ )
diff --git a/apps/viewer/src/features/chat/api/updateTypebotInSession.ts b/apps/viewer/src/features/chat/api/updateTypebotInSession.ts
index cab8d4fd095..47901d7d542 100644
--- a/apps/viewer/src/features/chat/api/updateTypebotInSession.ts
+++ b/apps/viewer/src/features/chat/api/updateTypebotInSession.ts
@@ -1,4 +1,3 @@
-import { publicProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import { z } from 'zod'
import { getSession } from '@typebot.io/bot-engine/queries/getSession'
@@ -9,12 +8,13 @@ import {
Variable,
} from '@typebot.io/schemas'
import prisma from '@typebot.io/lib/prisma'
+import { authenticatedProcedure } from '@/helpers/server/trpc'
-export const updateTypebotInSession = publicProcedure
+export const updateTypebotInSession = authenticatedProcedure
.meta({
openapi: {
method: 'POST',
- path: '/sessions/{sessionId}/updateTypebot',
+ path: '/v1/sessions/{sessionId}/updateTypebot',
summary: 'Update typebot in session',
description:
'Update chat session with latest typebot modifications. This is useful when you want to update the typebot in an ongoing session after making changes to it.',
@@ -28,8 +28,6 @@ export const updateTypebotInSession = publicProcedure
)
.output(z.object({ message: z.literal('success') }))
.mutation(async ({ input: { sessionId }, ctx: { user } }) => {
- if (!user)
- throw new TRPCError({ code: 'UNAUTHORIZED', message: 'Unauthorized' })
const session = await getSession(sessionId)
if (!session)
throw new TRPCError({ code: 'NOT_FOUND', message: 'Session not found' })
diff --git a/apps/viewer/src/features/fileUpload/api/deprecated/getUploadUrl.ts b/apps/viewer/src/features/fileUpload/api/deprecated/getUploadUrl.ts
index 8d1b5674b0a..5db09d99dff 100644
--- a/apps/viewer/src/features/fileUpload/api/deprecated/getUploadUrl.ts
+++ b/apps/viewer/src/features/fileUpload/api/deprecated/getUploadUrl.ts
@@ -19,10 +19,11 @@ export const getUploadUrl = publicProcedure
.meta({
openapi: {
method: 'GET',
- path: '/typebots/{typebotId}/blocks/{blockId}/storage/upload-url',
+ path: '/v1/typebots/{typebotId}/blocks/{blockId}/storage/upload-url',
summary: 'Get upload URL for a file',
description: 'Used for the web client to get the bucket upload file.',
deprecated: true,
+ tags: ['Deprecated'],
},
})
.input(
diff --git a/apps/viewer/src/features/fileUpload/api/generateUploadUrl.ts b/apps/viewer/src/features/fileUpload/api/generateUploadUrl.ts
index ddc2d2ceac3..955710592f1 100644
--- a/apps/viewer/src/features/fileUpload/api/generateUploadUrl.ts
+++ b/apps/viewer/src/features/fileUpload/api/generateUploadUrl.ts
@@ -13,7 +13,7 @@ export const generateUploadUrl = publicProcedure
.meta({
openapi: {
method: 'POST',
- path: '/generate-upload-url',
+ path: '/v1/generate-upload-url',
summary: 'Generate upload URL',
description: 'Used to upload anything from the client to S3 bucket',
},
diff --git a/apps/viewer/src/features/whatsapp/api/receiveMessage.ts b/apps/viewer/src/features/whatsapp/api/receiveMessage.ts
index 1c45848a28d..b3ca081212d 100644
--- a/apps/viewer/src/features/whatsapp/api/receiveMessage.ts
+++ b/apps/viewer/src/features/whatsapp/api/receiveMessage.ts
@@ -8,7 +8,7 @@ export const receiveMessage = publicProcedure
.meta({
openapi: {
method: 'POST',
- path: '/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook',
+ path: '/v1/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook',
summary: 'Message webhook',
tags: ['WhatsApp'],
},
diff --git a/apps/viewer/src/features/whatsapp/api/subscribeWebhook.ts b/apps/viewer/src/features/whatsapp/api/subscribeWebhook.ts
index a5d932f82d8..62e840eddbc 100644
--- a/apps/viewer/src/features/whatsapp/api/subscribeWebhook.ts
+++ b/apps/viewer/src/features/whatsapp/api/subscribeWebhook.ts
@@ -7,7 +7,7 @@ export const subscribeWebhook = publicProcedure
.meta({
openapi: {
method: 'GET',
- path: '/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook',
+ path: '/v1/workspaces/{workspaceId}/whatsapp/{credentialsId}/webhook',
summary: 'Subscribe webhook',
tags: ['WhatsApp'],
protect: true,
diff --git a/apps/viewer/src/helpers/server/appRouter.ts b/apps/viewer/src/helpers/server/appRouter.ts
new file mode 100644
index 00000000000..f19ae76b252
--- /dev/null
+++ b/apps/viewer/src/helpers/server/appRouter.ts
@@ -0,0 +1,26 @@
+import { sendMessageV1 } from '@/features/chat/api/legacy/sendMessageV1'
+import { whatsAppRouter } from '@/features/whatsapp/api/router'
+import { router } from './trpc'
+import { updateTypebotInSession } from '@/features/chat/api/updateTypebotInSession'
+import { getUploadUrl } from '@/features/fileUpload/api/deprecated/getUploadUrl'
+import { generateUploadUrl } from '@/features/fileUpload/api/generateUploadUrl'
+import { sendMessageV2 } from '@/features/chat/api/legacy/sendMessageV2'
+import { continueChat } from '@/features/chat/api/continueChat'
+import { saveClientLogs } from '@/features/chat/api/saveClientLogs'
+import { startChat } from '@/features/chat/api/startChat'
+import { startChatPreview } from '@/features/chat/api/startChatPreview'
+
+export const appRouter = router({
+ sendMessageV1,
+ sendMessageV2,
+ startChat,
+ continueChat,
+ startChatPreview: startChatPreview,
+ getUploadUrl,
+ generateUploadUrl,
+ updateTypebotInSession,
+ whatsAppRouter,
+ saveClientLogs,
+})
+
+export type AppRouter = typeof appRouter
diff --git a/apps/viewer/src/helpers/server/context.ts b/apps/viewer/src/helpers/server/context.ts
index e0a21ac1d01..c5250f16f74 100644
--- a/apps/viewer/src/helpers/server/context.ts
+++ b/apps/viewer/src/helpers/server/context.ts
@@ -3,6 +3,8 @@ import { inferAsyncReturnType } from '@trpc/server'
import * as trpcNext from '@trpc/server/adapters/next'
import { User } from '@typebot.io/prisma'
import { NextApiRequest } from 'next'
+import { mockedUser } from '@typebot.io/lib/mockedUser'
+import { env } from '@typebot.io/env'
export async function createContext(opts: trpcNext.CreateNextContextOptions) {
const user = await getAuthenticatedUser(opts.req)
@@ -15,6 +17,7 @@ export async function createContext(opts: trpcNext.CreateNextContextOptions) {
const getAuthenticatedUser = async (
req: NextApiRequest
): Promise => {
+ if (env.NEXT_PUBLIC_E2E_TEST) return mockedUser
const bearerToken = extractBearerToken(req)
if (!bearerToken) return
return authenticateByToken(bearerToken)
diff --git a/apps/viewer/src/helpers/server/generateOpenApi.ts b/apps/viewer/src/helpers/server/generateOpenApi.ts
index 40b750a9597..1c2bf887ecf 100644
--- a/apps/viewer/src/helpers/server/generateOpenApi.ts
+++ b/apps/viewer/src/helpers/server/generateOpenApi.ts
@@ -1,11 +1,11 @@
import { generateOpenApiDocument } from 'trpc-openapi'
import { writeFileSync } from 'fs'
-import { appRouter } from './routers/appRouterV2'
+import { appRouter } from './appRouter'
const openApiDocument = generateOpenApiDocument(appRouter, {
title: 'Chat API',
- version: '2.0.0',
- baseUrl: 'https://typebot.io/api/v2',
+ version: '3.0.0',
+ baseUrl: 'https://typebot.io/api',
docsUrl: 'https://docs.typebot.io/api',
})
diff --git a/apps/viewer/src/helpers/server/routers/appRouterV1.ts b/apps/viewer/src/helpers/server/routers/appRouterV1.ts
deleted file mode 100644
index aa9269b03f5..00000000000
--- a/apps/viewer/src/helpers/server/routers/appRouterV1.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { sendMessageV1 } from '@/features/chat/api/sendMessageV1'
-import { whatsAppRouter } from '@/features/whatsapp/api/router'
-import { router } from '../trpc'
-import { updateTypebotInSession } from '@/features/chat/api/updateTypebotInSession'
-import { getUploadUrl } from '@/features/fileUpload/api/deprecated/getUploadUrl'
-import { generateUploadUrl } from '@/features/fileUpload/api/generateUploadUrl'
-
-export const appRouter = router({
- sendMessageV1,
- getUploadUrl,
- generateUploadUrl,
- updateTypebotInSession,
- whatsAppRouter,
-})
-
-export type AppRouter = typeof appRouter
diff --git a/apps/viewer/src/helpers/server/routers/appRouterV2.ts b/apps/viewer/src/helpers/server/routers/appRouterV2.ts
deleted file mode 100644
index 8267b4c3147..00000000000
--- a/apps/viewer/src/helpers/server/routers/appRouterV2.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { sendMessageV2 } from '@/features/chat/api/sendMessageV2'
-import { whatsAppRouter } from '@/features/whatsapp/api/router'
-import { router } from '../trpc'
-import { updateTypebotInSession } from '@/features/chat/api/updateTypebotInSession'
-import { getUploadUrl } from '@/features/fileUpload/api/deprecated/getUploadUrl'
-import { generateUploadUrl } from '@/features/fileUpload/api/generateUploadUrl'
-
-export const appRouter = router({
- sendMessageV2,
- getUploadUrl,
- generateUploadUrl,
- updateTypebotInSession,
- whatsAppRouter,
-})
-
-export type AppRouter = typeof appRouter
diff --git a/apps/viewer/src/helpers/server/trpc.ts b/apps/viewer/src/helpers/server/trpc.ts
index 0dfe8c66f0b..8f61174c233 100644
--- a/apps/viewer/src/helpers/server/trpc.ts
+++ b/apps/viewer/src/helpers/server/trpc.ts
@@ -1,4 +1,4 @@
-import { initTRPC } from '@trpc/server'
+import { TRPCError, initTRPC } from '@trpc/server'
import { OpenApiMeta } from 'trpc-openapi'
import superjson from 'superjson'
import { Context } from './context'
@@ -8,13 +8,23 @@ const t = initTRPC.context().meta().create({
transformer: superjson,
})
+export const router = t.router
+
const sentryMiddleware = t.middleware(
Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
})
)
-const injectUser = t.middleware(({ next, ctx }) => {
+export const publicProcedure = t.procedure.use(sentryMiddleware)
+
+const isAuthed = t.middleware(({ next, ctx }) => {
+ if (!ctx.user?.id) {
+ throw new TRPCError({
+ code: 'UNAUTHORIZED',
+ message: 'You need to be authenticated to perform this action',
+ })
+ }
return next({
ctx: {
user: ctx.user,
@@ -22,10 +32,6 @@ const injectUser = t.middleware(({ next, ctx }) => {
})
})
-const finalMiddleware = sentryMiddleware.unstable_pipe(injectUser)
-
-export const middleware = t.middleware
-
-export const router = t.router
-
-export const publicProcedure = t.procedure.use(finalMiddleware)
+export const authenticatedProcedure = t.procedure.use(
+ sentryMiddleware.unstable_pipe(isAuthed)
+)
diff --git a/apps/viewer/src/pages/api/v1/[...trpc].ts b/apps/viewer/src/pages/api/[...trpc].ts
similarity index 90%
rename from apps/viewer/src/pages/api/v1/[...trpc].ts
rename to apps/viewer/src/pages/api/[...trpc].ts
index 00bde4dfd7a..7eafc525c96 100644
--- a/apps/viewer/src/pages/api/v1/[...trpc].ts
+++ b/apps/viewer/src/pages/api/[...trpc].ts
@@ -1,4 +1,4 @@
-import { appRouter } from '@/helpers/server/routers/appRouterV1'
+import { appRouter } from '@/helpers/server/appRouter'
import * as Sentry from '@sentry/nextjs'
import { createOpenApiNextHandler } from 'trpc-openapi'
import cors from 'nextjs-cors'
diff --git a/apps/viewer/src/pages/api/v2/[...trpc].ts b/apps/viewer/src/pages/api/v2/[...trpc].ts
deleted file mode 100644
index d3d72f5de3c..00000000000
--- a/apps/viewer/src/pages/api/v2/[...trpc].ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { appRouter } from '@/helpers/server/routers/appRouterV2'
-import * as Sentry from '@sentry/nextjs'
-import { createOpenApiNextHandler } from 'trpc-openapi'
-import cors from 'nextjs-cors'
-import { NextApiRequest, NextApiResponse } from 'next'
-import { createContext } from '@/helpers/server/context'
-
-const handler = async (req: NextApiRequest, res: NextApiResponse) => {
- await cors(req, res)
-
- return createOpenApiNextHandler({
- router: appRouter,
- createContext,
- onError({ error }) {
- if (error.code === 'INTERNAL_SERVER_ERROR') {
- Sentry.captureException(error)
- console.error('Something went wrong', error)
- }
- },
- })(req, res)
-}
-
-export default handler
diff --git a/apps/viewer/src/test/chat.spec.ts b/apps/viewer/src/test/chat.spec.ts
index ba6cad68cce..37f172ea52b 100644
--- a/apps/viewer/src/test/chat.spec.ts
+++ b/apps/viewer/src/test/chat.spec.ts
@@ -2,7 +2,6 @@ import { getTestAsset } from '@/test/utils/playwright'
import test, { expect } from '@playwright/test'
import { createId } from '@paralleldrive/cuid2'
import prisma from '@typebot.io/lib/prisma'
-import { SendMessageInput } from '@typebot.io/schemas'
import {
createWebhook,
deleteTypebots,
@@ -10,6 +9,7 @@ import {
importTypebotInDatabase,
} from '@typebot.io/lib/playwright/databaseActions'
import { HttpMethod } from '@typebot.io/schemas/features/blocks/integrations/webhook/constants'
+import { StartChatInput, StartPreviewChatInput } from '@typebot.io/schemas'
test.afterEach(async () => {
await deleteWebhooks(['chat-webhook-id'])
@@ -40,17 +40,18 @@ test('API chat execution should work on preview bot', async ({ request }) => {
url: 'https://api.chucknorris.io/jokes/random',
})
- await test.step('Start the chat', async () => {
+ let chatSessionId: string
+
+ await test.step('Can start and continue chat', async () => {
const { sessionId, messages, input, resultId } = await (
- await request.post(`/api/v2/sendMessage`, {
+ await request.post(`/api/v1/typebots/${typebotId}/preview/startChat`, {
data: {
- startParams: {
- typebot: typebotId,
- isPreview: true,
- },
- } satisfies SendMessageInput,
+ isOnlyRegistering: false,
+ isStreamEnabled: false,
+ } satisfies Omit,
})
).json()
+ chatSessionId = sessionId
expect(resultId).toBeUndefined()
expect(sessionId).toBeDefined()
expect(messages[0].content.richText).toStrictEqual([
@@ -61,6 +62,38 @@ test('API chat execution should work on preview bot', async ({ request }) => {
])
expect(input.type).toBe('text input')
})
+
+ await test.step('Can answer Name question', async () => {
+ const { messages, input } = await (
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: {
+ message: 'John',
+ },
+ })
+ ).json()
+ expect(messages[0].content.richText).toStrictEqual([
+ {
+ children: [
+ { text: 'Nice to meet you ' },
+ {
+ type: 'inline-variable',
+ children: [
+ {
+ type: 'p',
+ children: [
+ {
+ text: 'John',
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ type: 'p',
+ },
+ ])
+ expect(input.type).toBe('number input')
+ })
})
test('API chat execution should work on published bot', async ({ request }) => {
@@ -83,12 +116,11 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Start the chat', async () => {
const { sessionId, messages, input, resultId } = await (
- await request.post(`/api/v2/sendMessage`, {
+ await request.post(`/api/v1/typebots/${publicId}/startChat`, {
data: {
- startParams: {
- typebot: publicId,
- },
- } satisfies SendMessageInput,
+ isOnlyRegistering: false,
+ isStreamEnabled: false,
+ } satisfies Omit,
})
).json()
chatSessionId = sessionId
@@ -111,8 +143,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Name question', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: 'John', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: 'John' },
})
).json()
expect(messages[0].content.richText).toStrictEqual([
@@ -142,8 +174,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Age question', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: '24', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: '24' },
})
).json()
expect(messages[0].content.richText).toStrictEqual([
@@ -181,8 +213,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Rating question', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: '8', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: '8' },
})
).json()
expect(messages[0].content.richText).toStrictEqual([
@@ -196,8 +228,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Email question with wrong input', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: 'invalid email', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: 'invalid email' },
})
).json()
expect(messages[0].content.richText).toStrictEqual([
@@ -215,8 +247,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Email question with valid input', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: 'typebot@email.com', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: 'typebot@email.com' },
})
).json()
expect(messages.length).toBe(0)
@@ -225,8 +257,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer URL question', async () => {
const { messages, input } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: 'https://typebot.io', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: 'https://typebot.io' },
})
).json()
expect(messages.length).toBe(0)
@@ -235,8 +267,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
await test.step('Answer Buttons question with invalid choice', async () => {
const { messages } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: { message: 'Yes', sessionId: chatSessionId },
+ await request.post(`/api/v1/sessions/${chatSessionId}/continueChat`, {
+ data: { message: 'Yes' },
})
).json()
expect(messages[0].content.richText).toStrictEqual([
@@ -263,14 +295,14 @@ test('API chat execution should work on published bot', async ({ request }) => {
})
await test.step('Starting with a message when typebot starts with input should proceed', async () => {
const { messages } = await (
- await request.post(`/api/v2/sendMessage`, {
- data: {
- message: 'Hey',
- startParams: {
- typebot: 'starting-with-input-public',
- },
- } satisfies SendMessageInput,
- })
+ await request.post(
+ `/api/v1/typebots/starting-with-input-public/startChat`,
+ {
+ data: {
+ message: 'Hey',
+ } satisfies Omit,
+ }
+ )
).json()
expect(messages[0].content.richText).toStrictEqual([
{
diff --git a/apps/viewer/src/test/settings.spec.ts b/apps/viewer/src/test/settings.spec.ts
index c5ef77eaaf6..b94e158fb74 100644
--- a/apps/viewer/src/test/settings.spec.ts
+++ b/apps/viewer/src/test/settings.spec.ts
@@ -30,7 +30,7 @@ test('Result should be overwritten on page refresh', async ({ page }) => {
const [, response] = await Promise.all([
page.goto(`/${typebotId}-public`),
- page.waitForResponse(/sendMessage/),
+ page.waitForResponse(/startChat/),
])
const { resultId } = await response.json()
expect(resultId).toBeDefined()
@@ -38,7 +38,7 @@ test('Result should be overwritten on page refresh', async ({ page }) => {
const [, secondResponse] = await Promise.all([
page.reload(),
- page.waitForResponse(/sendMessage/),
+ page.waitForResponse(/startChat/),
])
const { resultId: secondResultId } = await secondResponse.json()
expect(secondResultId).toBe(resultId)
@@ -57,7 +57,7 @@ test.describe('Create result on page refresh enabled', () => {
])
const [, response] = await Promise.all([
page.goto(`/${typebotId}-public`),
- page.waitForResponse(/sendMessage/),
+ page.waitForResponse(/startChat/),
])
const { resultId } = await response.json()
expect(resultId).toBeDefined()
@@ -65,7 +65,7 @@ test.describe('Create result on page refresh enabled', () => {
await expect(page.getByRole('textbox')).toBeVisible()
const [, secondResponse] = await Promise.all([
page.reload(),
- page.waitForResponse(/sendMessage/),
+ page.waitForResponse(/startChat/),
])
const { resultId: secondResultId } = await secondResponse.json()
expect(secondResultId).not.toBe(resultId)
diff --git a/apps/viewer/src/trpc/generateOpenApi.ts b/apps/viewer/src/trpc/generateOpenApi.ts
index 828dd3bf643..b4c05c92974 100644
--- a/apps/viewer/src/trpc/generateOpenApi.ts
+++ b/apps/viewer/src/trpc/generateOpenApi.ts
@@ -1,11 +1,11 @@
import { generateOpenApiDocument } from 'trpc-openapi'
import { writeFileSync } from 'fs'
-import { appRouter } from '@/helpers/server/routers/appRouterV2'
+import { appRouter } from '@/helpers/server/appRouter'
const openApiDocument = generateOpenApiDocument(appRouter, {
title: 'Chat API',
- version: '2.0.0',
- baseUrl: 'https://typebot.io/api/v2',
+ version: '3.0.0',
+ baseUrl: 'https://typebot.io/api',
docsUrl: 'https://docs.typebot.io/api',
})
diff --git a/packages/bot-engine/blocks/integrations/googleSheets/getRow.ts b/packages/bot-engine/blocks/integrations/googleSheets/getRow.ts
index ea8604aad67..f717c6a136e 100644
--- a/packages/bot-engine/blocks/integrations/googleSheets/getRow.ts
+++ b/packages/bot-engine/blocks/integrations/googleSheets/getRow.ts
@@ -2,7 +2,7 @@ import {
SessionState,
GoogleSheetsGetOptions,
VariableWithValue,
- ReplyLog,
+ ChatLog,
} from '@typebot.io/schemas'
import { isNotEmpty, byId, isDefined } from '@typebot.io/lib'
import { getAuthenticatedGoogleDoc } from './helpers/getAuthenticatedGoogleDoc'
@@ -18,7 +18,7 @@ export const getRow = async (
options,
}: { outgoingEdgeId?: string; options: GoogleSheetsGetOptions }
): Promise => {
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const { variables } = state.typebotsQueue[0].typebot
const { sheetId, cellsToExtract, filter, ...parsedOptions } =
deepParseVariables(variables)(options)
diff --git a/packages/bot-engine/blocks/integrations/googleSheets/insertRow.ts b/packages/bot-engine/blocks/integrations/googleSheets/insertRow.ts
index 59f16c1487f..d521982ffb9 100644
--- a/packages/bot-engine/blocks/integrations/googleSheets/insertRow.ts
+++ b/packages/bot-engine/blocks/integrations/googleSheets/insertRow.ts
@@ -1,7 +1,7 @@
import {
SessionState,
GoogleSheetsInsertRowOptions,
- ReplyLog,
+ ChatLog,
} from '@typebot.io/schemas'
import { parseCellValues } from './helpers/parseCellValues'
import { getAuthenticatedGoogleDoc } from './helpers/getAuthenticatedGoogleDoc'
@@ -17,7 +17,7 @@ export const insertRow = async (
const { variables } = state.typebotsQueue[0].typebot
if (!options.cellsToInsert || !options.sheetId) return { outgoingEdgeId }
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const doc = await getAuthenticatedGoogleDoc({
credentialsId: options.credentialsId,
diff --git a/packages/bot-engine/blocks/integrations/googleSheets/updateRow.ts b/packages/bot-engine/blocks/integrations/googleSheets/updateRow.ts
index bbc039dd98c..d440be0381a 100644
--- a/packages/bot-engine/blocks/integrations/googleSheets/updateRow.ts
+++ b/packages/bot-engine/blocks/integrations/googleSheets/updateRow.ts
@@ -1,7 +1,7 @@
import {
SessionState,
GoogleSheetsUpdateRowOptions,
- ReplyLog,
+ ChatLog,
} from '@typebot.io/schemas'
import { parseCellValues } from './helpers/parseCellValues'
import { getAuthenticatedGoogleDoc } from './helpers/getAuthenticatedGoogleDoc'
@@ -28,7 +28,7 @@ export const updateRow = async (
if (!options.cellsToUpsert || !sheetId || (!referenceCell && !filter))
return { outgoingEdgeId }
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const doc = await getAuthenticatedGoogleDoc({
credentialsId: options.credentialsId,
diff --git a/packages/bot-engine/blocks/integrations/openai/executeChatCompletionOpenAIRequest.ts b/packages/bot-engine/blocks/integrations/openai/executeChatCompletionOpenAIRequest.ts
index 314e275ac83..72c67920d65 100644
--- a/packages/bot-engine/blocks/integrations/openai/executeChatCompletionOpenAIRequest.ts
+++ b/packages/bot-engine/blocks/integrations/openai/executeChatCompletionOpenAIRequest.ts
@@ -1,5 +1,5 @@
import { isNotEmpty } from '@typebot.io/lib/utils'
-import { ChatReply } from '@typebot.io/schemas'
+import { ContinueChatResponse } from '@typebot.io/schemas'
import { OpenAIBlock } from '@typebot.io/schemas/features/blocks/integrations/openai'
import { HTTPError } from 'got'
import { ClientOptions, OpenAI } from 'openai'
@@ -10,7 +10,7 @@ type Props = Pick<
> & {
apiKey: string
temperature: number | undefined
- currentLogs?: ChatReply['logs']
+ currentLogs?: ContinueChatResponse['logs']
isRetrying?: boolean
} & Pick, 'apiVersion' | 'baseUrl'>
@@ -25,9 +25,9 @@ export const executeChatCompletionOpenAIRequest = async ({
currentLogs = [],
}: Props): Promise<{
chatCompletion?: OpenAI.Chat.Completions.ChatCompletion
- logs?: ChatReply['logs']
+ logs?: ContinueChatResponse['logs']
}> => {
- const logs: ChatReply['logs'] = currentLogs
+ const logs: ContinueChatResponse['logs'] = currentLogs
if (messages.length === 0) return { logs }
try {
const config = {
diff --git a/packages/bot-engine/blocks/integrations/openai/resumeChatCompletion.ts b/packages/bot-engine/blocks/integrations/openai/resumeChatCompletion.ts
index fe9c77a0d07..45daed84520 100644
--- a/packages/bot-engine/blocks/integrations/openai/resumeChatCompletion.ts
+++ b/packages/bot-engine/blocks/integrations/openai/resumeChatCompletion.ts
@@ -1,5 +1,5 @@
import { byId, isDefined } from '@typebot.io/lib'
-import { ChatReply, SessionState } from '@typebot.io/schemas'
+import { ContinueChatResponse, SessionState } from '@typebot.io/schemas'
import { ChatCompletionOpenAIOptions } from '@typebot.io/schemas/features/blocks/integrations/openai'
import { VariableWithUnknowValue } from '@typebot.io/schemas/features/typebot/variable'
import { updateVariablesInSession } from '../../../variables/updateVariablesInSession'
@@ -14,7 +14,7 @@ export const resumeChatCompletion =
}: {
outgoingEdgeId?: string
options: ChatCompletionOpenAIOptions
- logs?: ChatReply['logs']
+ logs?: ContinueChatResponse['logs']
}
) =>
async (message: string, totalTokens?: number) => {
diff --git a/packages/bot-engine/blocks/integrations/sendEmail/executeSendEmailBlock.tsx b/packages/bot-engine/blocks/integrations/sendEmail/executeSendEmailBlock.tsx
index 2745ab45153..3a7a477aae6 100644
--- a/packages/bot-engine/blocks/integrations/sendEmail/executeSendEmailBlock.tsx
+++ b/packages/bot-engine/blocks/integrations/sendEmail/executeSendEmailBlock.tsx
@@ -1,7 +1,7 @@
import { DefaultBotNotificationEmail, render } from '@typebot.io/emails'
import {
AnswerInSessionState,
- ReplyLog,
+ ChatLog,
SendEmailBlock,
SessionState,
SmtpCredentials,
@@ -25,7 +25,7 @@ export const executeSendEmailBlock = async (
state: SessionState,
block: SendEmailBlock
): Promise => {
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const { options } = block
const { typebot, resultId, answers } = state.typebotsQueue[0]
const isPreview = !resultId
@@ -114,8 +114,8 @@ const sendEmail = async ({
typebot: TypebotInSession
answers: AnswerInSessionState[]
fileUrls?: string | string[]
-}): Promise => {
- const logs: ReplyLog[] = []
+}): Promise => {
+ const logs: ChatLog[] = []
const { name: replyToName } = parseEmailRecipient(replyTo)
const { host, port, isTlsEnabled, username, password, from } =
diff --git a/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts b/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts
index 7b3c172729e..60dbed542af 100644
--- a/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts
+++ b/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts
@@ -8,7 +8,7 @@ import {
Variable,
WebhookResponse,
KeyValue,
- ReplyLog,
+ ChatLog,
ExecutableWebhook,
AnswerInSessionState,
} from '@typebot.io/schemas'
@@ -34,7 +34,7 @@ export const executeWebhookBlock = async (
state: SessionState,
block: WebhookBlock | ZapierBlock | MakeComBlock | PabblyConnectBlock
): Promise => {
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const webhook =
block.options?.webhook ??
('webhookId' in block
@@ -142,8 +142,8 @@ const parseWebhookAttributes =
export const executeWebhook = async (
webhook: ParsedWebhook
-): Promise<{ response: WebhookResponse; logs?: ReplyLog[] }> => {
- const logs: ReplyLog[] = []
+): Promise<{ response: WebhookResponse; logs?: ChatLog[] }> => {
+ const logs: ChatLog[] = []
const { headers, url, method, basicAuth, body, isJson } = webhook
const contentType = headers ? headers['Content-Type'] : undefined
diff --git a/packages/bot-engine/blocks/integrations/webhook/resumeWebhookExecution.ts b/packages/bot-engine/blocks/integrations/webhook/resumeWebhookExecution.ts
index daba53e380d..e7f495aebbb 100644
--- a/packages/bot-engine/blocks/integrations/webhook/resumeWebhookExecution.ts
+++ b/packages/bot-engine/blocks/integrations/webhook/resumeWebhookExecution.ts
@@ -2,7 +2,7 @@ import { byId } from '@typebot.io/lib'
import {
MakeComBlock,
PabblyConnectBlock,
- ReplyLog,
+ ChatLog,
VariableWithUnknowValue,
WebhookBlock,
ZapierBlock,
@@ -15,7 +15,7 @@ import { updateVariablesInSession } from '../../../variables/updateVariablesInSe
type Props = {
state: SessionState
block: WebhookBlock | ZapierBlock | MakeComBlock | PabblyConnectBlock
- logs?: ReplyLog[]
+ logs?: ChatLog[]
response: {
statusCode: number
data?: unknown
diff --git a/packages/bot-engine/blocks/logic/typebotLink/executeTypebotLink.ts b/packages/bot-engine/blocks/logic/typebotLink/executeTypebotLink.ts
index 5670d7cd722..2bd765f4398 100644
--- a/packages/bot-engine/blocks/logic/typebotLink/executeTypebotLink.ts
+++ b/packages/bot-engine/blocks/logic/typebotLink/executeTypebotLink.ts
@@ -3,7 +3,7 @@ import {
TypebotLinkBlock,
SessionState,
Variable,
- ReplyLog,
+ ChatLog,
Edge,
typebotInSessionStateSchema,
TypebotInSession,
@@ -19,7 +19,7 @@ export const executeTypebotLink = async (
state: SessionState,
block: TypebotLinkBlock
): Promise => {
- const logs: ReplyLog[] = []
+ const logs: ChatLog[] = []
const typebotId = block.options?.typebotId
if (!typebotId) {
logs.push({
diff --git a/packages/bot-engine/continueBotFlow.ts b/packages/bot-engine/continueBotFlow.ts
index a9f7261acb7..56dafad05a5 100644
--- a/packages/bot-engine/continueBotFlow.ts
+++ b/packages/bot-engine/continueBotFlow.ts
@@ -1,7 +1,7 @@
import {
AnswerInSessionState,
Block,
- ChatReply,
+ ContinueChatResponse,
Group,
InputBlock,
SessionState,
@@ -46,7 +46,10 @@ export const continueBotFlow = async (
reply: string | undefined,
{ state, version }: Params
): Promise<
- ChatReply & { newSessionState: SessionState; visitedEdges: VisitedEdge[] }
+ ContinueChatResponse & {
+ newSessionState: SessionState
+ visitedEdges: VisitedEdge[]
+ }
> => {
let firstBubbleWasStreamed = false
let newSessionState = { ...state }
@@ -202,7 +205,9 @@ const saveVariableValueIfAny =
const parseRetryMessage =
(state: SessionState) =>
- async (block: InputBlock): Promise> => {
+ async (
+ block: InputBlock
+ ): Promise> => {
const retryMessage =
block.options &&
'retryMessageContent' in block.options &&
diff --git a/packages/bot-engine/executeGroup.ts b/packages/bot-engine/executeGroup.ts
index c51669773c7..14e67c5c033 100644
--- a/packages/bot-engine/executeGroup.ts
+++ b/packages/bot-engine/executeGroup.ts
@@ -1,5 +1,5 @@
import {
- ChatReply,
+ ContinueChatResponse,
Group,
InputBlock,
RuntimeOptions,
@@ -31,7 +31,7 @@ import { VisitedEdge } from '@typebot.io/prisma'
type ContextProps = {
version: 1 | 2
state: SessionState
- currentReply?: ChatReply
+ currentReply?: ContinueChatResponse
currentLastBubbleId?: string
firstBubbleWasStreamed?: boolean
visitedEdges: VisitedEdge[]
@@ -48,12 +48,16 @@ export const executeGroup = async (
firstBubbleWasStreamed,
}: ContextProps
): Promise<
- ChatReply & { newSessionState: SessionState; visitedEdges: VisitedEdge[] }
+ ContinueChatResponse & {
+ newSessionState: SessionState
+ visitedEdges: VisitedEdge[]
+ }
> => {
- const messages: ChatReply['messages'] = currentReply?.messages ?? []
- let clientSideActions: ChatReply['clientSideActions'] =
+ const messages: ContinueChatResponse['messages'] =
+ currentReply?.messages ?? []
+ let clientSideActions: ContinueChatResponse['clientSideActions'] =
currentReply?.clientSideActions
- let logs: ChatReply['logs'] = currentReply?.logs
+ let logs: ContinueChatResponse['logs'] = currentReply?.logs
let nextEdgeId = null
let lastBubbleBlockId: string | undefined = currentLastBubbleId
@@ -173,7 +177,7 @@ const computeRuntimeOptions =
export const parseInput =
(state: SessionState) =>
- async (block: InputBlock): Promise => {
+ async (block: InputBlock): Promise => {
switch (block.type) {
case InputBlockType.CHOICE: {
return injectVariableValuesInButtonsInputBlock(state)(block)
diff --git a/packages/bot-engine/parseBubbleBlock.ts b/packages/bot-engine/parseBubbleBlock.ts
index 288ca2381ed..7eef39c81a1 100644
--- a/packages/bot-engine/parseBubbleBlock.ts
+++ b/packages/bot-engine/parseBubbleBlock.ts
@@ -1,5 +1,10 @@
import { parseVideoUrl } from '@typebot.io/lib/parseVideoUrl'
-import { BubbleBlock, Variable, ChatReply, Typebot } from '@typebot.io/schemas'
+import {
+ BubbleBlock,
+ Variable,
+ ContinueChatResponse,
+ Typebot,
+} from '@typebot.io/schemas'
import { deepParseVariables } from './variables/deepParseVariables'
import { isEmpty, isNotEmpty } from '@typebot.io/lib/utils'
import {
@@ -27,7 +32,7 @@ export type BubbleBlockWithDefinedContent = BubbleBlock & {
export const parseBubbleBlock = (
block: BubbleBlockWithDefinedContent,
{ version, variables, typebotVersion }: Params
-): ChatReply['messages'][0] => {
+): ContinueChatResponse['messages'][0] => {
switch (block.type) {
case BubbleBlockType.TEXT: {
if (version === 1)
diff --git a/packages/bot-engine/parseDynamicTheme.ts b/packages/bot-engine/parseDynamicTheme.ts
index 8f1b291ba0e..d183631e17f 100644
--- a/packages/bot-engine/parseDynamicTheme.ts
+++ b/packages/bot-engine/parseDynamicTheme.ts
@@ -1,9 +1,9 @@
-import { SessionState, ChatReply } from '@typebot.io/schemas'
+import { SessionState, ContinueChatResponse } from '@typebot.io/schemas'
import { parseVariables } from './variables/parseVariables'
export const parseDynamicTheme = (
state: SessionState | undefined
-): ChatReply['dynamicTheme'] => {
+): ContinueChatResponse['dynamicTheme'] => {
if (!state?.dynamicTheme) return
return {
hostAvatarUrl: parseVariables(state?.typebotsQueue[0].typebot.variables)(
diff --git a/packages/bot-engine/saveStateToDatabase.ts b/packages/bot-engine/saveStateToDatabase.ts
index 5cfabcc63f5..615106ffcb7 100644
--- a/packages/bot-engine/saveStateToDatabase.ts
+++ b/packages/bot-engine/saveStateToDatabase.ts
@@ -1,4 +1,4 @@
-import { ChatReply, ChatSession } from '@typebot.io/schemas'
+import { ContinueChatResponse, ChatSession } from '@typebot.io/schemas'
import { upsertResult } from './queries/upsertResult'
import { saveLogs } from './queries/saveLogs'
import { updateSession } from './queries/updateSession'
@@ -11,9 +11,9 @@ import { VisitedEdge } from '@typebot.io/prisma'
type Props = {
session: Pick & { id?: string }
- input: ChatReply['input']
- logs: ChatReply['logs']
- clientSideActions: ChatReply['clientSideActions']
+ input: ContinueChatResponse['input']
+ logs: ContinueChatResponse['logs']
+ clientSideActions: ContinueChatResponse['clientSideActions']
visitedEdges: VisitedEdge[]
forceCreateSession?: boolean
}
diff --git a/packages/bot-engine/startBotFlow.ts b/packages/bot-engine/startBotFlow.ts
index 9860a38cb22..88b841f8c4e 100644
--- a/packages/bot-engine/startBotFlow.ts
+++ b/packages/bot-engine/startBotFlow.ts
@@ -1,5 +1,9 @@
import { TRPCError } from '@trpc/server'
-import { ChatReply, SessionState, StartElementId } from '@typebot.io/schemas'
+import {
+ ContinueChatResponse,
+ SessionState,
+ StartFrom,
+} from '@typebot.io/schemas'
import { executeGroup } from './executeGroup'
import { getNextGroup } from './getNextGroup'
import { VisitedEdge } from '@typebot.io/prisma'
@@ -7,20 +11,24 @@ import { VisitedEdge } from '@typebot.io/prisma'
type Props = {
version: 1 | 2
state: SessionState
-} & StartElementId
+ startFrom?: StartFrom
+}
export const startBotFlow = async ({
version,
state,
- ...props
+ startFrom,
}: Props): Promise<
- ChatReply & { newSessionState: SessionState; visitedEdges: VisitedEdge[] }
+ ContinueChatResponse & {
+ newSessionState: SessionState
+ visitedEdges: VisitedEdge[]
+ }
> => {
let newSessionState = state
const visitedEdges: VisitedEdge[] = []
- if ('startGroupId' in props) {
+ if (startFrom?.type === 'group') {
const group = state.typebotsQueue[0].typebot.groups.find(
- (group) => group.id === props.startGroupId
+ (group) => group.id === startFrom.groupId
)
if (!group)
throw new TRPCError({
@@ -35,7 +43,7 @@ export const startBotFlow = async ({
}
const firstEdgeId = getFirstEdgeId({
state: newSessionState,
- startEventId: 'startEventId' in props ? props.startEventId : undefined,
+ startEventId: startFrom?.type === 'event' ? startFrom.eventId : undefined,
})
if (!firstEdgeId) return { messages: [], newSessionState, visitedEdges: [] }
const nextGroup = await getNextGroup(newSessionState)(firstEdgeId)
diff --git a/packages/bot-engine/startSession.ts b/packages/bot-engine/startSession.ts
index b969a9480a9..2e72aa67404 100644
--- a/packages/bot-engine/startSession.ts
+++ b/packages/bot-engine/startSession.ts
@@ -12,13 +12,13 @@ import {
Block,
} from '@typebot.io/schemas'
import {
- ChatReply,
- StartParams,
+ StartChatInput,
+ StartChatResponse,
+ StartPreviewChatInput,
StartTypebot,
startTypebotSchema,
} from '@typebot.io/schemas/features/chat/schema'
import parse, { NodeType } from 'node-html-parser'
-import { env } from '@typebot.io/env'
import { parseDynamicTheme } from './parseDynamicTheme'
import { findTypebot } from './queries/findTypebot'
import { findPublicTypebot } from './queries/findPublicTypebot'
@@ -36,11 +36,19 @@ import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integr
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
import { VisitedEdge } from '@typebot.io/prisma'
+type StartParams =
+ | ({
+ type: 'preview'
+ userId: string
+ } & StartPreviewChatInput)
+ | ({
+ type: 'live'
+ } & StartChatInput)
+
type Props = {
version: 1 | 2
message: string | undefined
startParams: StartParams
- userId: string | undefined
initialSessionState?: Pick
}
@@ -48,26 +56,24 @@ export const startSession = async ({
version,
message,
startParams,
- userId,
initialSessionState,
}: Props): Promise<
- ChatReply & { newSessionState: SessionState; visitedEdges: VisitedEdge[] }
+ Omit & {
+ newSessionState: SessionState
+ visitedEdges: VisitedEdge[]
+ resultId?: string
+ }
> => {
- if (!startParams)
- throw new TRPCError({
- code: 'BAD_REQUEST',
- message: 'StartParams are missing',
- })
+ const typebot = await getTypebot(startParams)
- const typebot = await getTypebot(startParams, userId)
-
- const prefilledVariables = startParams.prefilledVariables
- ? prefillVariables(typebot.variables, startParams.prefilledVariables)
- : typebot.variables
+ const prefilledVariables =
+ startParams.type === 'live' && startParams.prefilledVariables
+ ? prefillVariables(typebot.variables, startParams.prefilledVariables)
+ : typebot.variables
const result = await getResult({
- ...startParams,
- isPreview: startParams.isPreview || typeof startParams.typebot !== 'string',
+ resultId: startParams.type === 'live' ? startParams.resultId : undefined,
+ isPreview: startParams.type === 'preview',
typebotId: typebot.id,
prefilledVariables,
isRememberUserEnabled:
@@ -148,11 +154,8 @@ export const startSession = async ({
let chatReply = await startBotFlow({
version,
state: initialState,
- ...('startGroupId' in startParams
- ? { startGroupId: startParams.startGroupId }
- : 'startEventId' in startParams
- ? { startEventId: startParams.startEventId }
- : {}),
+ startFrom:
+ startParams.type === 'preview' ? startParams.startFrom : undefined,
})
// If params has message and first block is an input block, we can directly continue the bot flow
@@ -266,20 +269,16 @@ export const startSession = async ({
}
}
-const getTypebot = async (
- { typebot, isPreview }: Pick,
- userId?: string
-): Promise => {
- if (typeof typebot !== 'string') return typebot
- if (isPreview && !userId && !env.NEXT_PUBLIC_E2E_TEST)
- throw new TRPCError({
- code: 'UNAUTHORIZED',
- message:
- 'You need to authenticate the request to start a bot in preview mode.',
- })
- const typebotQuery = isPreview
- ? await findTypebot({ id: typebot, userId })
- : await findPublicTypebot({ publicId: typebot })
+const getTypebot = async (startParams: StartParams): Promise => {
+ if (startParams.type === 'preview' && startParams.typebot)
+ return startParams.typebot
+ const typebotQuery =
+ startParams.type === 'preview'
+ ? await findTypebot({
+ id: startParams.typebotId,
+ userId: startParams.userId,
+ })
+ : await findPublicTypebot({ publicId: startParams.publicId })
const parsedTypebot =
typebotQuery && 'typebot' in typebotQuery
@@ -319,7 +318,9 @@ const getResult = async ({
resultId,
prefilledVariables,
isRememberUserEnabled,
-}: Pick & {
+}: {
+ resultId: string | undefined
+ isPreview: boolean
typebotId: string
prefilledVariables: Variable[]
isRememberUserEnabled: boolean
@@ -375,7 +376,7 @@ const parseDynamicThemeInState = (theme: Theme) => {
const parseStartClientSideAction = (
typebot: StartTypebot
-): NonNullable[number] | undefined => {
+): NonNullable[number] | undefined => {
const blocks = typebot.groups.flatMap((group) => group.blocks)
const pixelBlocks = (
blocks.filter(
diff --git a/packages/bot-engine/types.ts b/packages/bot-engine/types.ts
index c06ff645d25..bee7f215eb1 100644
--- a/packages/bot-engine/types.ts
+++ b/packages/bot-engine/types.ts
@@ -1,16 +1,16 @@
-import { ChatReply, SessionState } from '@typebot.io/schemas'
+import { ContinueChatResponse, SessionState } from '@typebot.io/schemas'
export type EdgeId = string
export type ExecuteLogicResponse = {
outgoingEdgeId: EdgeId | undefined
newSessionState?: SessionState
-} & Pick
+} & Pick
export type ExecuteIntegrationResponse = {
outgoingEdgeId: EdgeId | undefined
newSessionState?: SessionState
-} & Pick
+} & Pick
export type ParsedReply =
| { status: 'success'; reply: string }
diff --git a/packages/bot-engine/variables/prefillVariables.ts b/packages/bot-engine/variables/prefillVariables.ts
index 0c06ab5904a..d044f302b5b 100644
--- a/packages/bot-engine/variables/prefillVariables.ts
+++ b/packages/bot-engine/variables/prefillVariables.ts
@@ -1,9 +1,9 @@
import { safeStringify } from '@typebot.io/lib/safeStringify'
-import { StartParams, Variable } from '@typebot.io/schemas'
+import { StartChatInput, Variable } from '@typebot.io/schemas'
export const prefillVariables = (
variables: Variable[],
- prefilledVariables: NonNullable
+ prefilledVariables: NonNullable
): Variable[] =>
variables.map((variable) => {
const prefilledVariable = prefilledVariables[variable.name]
diff --git a/packages/bot-engine/whatsapp/convertInputToWhatsAppMessage.ts b/packages/bot-engine/whatsapp/convertInputToWhatsAppMessage.ts
index affc20a44f9..524cb0ef80a 100644
--- a/packages/bot-engine/whatsapp/convertInputToWhatsAppMessage.ts
+++ b/packages/bot-engine/whatsapp/convertInputToWhatsAppMessage.ts
@@ -1,4 +1,4 @@
-import { ButtonItem, ChatReply } from '@typebot.io/schemas'
+import { ButtonItem, ContinueChatResponse } from '@typebot.io/schemas'
import { WhatsAppSendingMessage } from '@typebot.io/schemas/features/whatsapp'
import { convertRichTextToWhatsAppText } from './convertRichTextToWhatsAppText'
import { isDefined, isEmpty } from '@typebot.io/lib/utils'
@@ -8,8 +8,8 @@ import { defaultPictureChoiceOptions } from '@typebot.io/schemas/features/blocks
import { defaultChoiceInputOptions } from '@typebot.io/schemas/features/blocks/inputs/choice/constants'
export const convertInputToWhatsAppMessages = (
- input: NonNullable,
- lastMessage: ChatReply['messages'][number] | undefined
+ input: NonNullable,
+ lastMessage: ContinueChatResponse['messages'][number] | undefined
): WhatsAppSendingMessage[] => {
const lastMessageText =
lastMessage?.type === BubbleBlockType.TEXT
diff --git a/packages/bot-engine/whatsapp/convertMessageToWhatsAppMessage.ts b/packages/bot-engine/whatsapp/convertMessageToWhatsAppMessage.ts
index 8f0e18404f4..837e1d618e4 100644
--- a/packages/bot-engine/whatsapp/convertMessageToWhatsAppMessage.ts
+++ b/packages/bot-engine/whatsapp/convertMessageToWhatsAppMessage.ts
@@ -1,4 +1,4 @@
-import { ChatReply } from '@typebot.io/schemas'
+import { ContinueChatResponse } from '@typebot.io/schemas'
import { WhatsAppSendingMessage } from '@typebot.io/schemas/features/whatsapp'
import { convertRichTextToWhatsAppText } from './convertRichTextToWhatsAppText'
import { isSvgSrc } from '@typebot.io/lib/utils'
@@ -8,7 +8,7 @@ import { VideoBubbleContentType } from '@typebot.io/schemas/features/blocks/bubb
const mp4HttpsUrlRegex = /^https:\/\/.*\.mp4$/
export const convertMessageToWhatsAppMessage = (
- message: ChatReply['messages'][number]
+ message: ContinueChatResponse['messages'][number]
): WhatsAppSendingMessage | undefined => {
switch (message.type) {
case BubbleBlockType.TEXT: {
diff --git a/packages/bot-engine/whatsapp/sendChatReplyToWhatsApp.ts b/packages/bot-engine/whatsapp/sendChatReplyToWhatsApp.ts
index 7aa1f68a5ce..bbf7a016fd9 100644
--- a/packages/bot-engine/whatsapp/sendChatReplyToWhatsApp.ts
+++ b/packages/bot-engine/whatsapp/sendChatReplyToWhatsApp.ts
@@ -1,4 +1,8 @@
-import { ChatReply, SessionState, Settings } from '@typebot.io/schemas'
+import {
+ ContinueChatResponse,
+ SessionState,
+ Settings,
+} from '@typebot.io/schemas'
import {
WhatsAppCredentials,
WhatsAppSendingMessage,
@@ -21,7 +25,7 @@ type Props = {
typingEmulation: SessionState['typingEmulation']
credentials: WhatsAppCredentials['data']
state: SessionState
-} & Pick
+} & Pick
export const sendChatReplyToWhatsApp = async ({
to,
@@ -171,7 +175,9 @@ const getTypingDuration = ({
}
}
-const isLastMessageIncludedInInput = (input: ChatReply['input']): boolean => {
+const isLastMessageIncludedInInput = (
+ input: ContinueChatResponse['input']
+): boolean => {
if (isNotDefined(input)) return false
return input.type === InputBlockType.CHOICE
}
@@ -179,7 +185,9 @@ const isLastMessageIncludedInInput = (input: ChatReply['input']): boolean => {
const executeClientSideAction =
(context: { to: string; credentials: WhatsAppCredentials['data'] }) =>
async (
- clientSideAction: NonNullable[number]
+ clientSideAction: NonNullable<
+ ContinueChatResponse['clientSideActions']
+ >[number]
): Promise<{ replyToSend: string | undefined } | void> => {
if ('wait' in clientSideAction) {
await new Promise((resolve) =>
diff --git a/packages/bot-engine/whatsapp/startWhatsAppSession.ts b/packages/bot-engine/whatsapp/startWhatsAppSession.ts
index 51fbd15af75..5ddc765e2f8 100644
--- a/packages/bot-engine/whatsapp/startWhatsAppSession.ts
+++ b/packages/bot-engine/whatsapp/startWhatsAppSession.ts
@@ -1,6 +1,6 @@
import prisma from '@typebot.io/lib/prisma'
import {
- ChatReply,
+ ContinueChatResponse,
PublicTypebot,
SessionState,
Settings,
@@ -20,7 +20,7 @@ import { VisitedEdge } from '@typebot.io/prisma'
type Props = {
incomingMessage?: string
- workspaceId?: string
+ workspaceId: string
credentials: WhatsAppCredentials['data'] & Pick
contact: NonNullable['contact']
}
@@ -31,7 +31,7 @@ export const startWhatsAppSession = async ({
credentials,
contact,
}: Props): Promise<
- | (ChatReply & {
+ | (ContinueChatResponse & {
newSessionState: SessionState
visitedEdges: VisitedEdge[]
})
@@ -89,9 +89,10 @@ export const startWhatsAppSession = async ({
version: 2,
message: incomingMessage,
startParams: {
- typebot: publicTypebot.typebot.publicId as string,
+ type: 'live',
+ publicId: publicTypebot.typebot.publicId as string,
+ isOnlyRegistering: false,
},
- userId: undefined,
initialSessionState: {
whatsApp: {
contact,
diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json
index daa7e81cf89..b21fc36a173 100644
--- a/packages/embeds/js/package.json
+++ b/packages/embeds/js/package.json
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
- "version": "0.2.15",
+ "version": "0.2.16",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
diff --git a/packages/embeds/js/src/components/Bot.tsx b/packages/embeds/js/src/components/Bot.tsx
index 005a8618622..5d621e58e84 100644
--- a/packages/embeds/js/src/components/Bot.tsx
+++ b/packages/embeds/js/src/components/Bot.tsx
@@ -1,7 +1,7 @@
import { LiteBadge } from './LiteBadge'
import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js'
import { isNotDefined, isNotEmpty } from '@typebot.io/lib'
-import { getInitialChatReplyQuery } from '@/queries/getInitialChatReplyQuery'
+import { startChatQuery } from '@/queries/startChatQuery'
import { ConversationContainer } from './ConversationContainer'
import { setIsMobile } from '@/utils/isMobileSignal'
import { BotContext, InitialChatReply, OutgoingLog } from '@/types'
@@ -12,7 +12,8 @@ import {
} from '@/utils/storage'
import { setCssVariablesValue } from '@/utils/setCssVariablesValue'
import immutableCss from '../assets/immutable.css'
-import { InputBlock, StartElementId } from '@typebot.io/schemas'
+import { InputBlock } from '@typebot.io/schemas'
+import { StartFrom } from '@typebot.io/schemas'
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
export type BotProps = {
@@ -27,7 +28,8 @@ export type BotProps = {
onInit?: () => void
onEnd?: () => void
onNewLogs?: (logs: OutgoingLog[]) => void
-} & StartElementId
+ startFrom?: StartFrom
+}
export const Bot = (props: BotProps & { class?: string }) => {
const [initialChatReply, setInitialChatReply] = createSignal<
@@ -47,11 +49,13 @@ export const Bot = (props: BotProps & { class?: string }) => {
})
const typebotIdFromProps =
typeof props.typebot === 'string' ? props.typebot : undefined
- const { data, error } = await getInitialChatReplyQuery({
+ const isPreview =
+ typeof props.typebot !== 'string' || (props.isPreview ?? false)
+ const { data, error } = await startChatQuery({
stripeRedirectStatus: urlParams.get('redirect_status') ?? undefined,
typebot: props.typebot,
apiHost: props.apiHost,
- isPreview: props.isPreview ?? false,
+ isPreview,
resultId: isNotEmpty(props.resultId)
? props.resultId
: getExistingResultIdFromStorage(typebotIdFromProps),
@@ -59,14 +63,10 @@ export const Bot = (props: BotProps & { class?: string }) => {
...prefilledVariables,
...props.prefilledVariables,
},
- ...('startGroupId' in props
- ? { startGroupId: props.startGroupId }
- : 'startEventId' in props
- ? { startEventId: props.startEventId }
- : {}),
+ startFrom: props.startFrom,
})
if (error && 'code' in error && typeof error.code === 'string') {
- if (typeof props.typebot !== 'string' || (props.isPreview ?? false)) {
+ if (isPreview) {
return setError(
new Error('An error occurred while loading the bot.', {
cause: error.message,
diff --git a/packages/embeds/js/src/components/ConversationContainer/ChatChunk.tsx b/packages/embeds/js/src/components/ConversationContainer/ChatChunk.tsx
index 0031be14c28..82654983bbd 100644
--- a/packages/embeds/js/src/components/ConversationContainer/ChatChunk.tsx
+++ b/packages/embeds/js/src/components/ConversationContainer/ChatChunk.tsx
@@ -1,6 +1,6 @@
import { BotContext, ChatChunk as ChatChunkType } from '@/types'
import { isMobile } from '@/utils/isMobileSignal'
-import { ChatReply, Settings, Theme } from '@typebot.io/schemas'
+import { ContinueChatResponse, Settings, Theme } from '@typebot.io/schemas'
import { createSignal, For, onMount, Show } from 'solid-js'
import { HostBubble } from '../bubbles/HostBubble'
import { InputChatBlock } from '../InputChatBlock'
@@ -9,7 +9,7 @@ import { StreamingBubble } from '../bubbles/StreamingBubble'
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
import { defaultSettings } from '@typebot.io/schemas/features/typebot/settings/constants'
-type Props = Pick & {
+type Props = Pick & {
theme: Theme
settings: Settings
inputIndex: number
diff --git a/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx b/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx
index 55d35b52733..cb040f733fb 100644
--- a/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx
+++ b/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx
@@ -1,8 +1,8 @@
import {
- ChatReply,
+ ContinueChatResponse,
InputBlock,
- SendMessageInput,
Theme,
+ ChatLog,
} from '@typebot.io/schemas'
import {
createEffect,
@@ -12,7 +12,7 @@ import {
onMount,
Show,
} from 'solid-js'
-import { sendMessageQuery } from '@/queries/sendMessageQuery'
+import { continueChatQuery } from '@/queries/continueChatQuery'
import { ChatChunk } from './ChatChunk'
import {
BotContext,
@@ -30,10 +30,11 @@ import {
setFormattedMessages,
} from '@/utils/formattedMessagesSignal'
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants'
+import { saveClientLogsQuery } from '@/queries/saveClientLogsQuery'
const parseDynamicTheme = (
initialTheme: Theme,
- dynamicTheme: ChatReply['dynamicTheme']
+ dynamicTheme: ContinueChatResponse['dynamicTheme']
): Theme => ({
...initialTheme,
chat: {
@@ -74,7 +75,7 @@ export const ConversationContainer = (props: Props) => {
},
])
const [dynamicTheme, setDynamicTheme] = createSignal<
- ChatReply['dynamicTheme']
+ ContinueChatResponse['dynamicTheme']
>(props.initialChatReply.dynamicTheme)
const [theme, setTheme] = createSignal(props.initialChatReply.typebot.theme)
const [isSending, setIsSending] = createSignal(false)
@@ -136,9 +137,16 @@ export const ConversationContainer = (props: Props) => {
const sendMessage = async (
message: string | undefined,
- clientLogs?: SendMessageInput['clientLogs']
+ clientLogs?: ChatLog[]
) => {
- if (clientLogs) props.onNewLogs?.(clientLogs)
+ if (clientLogs) {
+ props.onNewLogs?.(clientLogs)
+ await saveClientLogsQuery({
+ apiHost: props.context.apiHost,
+ sessionId: props.initialChatReply.sessionId,
+ clientLogs,
+ })
+ }
setHasError(false)
const currentInputBlock = [...chatChunks()].pop()?.input
if (currentInputBlock?.id && props.onAnswer && message)
@@ -153,11 +161,10 @@ export const ConversationContainer = (props: Props) => {
const longRequest = setTimeout(() => {
setIsSending(true)
}, 1000)
- const { data, error } = await sendMessageQuery({
+ const { data, error } = await continueChatQuery({
apiHost: props.context.apiHost,
sessionId: props.initialChatReply.sessionId,
message,
- clientLogs,
})
clearTimeout(longRequest)
setIsSending(false)
diff --git a/packages/embeds/js/src/components/InputChatBlock.tsx b/packages/embeds/js/src/components/InputChatBlock.tsx
index 61c133e3740..6e3c4cb2c2b 100644
--- a/packages/embeds/js/src/components/InputChatBlock.tsx
+++ b/packages/embeds/js/src/components/InputChatBlock.tsx
@@ -1,5 +1,5 @@
import type {
- ChatReply,
+ ContinueChatResponse,
ChoiceInputBlock,
EmailInputBlock,
FileInputBlock,
@@ -39,7 +39,7 @@ import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constan
type Props = {
ref: HTMLDivElement | undefined
- block: NonNullable
+ block: NonNullable
hasHostAvatar: boolean
guestAvatar?: NonNullable['guestAvatar']
inputIndex: number
@@ -113,7 +113,7 @@ export const InputChatBlock = (props: Props) => {
const Input = (props: {
context: BotContext
- block: NonNullable
+ block: NonNullable
inputIndex: number
isInputPrefillEnabled: boolean
onSubmit: (answer: InputSubmitContent) => void
@@ -252,11 +252,11 @@ const Input = (props: {
}
const isButtonsBlock = (
- block: ChatReply['input']
+ block: ContinueChatResponse['input']
): ChoiceInputBlock | undefined =>
block?.type === InputBlockType.CHOICE ? block : undefined
const isPictureChoiceBlock = (
- block: ChatReply['input']
+ block: ContinueChatResponse['input']
): PictureChoiceBlock | undefined =>
block?.type === InputBlockType.PICTURE_CHOICE ? block : undefined
diff --git a/packages/embeds/js/src/constants.ts b/packages/embeds/js/src/constants.ts
index 8467512eefc..34d7f0d1ded 100644
--- a/packages/embeds/js/src/constants.ts
+++ b/packages/embeds/js/src/constants.ts
@@ -10,7 +10,7 @@ export const defaultBotProps: BotProps = {
onInit: undefined,
onNewLogs: undefined,
isPreview: undefined,
- startGroupId: undefined,
+ startFrom: undefined,
prefilledVariables: undefined,
apiHost: undefined,
resultId: undefined,
diff --git a/packages/embeds/js/src/queries/continueChatQuery.ts b/packages/embeds/js/src/queries/continueChatQuery.ts
new file mode 100644
index 00000000000..04264b78cb8
--- /dev/null
+++ b/packages/embeds/js/src/queries/continueChatQuery.ts
@@ -0,0 +1,22 @@
+import { guessApiHost } from '@/utils/guessApiHost'
+import { isNotEmpty, sendRequest } from '@typebot.io/lib'
+import { ContinueChatResponse } from '@typebot.io/schemas'
+
+export const continueChatQuery = ({
+ apiHost,
+ message,
+ sessionId,
+}: {
+ apiHost?: string
+ message: string | undefined
+ sessionId: string
+}) =>
+ sendRequest({
+ method: 'POST',
+ url: `${
+ isNotEmpty(apiHost) ? apiHost : guessApiHost()
+ }/api/v1/sessions/${sessionId}/continueChat`,
+ body: {
+ message,
+ },
+ })
diff --git a/packages/embeds/js/src/queries/getInitialChatReplyQuery.ts b/packages/embeds/js/src/queries/getInitialChatReplyQuery.ts
deleted file mode 100644
index ef34eb41a61..00000000000
--- a/packages/embeds/js/src/queries/getInitialChatReplyQuery.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { BotContext, InitialChatReply } from '@/types'
-import { guessApiHost } from '@/utils/guessApiHost'
-import type {
- SendMessageInput,
- StartElementId,
- StartParams,
-} from '@typebot.io/schemas'
-import { isNotDefined, isNotEmpty, sendRequest } from '@typebot.io/lib'
-import {
- getPaymentInProgressInStorage,
- removePaymentInProgressFromStorage,
-} from '@/features/blocks/inputs/payment/helpers/paymentInProgressStorage'
-
-export async function getInitialChatReplyQuery({
- typebot,
- isPreview,
- apiHost,
- prefilledVariables,
- resultId,
- stripeRedirectStatus,
- ...props
-}: StartParams & {
- stripeRedirectStatus?: string
- apiHost?: string
-} & StartElementId) {
- if (isNotDefined(typebot))
- throw new Error('Typebot ID is required to get initial messages')
-
- const paymentInProgressStateStr = getPaymentInProgressInStorage() ?? undefined
- const paymentInProgressState = paymentInProgressStateStr
- ? (JSON.parse(paymentInProgressStateStr) as {
- sessionId: string
- typebot: BotContext['typebot']
- })
- : undefined
- if (paymentInProgressState) removePaymentInProgressFromStorage()
- const { data, error } = await sendRequest({
- method: 'POST',
- url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v2/sendMessage`,
- body: {
- startParams: paymentInProgressState
- ? undefined
- : {
- isPreview,
- typebot,
- prefilledVariables,
- resultId,
- isStreamEnabled: true,
- startGroupId:
- 'startGroupId' in props ? props.startGroupId : undefined,
- startEventId:
- 'startEventId' in props ? props.startEventId : undefined,
- },
- sessionId: paymentInProgressState?.sessionId,
- message: paymentInProgressState
- ? stripeRedirectStatus === 'failed'
- ? 'fail'
- : 'Success'
- : undefined,
- } satisfies SendMessageInput,
- })
-
- return {
- data: data
- ? {
- ...data,
- ...(paymentInProgressState
- ? { typebot: paymentInProgressState.typebot }
- : {}),
- }
- : undefined,
- error,
- }
-}
diff --git a/packages/embeds/js/src/queries/saveClientLogsQuery.ts b/packages/embeds/js/src/queries/saveClientLogsQuery.ts
new file mode 100644
index 00000000000..47627da99c9
--- /dev/null
+++ b/packages/embeds/js/src/queries/saveClientLogsQuery.ts
@@ -0,0 +1,22 @@
+import { guessApiHost } from '@/utils/guessApiHost'
+import type { ChatLog } from '@typebot.io/schemas'
+import { isNotEmpty, sendRequest } from '@typebot.io/lib'
+
+export const saveClientLogsQuery = ({
+ apiHost,
+ sessionId,
+ clientLogs,
+}: {
+ apiHost?: string
+ sessionId: string
+ clientLogs: ChatLog[]
+}) =>
+ sendRequest({
+ method: 'POST',
+ url: `${
+ isNotEmpty(apiHost) ? apiHost : guessApiHost()
+ }/api/v1/sessions/${sessionId}/clientLogs`,
+ body: {
+ clientLogs,
+ },
+ })
diff --git a/packages/embeds/js/src/queries/sendMessageQuery.ts b/packages/embeds/js/src/queries/sendMessageQuery.ts
deleted file mode 100644
index f5a74533e67..00000000000
--- a/packages/embeds/js/src/queries/sendMessageQuery.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { guessApiHost } from '@/utils/guessApiHost'
-import type { ChatReply, SendMessageInput } from '@typebot.io/schemas'
-import { isNotEmpty, sendRequest } from '@typebot.io/lib'
-
-export const sendMessageQuery = ({
- apiHost,
- ...body
-}: SendMessageInput & { apiHost?: string }) =>
- sendRequest({
- method: 'POST',
- url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v2/sendMessage`,
- body,
- })
diff --git a/packages/embeds/js/src/queries/startChatQuery.ts b/packages/embeds/js/src/queries/startChatQuery.ts
new file mode 100644
index 00000000000..6b06bc04b1c
--- /dev/null
+++ b/packages/embeds/js/src/queries/startChatQuery.ts
@@ -0,0 +1,104 @@
+import { BotContext, InitialChatReply } from '@/types'
+import { guessApiHost } from '@/utils/guessApiHost'
+import { isNotDefined, isNotEmpty, sendRequest } from '@typebot.io/lib'
+import {
+ getPaymentInProgressInStorage,
+ removePaymentInProgressFromStorage,
+} from '@/features/blocks/inputs/payment/helpers/paymentInProgressStorage'
+import {
+ StartChatInput,
+ StartFrom,
+ StartPreviewChatInput,
+} from '@typebot.io/schemas'
+
+export async function startChatQuery({
+ typebot,
+ isPreview,
+ apiHost,
+ prefilledVariables,
+ resultId,
+ stripeRedirectStatus,
+ startFrom,
+}: {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ typebot: string | any
+ stripeRedirectStatus?: string
+ apiHost?: string
+ startFrom?: StartFrom
+ isPreview: boolean
+ prefilledVariables?: Record
+ resultId?: string
+}) {
+ if (isNotDefined(typebot))
+ throw new Error('Typebot ID is required to get initial messages')
+
+ const paymentInProgressStateStr = getPaymentInProgressInStorage() ?? undefined
+ const paymentInProgressState = paymentInProgressStateStr
+ ? (JSON.parse(paymentInProgressStateStr) as {
+ sessionId: string
+ typebot: BotContext['typebot']
+ })
+ : undefined
+ if (paymentInProgressState) {
+ removePaymentInProgressFromStorage()
+ const { data, error } = await sendRequest({
+ method: 'POST',
+ url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v1/sessions/${
+ paymentInProgressState.sessionId
+ }/continueChat`,
+ body: {
+ message: paymentInProgressState
+ ? stripeRedirectStatus === 'failed'
+ ? 'fail'
+ : 'Success'
+ : undefined,
+ },
+ })
+ return {
+ data: data
+ ? {
+ ...data,
+ ...(paymentInProgressState
+ ? { typebot: paymentInProgressState.typebot }
+ : {}),
+ }
+ : undefined,
+ error,
+ }
+ }
+ const typebotId = typeof typebot === 'string' ? typebot : typebot.id
+ if (isPreview) {
+ const { data, error } = await sendRequest({
+ method: 'POST',
+ url: `${
+ isNotEmpty(apiHost) ? apiHost : guessApiHost()
+ }/api/v1/typebots/${typebotId}/preview/startChat`,
+ body: {
+ isStreamEnabled: true,
+ startFrom,
+ typebot,
+ } satisfies Omit,
+ })
+ return {
+ data,
+ error,
+ }
+ }
+
+ const { data, error } = await sendRequest({
+ method: 'POST',
+ url: `${
+ isNotEmpty(apiHost) ? apiHost : guessApiHost()
+ }/api/v1/typebots/${typebotId}/startChat`,
+ body: {
+ isStreamEnabled: true,
+ prefilledVariables,
+ resultId,
+ } satisfies Omit,
+ })
+
+ return {
+ data,
+ error,
+ }
+}
diff --git a/packages/embeds/js/src/types.ts b/packages/embeds/js/src/types.ts
index eafc80c8938..dba617d03cc 100644
--- a/packages/embeds/js/src/types.ts
+++ b/packages/embeds/js/src/types.ts
@@ -1,4 +1,4 @@
-import type { ChatReply } from '@typebot.io/schemas'
+import { ContinueChatResponse, StartChatResponse } from '@typebot.io/schemas'
export type InputSubmitContent = {
label?: string
@@ -13,9 +13,9 @@ export type BotContext = {
sessionId: string
}
-export type InitialChatReply = ChatReply & {
- typebot: NonNullable
- sessionId: NonNullable
+export type InitialChatReply = StartChatResponse & {
+ typebot: NonNullable
+ sessionId: NonNullable
}
export type OutgoingLog = {
@@ -30,7 +30,7 @@ export type ClientSideActionContext = {
}
export type ChatChunk = Pick<
- ChatReply,
+ ContinueChatResponse,
'messages' | 'input' | 'clientSideActions'
> & {
streamingMessageId?: string
diff --git a/packages/embeds/js/src/utils/executeClientSideActions.ts b/packages/embeds/js/src/utils/executeClientSideActions.ts
index 37a188b6c16..e5c36edb347 100644
--- a/packages/embeds/js/src/utils/executeClientSideActions.ts
+++ b/packages/embeds/js/src/utils/executeClientSideActions.ts
@@ -8,11 +8,11 @@ import { executeWait } from '@/features/blocks/logic/wait/utils/executeWait'
import { executeWebhook } from '@/features/blocks/integrations/webhook/executeWebhook'
import { executePixel } from '@/features/blocks/integrations/pixel/executePixel'
import { ClientSideActionContext } from '@/types'
-import type { ChatReply, ReplyLog } from '@typebot.io/schemas'
+import type { ContinueChatResponse, ChatLog } from '@typebot.io/schemas'
import { injectStartProps } from './injectStartProps'
type Props = {
- clientSideAction: NonNullable[0]
+ clientSideAction: NonNullable[0]
context: ClientSideActionContext
onMessageStream?: (props: { id: string; message: string }) => void
}
@@ -23,7 +23,7 @@ export const executeClientSideAction = async ({
onMessageStream,
}: Props): Promise<
| { blockedPopupUrl: string }
- | { replyToSend: string | undefined; logs?: ReplyLog[] }
+ | { replyToSend: string | undefined; logs?: ChatLog[] }
| void
> => {
if ('chatwoot' in clientSideAction) {
diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json
index 05add6b6180..d5eba33763a 100644
--- a/packages/embeds/nextjs/package.json
+++ b/packages/embeds/nextjs/package.json
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
- "version": "0.2.15",
+ "version": "0.2.16",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json
index b7eeebe8082..26fd6ba1a5d 100644
--- a/packages/embeds/react/package.json
+++ b/packages/embeds/react/package.json
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
- "version": "0.2.15",
+ "version": "0.2.16",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/apps/builder/src/features/auth/mockedUser.ts b/packages/lib/mockedUser.ts
similarity index 100%
rename from apps/builder/src/features/auth/mockedUser.ts
rename to packages/lib/mockedUser.ts
diff --git a/packages/schemas/features/chat/legacy/schema.ts b/packages/schemas/features/chat/legacy/schema.ts
new file mode 100644
index 00000000000..a24e590ecab
--- /dev/null
+++ b/packages/schemas/features/chat/legacy/schema.ts
@@ -0,0 +1,123 @@
+import { z } from 'zod'
+import {
+ chatLogSchema,
+ chatMessageSchema,
+ clientSideActionSchema,
+ runtimeOptionsSchema,
+ startTypebotSchema,
+} from '../schema'
+import { typebotV5Schema, typebotV6Schema } from '../../typebot'
+import { dynamicThemeSchema } from '../shared'
+import { inputBlockSchemas } from '../../blocks'
+
+export const startElementIdSchema = z.union([
+ z.object({
+ startGroupId: z.string().describe('Start chat from a specific group.'),
+ startEventId: z.never().optional(),
+ }),
+ z.object({
+ startEventId: z.string().describe('Start chat from a specific event.'),
+ startGroupId: z.never().optional(),
+ }),
+ z.object({}),
+])
+export type StartElementId = z.infer
+
+const startParamsSchema = z
+ .object({
+ typebot: startTypebotSchema
+ .or(z.string())
+ .describe(
+ 'Either a Typebot ID or a Typebot object. If you provide a Typebot object, it will be executed in preview mode. ([How can I find my typebot ID?](https://docs.typebot.io/api#how-to-find-my-typebotid)).'
+ ),
+ isPreview: z
+ .boolean()
+ .optional()
+ .describe(
+ "If set to `true`, it will start a Preview session with the unpublished bot and it won't be saved in the Results tab. You need to be authenticated with a bearer token for this to work."
+ ),
+ resultId: z
+ .string()
+ .optional()
+ .describe("Provide it if you'd like to overwrite an existing result."),
+
+ prefilledVariables: z
+ .record(z.unknown())
+ .optional()
+ .describe(
+ '[More info about prefilled variables.](https://docs.typebot.io/editor/variables#prefilled-variables)'
+ ),
+ isStreamEnabled: z
+ .boolean()
+ .optional()
+ .describe(
+ 'Set this to `true` if you intend to stream OpenAI completions on a client.'
+ ),
+ isOnlyRegistering: z
+ .boolean()
+ .optional()
+ .describe(
+ 'If set to `true`, it will only register the session and not start the chat. This is used for other chat platform integration as it can require a session to be registered before sending the first message.'
+ ),
+ })
+ .and(startElementIdSchema)
+
+export const sendMessageInputSchema = z.object({
+ message: z
+ .string()
+ .optional()
+ .describe(
+ 'The answer to the previous chat input. Do not provide it if you are starting a new chat.'
+ ),
+ sessionId: z
+ .string()
+ .optional()
+ .describe(
+ 'Session ID that you get from the initial chat request to a bot. If not provided, it will create a new session.'
+ ),
+ startParams: startParamsSchema.optional(),
+ clientLogs: z
+ .array(chatLogSchema)
+ .optional()
+ .describe('Logs while executing client side actions'),
+})
+
+export const chatReplySchema = z.object({
+ messages: z.array(chatMessageSchema),
+ input: z
+ .union([
+ z.discriminatedUnion('type', [...inputBlockSchemas.v5]),
+ z.discriminatedUnion('type', [...inputBlockSchemas.v6]),
+ ])
+ .and(
+ z.object({
+ prefilledValue: z.string().optional(),
+ runtimeOptions: runtimeOptionsSchema.optional(),
+ })
+ )
+ .optional(),
+ clientSideActions: z.array(clientSideActionSchema).optional(),
+ sessionId: z.string().optional(),
+ typebot: z
+ .object({
+ id: z.string(),
+ theme: z.union([
+ typebotV5Schema._def.schema.shape.theme,
+ typebotV6Schema.shape.theme,
+ ]),
+ settings: z.union([
+ typebotV5Schema._def.schema.shape.settings,
+ typebotV6Schema.shape.settings,
+ ]),
+ })
+ .optional(),
+ resultId: z.string().optional(),
+ dynamicTheme: dynamicThemeSchema.optional(),
+ logs: z.array(chatLogSchema).optional(),
+ lastMessageNewFormat: z
+ .string()
+ .optional()
+ .describe(
+ 'The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version.'
+ ),
+})
diff --git a/packages/schemas/features/chat/schema.ts b/packages/schemas/features/chat/schema.ts
index b70c91863f4..4a4e11a781b 100644
--- a/packages/schemas/features/chat/schema.ts
+++ b/packages/schemas/features/chat/schema.ts
@@ -29,6 +29,7 @@ const chatSessionSchema = z.object({
updatedAt: z.date(),
state: sessionStateSchema,
})
+export type ChatSession = z.infer
const textMessageSchema = z.object({
type: z.literal(BubbleBlockType.TEXT),
@@ -59,7 +60,7 @@ const embedMessageSchema = z.object({
.merge(z.object({ height: z.number().optional() })),
})
-const chatMessageSchema = z
+export const chatMessageSchema = z
.object({ id: z.string() })
.and(
z.discriminatedUnion('type', [
@@ -70,6 +71,7 @@ const chatMessageSchema = z
embedMessageSchema,
])
)
+export type ChatMessage = z.infer
const scriptToExecuteSchema = z.object({
content: z.string(),
@@ -85,6 +87,7 @@ const scriptToExecuteSchema = z.object({
})
),
})
+export type ScriptToExecute = z.infer
const startTypebotPick = {
version: true,
@@ -103,87 +106,72 @@ export const startTypebotSchema = z.preprocess(
typebotV6Schema.pick(startTypebotPick),
])
)
+export type StartTypebot = z.infer
-export const startElementIdSchema = z.union([
- z.object({
- startGroupId: z.string().describe('Start chat from a specific group.'),
- startEventId: z.never().optional(),
- }),
- z.object({
- startEventId: z.string().describe('Start chat from a specific event.'),
- startGroupId: z.never().optional(),
- }),
- z.object({}),
-])
-export type StartElementId = z.infer
-
-const startParamsSchema = z
- .object({
- typebot: startTypebotSchema
- .or(z.string())
- .describe(
- 'Either a Typebot ID or a Typebot object. If you provide a Typebot object, it will be executed in preview mode. ([How can I find my typebot ID?](https://docs.typebot.io/api#how-to-find-my-typebotid)).'
- ),
- isPreview: z
- .boolean()
- .optional()
- .describe(
- "If set to `true`, it will start a Preview session with the unpublished bot and it won't be saved in the Results tab. You need to be authenticated with a bearer token for this to work."
- ),
- resultId: z
- .string()
- .optional()
- .describe("Provide it if you'd like to overwrite an existing result."),
-
- prefilledVariables: z
- .record(z.unknown())
- .optional()
- .describe(
- '[More info about prefilled variables.](https://docs.typebot.io/editor/variables#prefilled-variables)'
- ),
- isStreamEnabled: z
- .boolean()
- .optional()
- .describe(
- 'Set this to `true` if you intend to stream OpenAI completions on a client.'
- ),
- isOnlyRegistering: z
- .boolean()
- .optional()
- .describe(
- 'If set to `true`, it will only register the session and not start the chat. This is used for other chat platform integration as it can require a session to be registered before sending the first message.'
- ),
- })
- .and(startElementIdSchema)
-
-const replyLogSchema = logSchema
+export const chatLogSchema = logSchema
.pick({
status: true,
description: true,
})
.merge(z.object({ details: z.unknown().optional() }))
+export type ChatLog = z.infer
-export const sendMessageInputSchema = z.object({
- message: z
+export const startChatInputSchema = z.object({
+ publicId: z.string(),
+ isStreamEnabled: z.boolean().optional(),
+ message: z.string().optional(),
+ resultId: z
.string()
.optional()
+ .describe("Provide it if you'd like to overwrite an existing result."),
+ isOnlyRegistering: z
+ .boolean()
+ .optional()
.describe(
- 'The answer to the previous chat input. Do not provide it if you are starting a new chat.'
+ '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.'
),
- sessionId: z
- .string()
+ prefilledVariables: z
+ .record(z.unknown())
.optional()
.describe(
- 'Session ID that you get from the initial chat request to a bot. If not provided, it will create a new session.'
+ '[More info about prefilled variables.](https://docs.typebot.io/editor/variables#prefilled-variables)'
),
- startParams: startParamsSchema.optional(),
- clientLogs: z
- .array(replyLogSchema)
+})
+export type StartChatInput = z.infer
+
+export const startFromSchema = z.discriminatedUnion('type', [
+ z.object({
+ type: z.literal('group'),
+ groupId: z.string(),
+ }),
+ z.object({
+ type: z.literal('event'),
+ eventId: z.string(),
+ }),
+])
+export type StartFrom = z.infer
+
+export const startPreviewChatInputSchema = z.object({
+ typebotId: z.string(),
+ isStreamEnabled: z.boolean().optional(),
+ message: z.string().optional(),
+ isOnlyRegistering: z
+ .boolean()
+ .optional()
+ .describe(
+ '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.'
+ ),
+ typebot: startTypebotSchema
.optional()
- .describe('Logs while executing client side actions'),
+ .describe(
+ 'If set, it will override the typebot that is used to start the chat.'
+ ),
+ startFrom: startFromSchema.optional(),
})
+export type StartPreviewChatInput = z.infer
-const runtimeOptionsSchema = paymentInputRuntimeOptionsSchema.optional()
+export const runtimeOptionsSchema = paymentInputRuntimeOptionsSchema.optional()
+export type RuntimeOptions = z.infer
const startPropsToInjectSchema = z.object({
googleAnalyticsId: z.string().optional(),
@@ -191,8 +179,9 @@ const startPropsToInjectSchema = z.object({
gtmId: z.string().optional(),
customHeadCode: z.string().optional(),
})
+export type StartPropsToInject = z.infer
-const clientSideActionSchema = z
+export const clientSideActionSchema = z
.object({
lastBubbleBlockId: z.string().optional(),
expectsDedicatedReply: z.boolean().optional(),
@@ -271,7 +260,14 @@ export const typebotInChatReply = z.preprocess(
typebotV6Schema.pick(typebotInChatReplyPick),
])
)
-export const chatReplySchema = z.object({
+
+const chatResponseBaseSchema = z.object({
+ lastMessageNewFormat: z
+ .string()
+ .optional()
+ .describe(
+ 'The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version.'
+ ),
messages: z.array(chatMessageSchema),
input: z
.union([
@@ -286,39 +282,30 @@ export const chatReplySchema = z.object({
)
.optional(),
clientSideActions: z.array(clientSideActionSchema).optional(),
+ logs: z.array(chatLogSchema).optional(),
+ dynamicTheme: dynamicThemeSchema.optional(),
+})
+
+export const startChatResponseSchema = chatResponseBaseSchema.extend({
sessionId: z.string().optional(),
- typebot: z
- .object({
- id: z.string(),
- theme: z.union([
- typebotV5Schema._def.schema.shape.theme,
- typebotV6Schema.shape.theme,
- ]),
- settings: z.union([
- typebotV5Schema._def.schema.shape.settings,
- typebotV6Schema.shape.settings,
- ]),
- })
- .optional(),
+ typebot: z.object({
+ id: z.string(),
+ theme: z.union([
+ typebotV5Schema._def.schema.shape.theme,
+ typebotV6Schema.shape.theme,
+ ]),
+ settings: z.union([
+ typebotV5Schema._def.schema.shape.settings,
+ typebotV6Schema.shape.settings,
+ ]),
+ }),
resultId: z.string().optional(),
- dynamicTheme: dynamicThemeSchema.optional(),
- logs: z.array(replyLogSchema).optional(),
- lastMessageNewFormat: z
- .string()
- .optional()
- .describe(
- 'The sent message is validated and formatted on the backend. This is set only if the message differs from the formatted version.'
- ),
})
+export type StartChatResponse = z.infer
-export type ChatSession = z.infer
+export const startPreviewChatResponseSchema = startChatResponseSchema.omit({
+ resultId: true,
+})
-export type ChatReply = z.infer
-export type ChatMessage = z.infer
-export type SendMessageInput = z.infer
-export type ScriptToExecute = z.infer
-export type StartParams = z.infer
-export type RuntimeOptions = z.infer
-export type StartTypebot = z.infer
-export type ReplyLog = z.infer
-export type StartPropsToInject = z.infer
+export const continueChatResponseSchema = chatResponseBaseSchema
+export type ContinueChatResponse = z.infer