POST
/
api
/
workers
/
{workerId}
/
deployments
/
voicev1
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',
  extractions: { foo: { description: 'description', required: true, type: 'string' } },
  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);
{
  "id": "<string>",
  "phoneNumber": "<string>",
  "objective": "<string>",
  "startSentence": "<string>",
  "endSentence": "<string>",
  "voiceId": "<string>",
  "language": "<string>",
  "allowedTransferNumbers": "<string>",
  "functions": {},
  "model": "<string>",
  "resourceKeys": "<string>",
  "wsBaseUrl": "<string>"
}

Authorizations

x-api-key
string
header
required

API key authentication

Path Parameters

workerId
string
required

Body

application/json

Response

201
application/json

Voice v1 deployment created

The response is of type object.