Skip to main content
POST
/
api
/
openapi
/
v1
/
bots
Criar Bot
curl --request POST \
  --url http://localhost:3000/api/openapi/v1/bots \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "Bot de Suporte",
  "instructions": "Você é um assistente de suporte amigável. Sempre seja útil e educado.",
  "role": "dynamic",
  "description": "Lida com consultas de suporte ao cliente",
  "temperature": 0.7,
  "identification_name": "João",
  "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": false,
  "allow_user_audio_requests": false,
  "capture_payments": false,
  "break_lines": true,
  "chat_model_level": 0
}
'
import requests

url = "http://localhost:3000/api/openapi/v1/bots"

payload = {
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Bot de Suporte",
"instructions": "Você é um assistente de suporte amigável. Sempre seja útil e educado.",
"role": "dynamic",
"description": "Lida com consultas de suporte ao cliente",
"temperature": 0.7,
"identification_name": "João",
"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": False,
"allow_user_audio_requests": False,
"capture_payments": False,
"break_lines": True,
"chat_model_level": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Bot de Suporte',
instructions: 'Você é um assistente de suporte amigável. Sempre seja útil e educado.',
role: 'dynamic',
description: 'Lida com consultas de suporte ao cliente',
temperature: 0.7,
identification_name: 'João',
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: false,
allow_user_audio_requests: false,
capture_payments: false,
break_lines: true,
chat_model_level: 0
})
};

fetch('http://localhost:3000/api/openapi/v1/bots', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Bot de Suporte',
'instructions' => 'Você é um assistente de suporte amigável. Sempre seja útil e educado.',
'role' => 'dynamic',
'description' => 'Lida com consultas de suporte ao cliente',
'temperature' => 0.7,
'identification_name' => 'João',
'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' => false,
'allow_user_audio_requests' => false,
'capture_payments' => false,
'break_lines' => true,
'chat_model_level' => 0
]),
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"

payload := strings.NewReader("{\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Bot de Suporte\",\n \"instructions\": \"Você é um assistente de suporte amigável. Sempre seja útil e educado.\",\n \"role\": \"dynamic\",\n \"description\": \"Lida com consultas de suporte ao cliente\",\n \"temperature\": 0.7,\n \"identification_name\": \"João\",\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\": false,\n \"allow_user_audio_requests\": false,\n \"capture_payments\": false,\n \"break_lines\": true,\n \"chat_model_level\": 0\n}")

req, _ := http.NewRequest("POST", 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.post("http://localhost:3000/api/openapi/v1/bots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Bot de Suporte\",\n \"instructions\": \"Você é um assistente de suporte amigável. Sempre seja útil e educado.\",\n \"role\": \"dynamic\",\n \"description\": \"Lida com consultas de suporte ao cliente\",\n \"temperature\": 0.7,\n \"identification_name\": \"João\",\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\": false,\n \"allow_user_audio_requests\": false,\n \"capture_payments\": false,\n \"break_lines\": true,\n \"chat_model_level\": 0\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:3000/api/openapi/v1/bots")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Bot de Suporte\",\n \"instructions\": \"Você é um assistente de suporte amigável. Sempre seja útil e educado.\",\n \"role\": \"dynamic\",\n \"description\": \"Lida com consultas de suporte ao cliente\",\n \"temperature\": 0.7,\n \"identification_name\": \"João\",\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\": false,\n \"allow_user_audio_requests\": false,\n \"capture_payments\": false,\n \"break_lines\": true,\n \"chat_model_level\": 0\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"
}

Authorizations

Authorization
string
header
required

Token JWT obtido do endpoint /api/openapi/auth/token

Body

application/json
team_id
string<uuid>
required
name
string
required
Example:

"Bot de Suporte"

instructions
string
required
Example:

"Você é um assistente de suporte amigável. Sempre seja útil e educado."

role
enum<string>
default:dynamic
Available options:
support,
dynamic,
sales
description
string
Example:

"Lida com consultas de suporte ao cliente"

temperature
number<float>
default:1
Required range: 0 <= x <= 2
Example:

0.7

identification_name
string | null
Example:

"João"

questions
object[]
document_ids
string<uuid>[]
allow_human
boolean
default:true
actions
object[]
use_audio_responses
boolean
default:false
allow_user_audio_requests
boolean
default:false
capture_payments
boolean
default:false
break_lines
boolean
default:true
chat_model_level
integer
default:0
Required range: 0 <= x <= 2

Response

Bot criado com sucesso

success
boolean
Example:

true

data
object