Skip to main content
PUT
/
api
/
workers
/
{workerId}
/
deployments
/
voicev1
/
{deploymentId}
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.update('deploymentId', {
  workerId: 'workerId',
});

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.update(
deployment_id="deploymentId",
worker_id="workerId",
)
print(voice_v1_deployment.id)
curl --request PUT \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId} \
--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": "<string>",
"extractions": {}
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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' => '<string>',
'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/{deploymentId}"

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\": \"<string>\",\n \"extractions\": {}\n}")

req, _ := http.NewRequest("PUT", 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.put("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}")
.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\": \"<string>\",\n \"extractions\": {}\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Put.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\": \"<string>\",\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
deploymentId
string
required

Body

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

Response

Updated voice v1 deployment

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