JavaScript
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const chat = await client.workers.deployments.chat.create('workerId', {
flowId: 'flowId',
name: 'name',
});
console.log(chat.id);import os
from brainbase_labs import BrainbaseLabs
client = BrainbaseLabs(
api_key=os.environ.get("BRAINBASE_LABS_API_KEY"), # This is the default and can be omitted
)
chat = client.workers.deployments.chat.create(
worker_id="workerId",
flow_id="flowId",
name="name",
)
print(chat.id)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"flowId": "<string>",
"flowVersionId": "<string>",
"allowedUsers": [
"<string>"
],
"welcomeMessage": "<string>",
"llmModel": "<string>",
"modelConfig": {},
"extractions": {},
"successCriteria": [
{
"title": "<string>",
"items": [
{
"title": "<string>",
"description": "<string>",
"threshold": 123
}
],
"description": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat",
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([
'name' => '<string>',
'flowId' => '<string>',
'flowVersionId' => '<string>',
'allowedUsers' => [
'<string>'
],
'welcomeMessage' => '<string>',
'llmModel' => '<string>',
'modelConfig' => [
],
'extractions' => [
],
'successCriteria' => [
[
'title' => '<string>',
'items' => [
[
'title' => '<string>',
'description' => '<string>',
'threshold' => 123
]
],
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"allowedUsers": "<string>",
"modelConfig": {},
"chatAgentId": "<string>",
"welcomeMessage": "<string>",
"llmModel": "<string>"
}Chat Deployments
Create a new chat deployment
POST
/
api
/
workers
/
{workerId}
/
deployments
/
chat
JavaScript
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const chat = await client.workers.deployments.chat.create('workerId', {
flowId: 'flowId',
name: 'name',
});
console.log(chat.id);import os
from brainbase_labs import BrainbaseLabs
client = BrainbaseLabs(
api_key=os.environ.get("BRAINBASE_LABS_API_KEY"), # This is the default and can be omitted
)
chat = client.workers.deployments.chat.create(
worker_id="workerId",
flow_id="flowId",
name="name",
)
print(chat.id)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"flowId": "<string>",
"flowVersionId": "<string>",
"allowedUsers": [
"<string>"
],
"welcomeMessage": "<string>",
"llmModel": "<string>",
"modelConfig": {},
"extractions": {},
"successCriteria": [
{
"title": "<string>",
"items": [
{
"title": "<string>",
"description": "<string>",
"threshold": 123
}
],
"description": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat",
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([
'name' => '<string>',
'flowId' => '<string>',
'flowVersionId' => '<string>',
'allowedUsers' => [
'<string>'
],
'welcomeMessage' => '<string>',
'llmModel' => '<string>',
'modelConfig' => [
],
'extractions' => [
],
'successCriteria' => [
[
'title' => '<string>',
'items' => [
[
'title' => '<string>',
'description' => '<string>',
'threshold' => 123
]
],
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"flowId\": \"<string>\",\n \"flowVersionId\": \"<string>\",\n \"allowedUsers\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"llmModel\": \"<string>\",\n \"modelConfig\": {},\n \"extractions\": {},\n \"successCriteria\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"threshold\": 123\n }\n ],\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"allowedUsers": "<string>",
"modelConfig": {},
"chatAgentId": "<string>",
"welcomeMessage": "<string>",
"llmModel": "<string>"
}Authorizations
API key authentication
Path Parameters
Body
application/json
⌘I
