Update Chatbot
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbots \
--header 'Content-Type: application/json' \
--data @- <<EOF
"{\n \"name\": \"API Docs Demo Chatbot\",\n \"description\": \"A helpful support assistant\",\n \"personality_config\": {\n \"tone\": \"Professional\",\n \"style\": \"Friendly\"\n },\n \"settings\": {\n \"model\": \"gpt-4o-mini\",\n \"prompt\": \"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\",\n \"snippet\": {\n \"logo\": \"https://example.com/logo.png\",\n \"name\": \"Support Assistant\",\n \"header\": \"Customer Support\",\n \"slogan\": \"How can I help you today?\",\n \"primaryColor\": \"#4F46E5\",\n \"secondaryColor\": \"#10B981\"\n },\n \"greeting\": \"Hello! How can I assist you today?\",\n \"isToolEnabled\": true,\n \"isRequestUserInfoEnabled\": false // if enabled, chatbot will request the user's email first\n },\n \"is_public\": false\n}"
EOFimport requests
url = "https://v2.okchat.ai/api/external/chatbots"
payload = "{
\"name\": \"API Docs Demo Chatbot\",
\"description\": \"A helpful support assistant\",
\"personality_config\": {
\"tone\": \"Professional\",
\"style\": \"Friendly\"
},
\"settings\": {
\"model\": \"gpt-4o-mini\",
\"prompt\": \"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\",
\"snippet\": {
\"logo\": \"https://example.com/logo.png\",
\"name\": \"Support Assistant\",
\"header\": \"Customer Support\",
\"slogan\": \"How can I help you today?\",
\"primaryColor\": \"#4F46E5\",
\"secondaryColor\": \"#10B981\"
},
\"greeting\": \"Hello! How can I assist you today?\",
\"isToolEnabled\": true,
\"isRequestUserInfoEnabled\": false // if enabled, chatbot will request the user's email first
},
\"is_public\": false
}"
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('{\n "name": "API Docs Demo Chatbot",\n "description": "A helpful support assistant",\n "personality_config": {\n "tone": "Professional",\n "style": "Friendly"\n },\n "settings": {\n "model": "gpt-4o-mini",\n "prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",\n "snippet": {\n "logo": "https://example.com/logo.png",\n "name": "Support Assistant",\n "header": "Customer Support",\n "slogan": "How can I help you today?",\n "primaryColor": "#4F46E5",\n "secondaryColor": "#10B981"\n },\n "greeting": "Hello! How can I assist you today?",\n "isToolEnabled": true,\n "isRequestUserInfoEnabled": false // if enabled, chatbot will request the user\'s email first\n },\n "is_public": false\n}')
};
fetch('https://v2.okchat.ai/api/external/chatbots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.okchat.ai/api/external/chatbots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode('{
"name": "API Docs Demo Chatbot",
"description": "A helpful support assistant",
"personality_config": {
"tone": "Professional",
"style": "Friendly"
},
"settings": {
"model": "gpt-4o-mini",
"prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",
"snippet": {
"logo": "https://example.com/logo.png",
"name": "Support Assistant",
"header": "Customer Support",
"slogan": "How can I help you today?",
"primaryColor": "#4F46E5",
"secondaryColor": "#10B981"
},
"greeting": "Hello! How can I assist you today?",
"isToolEnabled": true,
"isRequestUserInfoEnabled": false // if enabled, chatbot will request the user\'s email first
},
"is_public": false
}'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v2.okchat.ai/api/external/chatbots"
payload := strings.NewReader("\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\"")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://v2.okchat.ai/api/external/chatbots")
.header("Content-Type", "application/json")
.body("\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\""
response = http.request(request)
puts response.read_body{
"chatbot": {
"active": true,
"created_at": "2025-01-22T04:30:45.790337+00:00",
"description": "A helpful support assistant",
"docs_metadata": null,
"enabled_plugins": null,
"id": "3317853e-0af2-427d-a56f-351a9587f48f",
"is_public": false,
"managers": null,
"migrated_data": false,
"name": "API Docs Demo Chatbot",
"openai_api_key": null,
"organization_id": "123042b2-86e2-4184-a86e-95423d728815",
"personality_config": {
"style": "Friendly",
"tone": "Professional"
},
"settings": {
"greeting": "Hello! How can I assist you today?",
"isRequestUserInfoEnabled": false,
"isToolEnabled": true,
"model": "gpt-4o-mini",
"prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",
"snippet": {
"header": "Customer Support",
"logo": "https://example.com/logo.png",
"name": "Support Assistant",
"primaryColor": "#4F46E5",
"secondaryColor": "#10B981",
"slogan": "How can I help you today?"
}
},
"slug": "api-docs-demo-chatbot",
"suggestions": null,
"updated_at": "2025-01-22T04:30:45.790337+00:00",
"v1_chatbot_id": null,
"version_id": null,
"voice_widget_config": null
},
"message": "Chatbot updated successfully"
}API Reference
Update Chatbot
Update Chatbot
PATCH
/
api
/
external
/
chatbots
Update Chatbot
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbots \
--header 'Content-Type: application/json' \
--data @- <<EOF
"{\n \"name\": \"API Docs Demo Chatbot\",\n \"description\": \"A helpful support assistant\",\n \"personality_config\": {\n \"tone\": \"Professional\",\n \"style\": \"Friendly\"\n },\n \"settings\": {\n \"model\": \"gpt-4o-mini\",\n \"prompt\": \"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\",\n \"snippet\": {\n \"logo\": \"https://example.com/logo.png\",\n \"name\": \"Support Assistant\",\n \"header\": \"Customer Support\",\n \"slogan\": \"How can I help you today?\",\n \"primaryColor\": \"#4F46E5\",\n \"secondaryColor\": \"#10B981\"\n },\n \"greeting\": \"Hello! How can I assist you today?\",\n \"isToolEnabled\": true,\n \"isRequestUserInfoEnabled\": false // if enabled, chatbot will request the user's email first\n },\n \"is_public\": false\n}"
EOFimport requests
url = "https://v2.okchat.ai/api/external/chatbots"
payload = "{
\"name\": \"API Docs Demo Chatbot\",
\"description\": \"A helpful support assistant\",
\"personality_config\": {
\"tone\": \"Professional\",
\"style\": \"Friendly\"
},
\"settings\": {
\"model\": \"gpt-4o-mini\",
\"prompt\": \"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\",
\"snippet\": {
\"logo\": \"https://example.com/logo.png\",
\"name\": \"Support Assistant\",
\"header\": \"Customer Support\",
\"slogan\": \"How can I help you today?\",
\"primaryColor\": \"#4F46E5\",
\"secondaryColor\": \"#10B981\"
},
\"greeting\": \"Hello! How can I assist you today?\",
\"isToolEnabled\": true,
\"isRequestUserInfoEnabled\": false // if enabled, chatbot will request the user's email first
},
\"is_public\": false
}"
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('{\n "name": "API Docs Demo Chatbot",\n "description": "A helpful support assistant",\n "personality_config": {\n "tone": "Professional",\n "style": "Friendly"\n },\n "settings": {\n "model": "gpt-4o-mini",\n "prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",\n "snippet": {\n "logo": "https://example.com/logo.png",\n "name": "Support Assistant",\n "header": "Customer Support",\n "slogan": "How can I help you today?",\n "primaryColor": "#4F46E5",\n "secondaryColor": "#10B981"\n },\n "greeting": "Hello! How can I assist you today?",\n "isToolEnabled": true,\n "isRequestUserInfoEnabled": false // if enabled, chatbot will request the user\'s email first\n },\n "is_public": false\n}')
};
fetch('https://v2.okchat.ai/api/external/chatbots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.okchat.ai/api/external/chatbots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode('{
"name": "API Docs Demo Chatbot",
"description": "A helpful support assistant",
"personality_config": {
"tone": "Professional",
"style": "Friendly"
},
"settings": {
"model": "gpt-4o-mini",
"prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",
"snippet": {
"logo": "https://example.com/logo.png",
"name": "Support Assistant",
"header": "Customer Support",
"slogan": "How can I help you today?",
"primaryColor": "#4F46E5",
"secondaryColor": "#10B981"
},
"greeting": "Hello! How can I assist you today?",
"isToolEnabled": true,
"isRequestUserInfoEnabled": false // if enabled, chatbot will request the user\'s email first
},
"is_public": false
}'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v2.okchat.ai/api/external/chatbots"
payload := strings.NewReader("\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\"")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://v2.okchat.ai/api/external/chatbots")
.header("Content-Type", "application/json")
.body("\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "\"{\\n \\\"name\\\": \\\"API Docs Demo Chatbot\\\",\\n \\\"description\\\": \\\"A helpful support assistant\\\",\\n \\\"personality_config\\\": {\\n \\\"tone\\\": \\\"Professional\\\",\\n \\\"style\\\": \\\"Friendly\\\"\\n },\\n \\\"settings\\\": {\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"prompt\\\": \\\"You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses\\\",\\n \\\"snippet\\\": {\\n \\\"logo\\\": \\\"https://example.com/logo.png\\\",\\n \\\"name\\\": \\\"Support Assistant\\\",\\n \\\"header\\\": \\\"Customer Support\\\",\\n \\\"slogan\\\": \\\"How can I help you today?\\\",\\n \\\"primaryColor\\\": \\\"#4F46E5\\\",\\n \\\"secondaryColor\\\": \\\"#10B981\\\"\\n },\\n \\\"greeting\\\": \\\"Hello! How can I assist you today?\\\",\\n \\\"isToolEnabled\\\": true,\\n \\\"isRequestUserInfoEnabled\\\": false // if enabled, chatbot will request the user's email first\\n },\\n \\\"is_public\\\": false\\n}\""
response = http.request(request)
puts response.read_body{
"chatbot": {
"active": true,
"created_at": "2025-01-22T04:30:45.790337+00:00",
"description": "A helpful support assistant",
"docs_metadata": null,
"enabled_plugins": null,
"id": "3317853e-0af2-427d-a56f-351a9587f48f",
"is_public": false,
"managers": null,
"migrated_data": false,
"name": "API Docs Demo Chatbot",
"openai_api_key": null,
"organization_id": "123042b2-86e2-4184-a86e-95423d728815",
"personality_config": {
"style": "Friendly",
"tone": "Professional"
},
"settings": {
"greeting": "Hello! How can I assist you today?",
"isRequestUserInfoEnabled": false,
"isToolEnabled": true,
"model": "gpt-4o-mini",
"prompt": "You are a highly skilled customer support assistant for [company name]. Your goal is to provide accurate, polite, and concise answers to customer inquiries. If you do not know the answer, recommend the customer to contact human support or check the FAQ section. Ensure a positive tone in all responses",
"snippet": {
"header": "Customer Support",
"logo": "https://example.com/logo.png",
"name": "Support Assistant",
"primaryColor": "#4F46E5",
"secondaryColor": "#10B981",
"slogan": "How can I help you today?"
}
},
"slug": "api-docs-demo-chatbot",
"suggestions": null,
"updated_at": "2025-01-22T04:30:45.790337+00:00",
"v1_chatbot_id": null,
"version_id": null,
"voice_widget_config": null
},
"message": "Chatbot updated successfully"
}Headers
Example:
"15a23c21867f4f38b0b46f5e4adb1caf87a040b34eb58f68"
Query Parameters
Example:
"3317853e-0af2-427d-a56f-351a9587f48f"
Body
application/json
⌘I