Chatbot Avatar
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar \
--header 'Content-Type: multipart/form-data' \
--form avatar='@example-file'import requests
url = "https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar"
files = { "avatar": ("example-file", open("example-file", "rb")) }
response = requests.patch(url, files=files)
print(response.text)const form = new FormData();
form.append('avatar', '<string>');
const options = {method: 'PATCH'};
options.body = form;
fetch('https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar', 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/chatbot/{chatbotId}/update-avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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/chatbot/{chatbotId}/update-avatar"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
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/chatbot/{chatbotId}/update-avatar")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
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": true,
"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": {
"avatar": "https://alwiuiydhxcstgrluarg.supabase.co/storage/v1/object/public/chatbot/3317853e-0af2-427d-a56f-351a9587f48f/7b9ec849-29fb-41c4-b66e-0709e7fa18b9.jpg",
"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": "Avatar updated successfully"
}API Reference
Chatbot Avatar
Chatbot Avatar
PATCH
/
api
/
external
/
chatbot
/
{chatbotId}
/
update-avatar
Chatbot Avatar
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar \
--header 'Content-Type: multipart/form-data' \
--form avatar='@example-file'import requests
url = "https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar"
files = { "avatar": ("example-file", open("example-file", "rb")) }
response = requests.patch(url, files=files)
print(response.text)const form = new FormData();
form.append('avatar', '<string>');
const options = {method: 'PATCH'};
options.body = form;
fetch('https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar', 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/chatbot/{chatbotId}/update-avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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/chatbot/{chatbotId}/update-avatar"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
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/chatbot/{chatbotId}/update-avatar")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/update-avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"avatar\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
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": true,
"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": {
"avatar": "https://alwiuiydhxcstgrluarg.supabase.co/storage/v1/object/public/chatbot/3317853e-0af2-427d-a56f-351a9587f48f/7b9ec849-29fb-41c4-b66e-0709e7fa18b9.jpg",
"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": "Avatar updated successfully"
}Headers
Example:
"15a23c21867f4f38b0b46f5e4adb1caf87a040b34eb58f68"
Path Parameters
Example:
"3317853e-0af2-427d-a56f-351a9587f48f"
Body
multipart/form-data
⌘I