Atualizar Bot
curl --request PATCH \
--url http://localhost:3000/api/openapi/v1/bots/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"temperature": 1,
"identification_name": "<string>",
"questions": [
{
"question": "<string>",
"answer": "<string>"
}
],
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"allow_human": true,
"actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"headers": {},
"body": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"use_audio_responses": true,
"allow_user_audio_requests": true,
"capture_payments": true,
"break_lines": true,
"chat_model_level": 1
}
'import requests
url = "http://localhost:3000/api/openapi/v1/bots/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"temperature": 1,
"identification_name": "<string>",
"questions": [
{
"question": "<string>",
"answer": "<string>"
}
],
"document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"allow_human": True,
"actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"headers": {},
"body": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"use_audio_responses": True,
"allow_user_audio_requests": True,
"capture_payments": True,
"break_lines": True,
"chat_model_level": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
instructions: '<string>',
temperature: 1,
identification_name: '<string>',
questions: [{question: '<string>', answer: '<string>'}],
document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
allow_human: true,
actions: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
endpoint: '<string>',
headers: {},
body: JSON.stringify([{key: '<string>', value: '<string>'}])
}
],
use_audio_responses: true,
allow_user_audio_requests: true,
capture_payments: true,
break_lines: true,
chat_model_level: 1
})
};
fetch('http://localhost:3000/api/openapi/v1/bots/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/openapi/v1/bots/{id}",
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' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'temperature' => 1,
'identification_name' => '<string>',
'questions' => [
[
'question' => '<string>',
'answer' => '<string>'
]
],
'document_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'allow_human' => true,
'actions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'endpoint' => '<string>',
'headers' => [
],
'body' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'use_audio_responses' => true,
'allow_user_audio_requests' => true,
'capture_payments' => true,
'break_lines' => true,
'chat_model_level' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:3000/api/openapi/v1/bots/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/openapi/v1/bots/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/openapi/v1/bots/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Bot de Suporte",
"role": "support",
"description": "Lida com consultas de suporte ao cliente",
"openai_id": "asst_abc123",
"vector_id": "vs_abc123",
"instructions": "<string>",
"temperature": 0.7,
"published": true,
"allow_human": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Corpo da requisição inválido",
"code": "BAD_REQUEST"
}{
"success": false,
"error": "Recurso não encontrado",
"code": "NOT_FOUND"
}Bots
Atualizar Bot
Atualiza a configuração do bot. Todos os campos são opcionais. O bot será marcado como não publicado e requer publicação para aplicar as alterações no OpenAI.
PATCH
/
api
/
openapi
/
v1
/
bots
/
{id}
Atualizar Bot
curl --request PATCH \
--url http://localhost:3000/api/openapi/v1/bots/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"temperature": 1,
"identification_name": "<string>",
"questions": [
{
"question": "<string>",
"answer": "<string>"
}
],
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"allow_human": true,
"actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"headers": {},
"body": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"use_audio_responses": true,
"allow_user_audio_requests": true,
"capture_payments": true,
"break_lines": true,
"chat_model_level": 1
}
'import requests
url = "http://localhost:3000/api/openapi/v1/bots/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"temperature": 1,
"identification_name": "<string>",
"questions": [
{
"question": "<string>",
"answer": "<string>"
}
],
"document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"allow_human": True,
"actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"headers": {},
"body": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"use_audio_responses": True,
"allow_user_audio_requests": True,
"capture_payments": True,
"break_lines": True,
"chat_model_level": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
instructions: '<string>',
temperature: 1,
identification_name: '<string>',
questions: [{question: '<string>', answer: '<string>'}],
document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
allow_human: true,
actions: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
endpoint: '<string>',
headers: {},
body: JSON.stringify([{key: '<string>', value: '<string>'}])
}
],
use_audio_responses: true,
allow_user_audio_requests: true,
capture_payments: true,
break_lines: true,
chat_model_level: 1
})
};
fetch('http://localhost:3000/api/openapi/v1/bots/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/openapi/v1/bots/{id}",
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' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'temperature' => 1,
'identification_name' => '<string>',
'questions' => [
[
'question' => '<string>',
'answer' => '<string>'
]
],
'document_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'allow_human' => true,
'actions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'endpoint' => '<string>',
'headers' => [
],
'body' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'use_audio_responses' => true,
'allow_user_audio_requests' => true,
'capture_payments' => true,
'break_lines' => true,
'chat_model_level' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:3000/api/openapi/v1/bots/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/openapi/v1/bots/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/openapi/v1/bots/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"temperature\": 1,\n \"identification_name\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n }\n ],\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allow_human\": true,\n \"actions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"headers\": {},\n \"body\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"use_audio_responses\": true,\n \"allow_user_audio_requests\": true,\n \"capture_payments\": true,\n \"break_lines\": true,\n \"chat_model_level\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Bot de Suporte",
"role": "support",
"description": "Lida com consultas de suporte ao cliente",
"openai_id": "asst_abc123",
"vector_id": "vs_abc123",
"instructions": "<string>",
"temperature": 0.7,
"published": true,
"allow_human": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Corpo da requisição inválido",
"code": "BAD_REQUEST"
}{
"success": false,
"error": "Recurso não encontrado",
"code": "NOT_FOUND"
}Authorizations
Token JWT obtido do endpoint /api/openapi/auth/token
Path Parameters
ID do Bot (UUID)
Example:
"770e8400-e29b-41d4-a716-446655440002"
Body
application/json
Available options:
support, dynamic, sales Required range:
0 <= x <= 2Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
0 <= x <= 2Was this page helpful?
⌘I