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
});
await client.workers.deployments.voicev1.makeBatchCalls('deploymentId', {
workerId: 'workerId',
data: [{ id: 'id', phoneNumber: 'phoneNumber' }],
});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
)
client.workers.deployments.voicev1.make_batch_calls(
deployment_id="deploymentId",
worker_id="workerId",
data=[{
"id": "id",
"phone_number": "phoneNumber",
}],
)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"data": [
{
"id": "<string>",
"phoneNumber": "<string>"
}
],
"condition": "<string>",
"extractions": {},
"batch_size": 123,
"batch_interval_minutes": 123,
"wsUrl": "<string>",
"additional_data": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls",
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([
'data' => [
[
'id' => '<string>',
'phoneNumber' => '<string>'
]
],
'condition' => '<string>',
'extractions' => [
],
'batch_size' => 123,
'batch_interval_minutes' => 123,
'wsUrl' => '<string>',
'additional_data' => [
]
]),
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}/make-batch-calls"
payload := strings.NewReader("{\n \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\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/{deploymentId}/make-batch-calls")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls")
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 \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\n}"
response = http.request(request)
puts response.read_bodyVoice V1 Deployments
Make batch calls for a voice v1 deployment
POST
/
api
/
workers
/
{workerId}
/
deployments
/
voicev1
/
{deploymentId}
/
make-batch-calls
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
});
await client.workers.deployments.voicev1.makeBatchCalls('deploymentId', {
workerId: 'workerId',
data: [{ id: 'id', phoneNumber: 'phoneNumber' }],
});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
)
client.workers.deployments.voicev1.make_batch_calls(
deployment_id="deploymentId",
worker_id="workerId",
data=[{
"id": "id",
"phone_number": "phoneNumber",
}],
)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"data": [
{
"id": "<string>",
"phoneNumber": "<string>"
}
],
"condition": "<string>",
"extractions": {},
"batch_size": 123,
"batch_interval_minutes": 123,
"wsUrl": "<string>",
"additional_data": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls",
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([
'data' => [
[
'id' => '<string>',
'phoneNumber' => '<string>'
]
],
'condition' => '<string>',
'extractions' => [
],
'batch_size' => 123,
'batch_interval_minutes' => 123,
'wsUrl' => '<string>',
'additional_data' => [
]
]),
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}/make-batch-calls"
payload := strings.NewReader("{\n \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\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/{deploymentId}/make-batch-calls")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/{workerId}/deployments/voicev1/{deploymentId}/make-batch-calls")
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 \"data\": [\n {\n \"id\": \"<string>\",\n \"phoneNumber\": \"<string>\"\n }\n ],\n \"condition\": \"<string>\",\n \"extractions\": {},\n \"batch_size\": 123,\n \"batch_interval_minutes\": 123,\n \"wsUrl\": \"<string>\",\n \"additional_data\": {}\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API key authentication
Body
application/json
Array of data objects to process in batches, each requiring at least an id and phoneNumber
Show child attributes
Show child attributes
Optional condition to evaluate for processing data. Supports template variables like {{variableName}}
Definitions of data to extract during calls, with each key representing a field to extract
Show child attributes
Show child attributes
Number of items to process in each batch (default 10)
Time interval between batches in minutes (default 5)
Webhook URL to receive events when calls complete or extract data
Additional data to pass with each request that will be available during the call
Show child attributes
Show child attributes
Response
Batch calls started successfully
⌘I
