Chatbot Steps
The ID of the chatbot.
The ID of the flows.
List of all Steps.
Optional error message.
Insufficient permissions.
GET /v1/chatbots/{chatbotId}/flows/{flowId}/steps HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Accept: */*
{
"steps": [
{
"id": "step123",
"name": "Welcome Message",
"created": "2023-01-01T12:00:00Z",
"updated": "2023-01-01T12:30:00Z",
"type": "message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"intent": {
"intentId": "t8gsDajqeJAVMZQPB5mp"
},
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"trigger": {
"triggerId": "gVh98q1ILzabR51miQbH",
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "redirectStep456",
"userInput": "Please enter your name.",
"userInputRequired": true,
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"description": "This step greets the user and asks for their name.",
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"userInputIsSensitive": false,
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
}
],
"error": "text"
}The ID of the chatbot.
The ID of the flows.
The name of the step.
Initial GreetingThe type of the step.
messageOptional step ID to redirect to.
redirectStepABCAn optional description for the step.
This step welcomes the user.Step created successfully.
Invalid input data.
Insufficient permissions.
POST /v1/chatbots/{chatbotId}/flows/{flowId}/steps HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 4150
{
"name": "Initial Greeting",
"type": "message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"trigger": {
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "redirectStepABC",
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"description": "This step welcomes the user.",
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"conversationData": {
"name": "Customer request",
"language": "DE"
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
}{
"step": {
"id": "step123",
"name": "Welcome Message",
"created": "2023-01-01T12:00:00Z",
"updated": "2023-01-01T12:30:00Z",
"type": "message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"intent": {
"intentId": "t8gsDajqeJAVMZQPB5mp"
},
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"trigger": {
"triggerId": "gVh98q1ILzabR51miQbH",
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "redirectStep456",
"userInput": "Please enter your name.",
"userInputRequired": true,
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"description": "This step greets the user and asks for their name.",
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"userInputIsSensitive": false,
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
}
}The ID of the chatbot.
The ID of the flows.
The ID of the step to retrieve.
Details of the step.
Optional error message.
Insufficient permissions.
GET /v1/chatbots/{chatbotId}/flows/{flowId}/steps/{stepId} HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Accept: */*
{
"step": {
"id": "step123",
"name": "Welcome Message",
"created": "2023-01-01T12:00:00Z",
"updated": "2023-01-01T12:30:00Z",
"type": "message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"intent": {
"intentId": "t8gsDajqeJAVMZQPB5mp"
},
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"trigger": {
"triggerId": "gVh98q1ILzabR51miQbH",
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "redirectStep456",
"userInput": "Please enter your name.",
"userInputRequired": true,
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"description": "This step greets the user and asks for their name.",
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"userInputIsSensitive": false,
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
},
"error": "text"
}The ID of the chatbot.
The ID of the flows.
The ID of the step to delete.
Result of the deletion process.
Indicates if the step was successfully deleted.
trueOptional error message.
Insufficient permissions.
DELETE /v1/chatbots/{chatbotId}/flows/{flowId}/steps/{stepId} HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Accept: */*
{
"deleted": true,
"error": "text"
}The ID of the chatbot.
The ID of the flows.
The ID of the step to update.
The new name of the step.
Updated Welcome MessageOptional step ID to redirect to.
flowId/stepIdOptional user input redirect.
flowId/stepId.Whether user input is required for this step.
falseAn optional description for the step.
This step updates user information.Whether user input in this step is sensitive.
trueStep updated successfully.
Invalid input data.
Insufficient permissions.
PATCH /v1/chatbots/{chatbotId}/flows/{flowId}/steps/{stepId} HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 4273
{
"name": "Updated Welcome Message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"trigger": {
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "flowId/stepId",
"userInput": "flowId/stepId.",
"userInputRequired": false,
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"description": "This step updates user information.",
"userInputIsSensitive": true,
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"intent": {
"intentId": "t8gsDajqeJAVMZQPB5mp"
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"conversationData": {
"name": "Customer request",
"language": "DE"
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
}{
"step": {
"id": "step123",
"name": "Welcome Message",
"created": "2023-01-01T12:00:00Z",
"updated": "2023-01-01T12:30:00Z",
"type": "message",
"grid": {
"x": 100,
"y": 200
},
"elements": [
{
"type": "text",
"content": {
"text": {
"text": {
"DE": "Hallo Welt!",
"EN-GB": "Hello World!"
}
},
"buttons": {
"buttons": [
{
"text": {
"de": "Ja",
"en": "Yes"
},
"value": "flow_123/step_456",
"type": "redirect",
"payload": "BUTTON_CLICKED"
}
]
},
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"voiceHangup": {
"reason": "user_disconnected",
"headers": {
"X-Reason-Code": "1001"
}
},
"voiceTransfer": {
"target": "+1234567890",
"reason": "agent_transfer",
"headers": {
"X-Transfer-ID": "abc-123"
}
},
"agentHandover": {
"reason": "escalation",
"timeoutSeconds": 60,
"agentId": "agent987",
"groupId": "support_team",
"assignmentMethod": "round_robin"
},
"assignVariable": {
"variableId": "varUserQuery",
"path": "$.data.query",
"value": "What is your return policy?"
},
"updateTags": {
"method": "add",
"tagId": "tag_vip_customer"
},
"snooze": {
"seconds": 3600
},
"unread": {
"unread": true
},
"whatsappTemplate": {
"templateId": "template_order_update",
"parameters": {
"customer_name": "John Doe",
"order_id": "12345"
}
},
"textToSpeech": {
"text": {
"en": "Your call is important to us."
},
"speech": "<speak>Hello <break time='1s'/> World!</speak>"
},
"callSettings": {
"userInputSpeechDetectionTimeout": 5000,
"dtmf": true,
"bargeIn": true
},
"metaWhatsappTemplate": {
"templateName": "order_confirmation",
"templateId": "meta_tpl_123",
"header": {
"file": {
"name": "document.pdf",
"bucketId": "bucket789",
"objectId": "object1011",
"mimeType": "application/pdf",
"sizeInByte": 102400,
"fbaId": "fba123",
"waaId": "waa456"
},
"parameters": [
"{{1}}",
"User Name"
]
},
"bodyParameters": [
"{{1}}",
"Order Number"
],
"buttons": {
"values": [
"button_value_1",
"button_value_2"
]
}
},
"note": {
"note": "Follow up with customer next week."
},
"chatEnd": {
"status": 3
},
"assignTeam": {
"teamId": "team_sales"
},
"assignOperator": {
"operatorId": "operator_john",
"assignToLastAssigned": true
}
}
}
],
"intent": {
"intentId": "t8gsDajqeJAVMZQPB5mp"
},
"delay": {
"seconds": 5,
"deleteIfConClosed": false
},
"split": {
"a": 50,
"b": 50,
"sameRedirect": false,
"redirects": {
"a": "flow/AAIVrMmsvmfYYeR4xo69/step/vnClGd8WHu3f4KY6dVYL",
"b": "flow/vnClGd8WHu3f4KY6dVYL/step/AAIVrMmsvmfYYeR4xo69"
}
},
"condition": {
"redirects": {
"t": "stepTrue",
"f": "stepFalse"
},
"conditions": [
{
"valueLeft": "{{variable.name}}",
"operator": "==",
"valueRight": "some_value",
"group": 1
}
]
},
"flow": {
"outlets": {
"success": {
"stepId": "stepSuccess",
"name": "Success"
}
},
"flowId": "flowABC",
"entryStepId": "entryStep1",
"redirects": {
"complete": "stepComplete"
}
},
"trigger": {
"triggerId": "gVh98q1ILzabR51miQbH",
"event": "user_subscribed",
"payload": "premium_plan"
},
"redirect": "redirectStep456",
"userInput": "Please enter your name.",
"userInputRequired": true,
"context": {
"intents": [
{
"name": "GreetingIntent",
"intentId": "intent456",
"redirect": "step789"
}
],
"fallbackRedirect": "stepFallback"
},
"app": {
"appId": "appCRM",
"moduleId": "moduleCreateLead",
"paramsJson": "{\"leadName\": \"{{variable.name}}\"}"
},
"description": "This step greets the user and asks for their name.",
"entityDetection": {
"outputVariableId": "varDetectedEntities",
"outputVariablePath": "$.entities",
"prompt": "Extract entities from: {{user_input}}",
"examples": [
{
"value": "I want to book a flight to London.",
"result": "{'city': 'London'}"
}
]
},
"userInputIsSensitive": false,
"runPrompt": {
"outputVariableId": "varPromptOutput",
"outputVariablePath": "$.response",
"prompt": "Generate a summary of the conversation.",
"includeConversationHistory": true,
"useRag": true,
"includeNotes": true,
"knowledgeGroupIds": [
"kg1",
"kg2"
],
"ragContextMessages": 5,
"contextMessageCount": 10
},
"leadAiConversation": {
"prompt": "Help the user book a flight.",
"context": "User wants to travel to Paris.",
"maxIterations": 5,
"ragContextMessages": 5,
"includeConversationHistory": true,
"outlets": [
{
"name": "BookFlight",
"description": "Books a flight for the user.",
"redirect": "stepBookFlight"
}
],
"tools": [
{
"appId": "app123",
"moduleId": "module456",
"description": "Searches for available flights.",
"name": "FlightSearchTool"
}
],
"useRag": true,
"delayMin": 10,
"delayMax": 20,
"delay": true,
"knowledgeGroupIds": [
"kg_flights",
"kg_destinations"
],
"contextMessageCount": 10
},
"contactData": {
"values": "{\"email\": \"user@example.com\"}"
},
"aiConfig": {
"model": 1,
"thinkingBudget": 256,
"seed": 42,
"topP": 0.9,
"temperature": 0.8
},
"end": {
"payload": "thank-you",
"closeConversation": true
}
}
}Last updated