Skip to main content
POST
/
api
/
workers
/
{workerId}
/
deployments
/
voicev1
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 voiceV1Deployment = await client.workers.deployments.voicev1.create('workerId', {
  allowedTransferNumbers: ['string'],
  config: {},
  endSentence: 'endSentence',
  flowId: 'flowId',
  functions: 'functions',
  language: 'language',
  model: 'model',
  name: 'name',
  objective: 'objective',
  phoneNumber: 'phoneNumber',
  resourceKeys: ['string'],
  startSentence: 'startSentence',
  voiceId: 'voiceId',
  wsBaseUrl: 'wsBaseUrl',
});

console.log(voiceV1Deployment.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
)
voice_v1_deployment = client.workers.deployments.voicev1.create(
worker_id="workerId",
allowed_transfer_numbers=["string"],
config={},
end_sentence="endSentence",
flow_id="flowId",
functions="functions",
language="language",
model="model",
name="name",
objective="objective",
phone_number="phoneNumber",
resource_keys=["string"],
start_sentence="startSentence",
voice_id="voiceId",
ws_base_url="wsBaseUrl",
)
print(voice_v1_deployment.id)
curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"phoneNumber": "<string>",
"flowId": "<string>",
"objective": "<string>",
"startSentence": "<string>",
"endSentence": "<string>",
"voiceId": "<string>",
"language": "<string>",
"allowedTransferNumbers": [
"<string>"
],
"functions": "<string>",
"model": "<string>",
"resourceKeys": [
"<string>"
],
"wsBaseUrl": "<string>",
"config": {},
"extractions": {}
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1",
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>',
'phoneNumber' => '<string>',
'flowId' => '<string>',
'objective' => '<string>',
'startSentence' => '<string>',
'endSentence' => '<string>',
'voiceId' => '<string>',
'language' => '<string>',
'allowedTransferNumbers' => [
'<string>'
],
'functions' => '<string>',
'model' => '<string>',
'resourceKeys' => [
'<string>'
],
'wsBaseUrl' => '<string>',
'config' => [

],
'extractions' => [

]
]),
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/voicev1"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"flowId\": \"<string>\",\n \"objective\": \"<string>\",\n \"startSentence\": \"<string>\",\n \"endSentence\": \"<string>\",\n \"voiceId\": \"<string>\",\n \"language\": \"<string>\",\n \"allowedTransferNumbers\": [\n \"<string>\"\n ],\n \"functions\": \"<string>\",\n \"model\": \"<string>\",\n \"resourceKeys\": [\n \"<string>\"\n ],\n \"wsBaseUrl\": \"<string>\",\n \"config\": {},\n \"extractions\": {}\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/voicev1")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"flowId\": \"<string>\",\n \"objective\": \"<string>\",\n \"startSentence\": \"<string>\",\n \"endSentence\": \"<string>\",\n \"voiceId\": \"<string>\",\n \"language\": \"<string>\",\n \"allowedTransferNumbers\": [\n \"<string>\"\n ],\n \"functions\": \"<string>\",\n \"model\": \"<string>\",\n \"resourceKeys\": [\n \"<string>\"\n ],\n \"wsBaseUrl\": \"<string>\",\n \"config\": {},\n \"extractions\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1")

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 \"phoneNumber\": \"<string>\",\n \"flowId\": \"<string>\",\n \"objective\": \"<string>\",\n \"startSentence\": \"<string>\",\n \"endSentence\": \"<string>\",\n \"voiceId\": \"<string>\",\n \"language\": \"<string>\",\n \"allowedTransferNumbers\": [\n \"<string>\"\n ],\n \"functions\": \"<string>\",\n \"model\": \"<string>\",\n \"resourceKeys\": [\n \"<string>\"\n ],\n \"wsBaseUrl\": \"<string>\",\n \"config\": {},\n \"extractions\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "phoneNumber": "<string>",
  "objective": "<string>",
  "allowedTransferNumbers": "<string>",
  "resourceKeys": "<string>",
  "startSentence": "<string>",
  "endSentence": "<string>",
  "voiceId": "<string>",
  "language": "<string>",
  "functions": {},
  "model": "<string>",
  "wsBaseUrl": "<string>"
}

Authorizations

x-api-key
string
header
required

API key authentication

Path Parameters

workerId
string
required

Body

application/json
name
string
required
phoneNumber
string
required
flowId
string
required
objective
string
required
startSentence
string | null
required
endSentence
string | null
required
voiceId
string | null
required
language
string | null
required
allowedTransferNumbers
string[]
required
functions
string | null
required
model
string | null
required
resourceKeys
string[]
required
wsBaseUrl
string | null
required
config
object
required
extractions
object

Response

Voice v1 deployment created

id
string
required
phoneNumber
string
required
objective
string
required
allowedTransferNumbers
string
required
resourceKeys
string
required
startSentence
string | null
endSentence
string | null
voiceId
string | null
language
string | null
functions
object | null
model
string | null
wsBaseUrl
string | null