@wildix/wim-voicebots-client > CreateVoiceBotCommand
CreateVoiceBotCommand class
Creates a new voice bot with the specified configuration for the company.
Signature:
export declare class CreateVoiceBotCommand extends CreateVoiceBotCommand_base
Extends: CreateVoiceBotCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { VoiceBotsClient, CreateVoiceBotCommand } from "@wildix/wim-voicebots-client"; // ES Modules import
// const { VoiceBotsClient, CreateVoiceBotCommand } = require("@wildix/wim-voicebots-client"); // CommonJS import
const client = new VoiceBotsClient(config);
const input = { // CreateVoiceBotInput
name: "STRING_VALUE", // required
message: "STRING_VALUE",
pipeline: { // VoiceBotPipelineSettings
interuptionsEnabled: true || false,
maximumDuration: Number("int"),
maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
hangup: {},
transfer: { // VoiceBotTerminateTransferAction
context: "STRING_VALUE", // required
extension: "STRING_VALUE", // required
},
},
silenceTimeout: Number("int"),
silenceTimeoutAction: {// Union: only one key present
hangup: {},
transfer: {
context: "STRING_VALUE", // required
extension: "STRING_VALUE", // required
},
},
endCallEnabled: true || false,
endCallPhases: "STRING_VALUE",
},
endpoint: { // VoiceBotEndpoint Union: only one key present
llm: { // VoiceBotLlmEndpoint
prompt: "STRING_VALUE", // required
model: "STRING_VALUE",
metadata: { // VoiceBotPromptMetadata
userName: { // VoiceBotPromptMetadataEnabled
enabled: true || false, // required
},
userPhoneNumber: {
enabled: true || false, // required
},
userEmail: { // VoiceBotPromptMetadataDisabled
enabled: true || false, // required
},
userCompany: {
enabled: true || false, // required
},
time: { // VoiceBotPromptMetadataTime
enabled: true || false, // required
timeZone: "STRING_VALUE", // required
},
},
embeddedTools: [ // VoiceBotEmbeddedToolsList
{ // VoiceBotEmbeddedTool
type: "HANGUP" || "TRANSFER" || "DELEGATE" || "WAIT", // required
name: "STRING_VALUE", // required
parameters: "DOCUMENT_VALUE",
},
],
tools: [ // VoiceBotToolsList
{ // VoiceBotTool
type: "function", // required
function: { // VoiceBotFunctionDefinition
name: "STRING_VALUE", // required
description: "STRING_VALUE",
parameters: "DOCUMENT_VALUE",
integration: { // VoiceBotFunctionIntegration Union: only one key present
webhook: { // VoiceBotFunctionIntegrationWebhook
url: "STRING_VALUE", // required
method: "get" || "post" || "put" || "delete" || "patch",
async: true || false,
authorization: { // VoiceBotFunctionIntegrationWebhookAuthorization Union: only one key present
bearer: { // VoiceBotFunctionIntegrationWebhookAuthorizationBearer
token: "STRING_VALUE", // required
},
basic: { // VoiceBotFunctionIntegrationWebhookAuthorizationBasic
username: "STRING_VALUE", // required
password: "STRING_VALUE", // required
},
oauth: { // VoiceBotFunctionIntegrationWebhookAuthorizationOAuth
clientId: "STRING_VALUE", // required
clientSecret: "STRING_VALUE", // required
endpointUrl: "STRING_VALUE", // required
scope: "STRING_VALUE",
},
},
headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
{ // VoiceBotFunctionIntegrationWebhookHeader
key: "STRING_VALUE", // required
value: "STRING_VALUE", // required
},
],
timeout: Number("int"),
startMessage: "STRING_VALUE",
parameters: "DOCUMENT_VALUE",
},
},
},
},
],
capabilities: [ // VoiceBotCapabilitiesList
{ // VoiceBotCapability Union: only one key present
tool: { // VoiceBotCapabilityTool
id: "STRING_VALUE", // required
variables: [ // VoiceBotToolVariablesList
{ // VoiceBotToolVariable
name: "STRING_VALUE", // required
handler: { // VoiceBotToolVariableHandler Union: only one key present
auto: {},
guided: { // VoiceBotToolVariableGuidedHandler
description: "STRING_VALUE", // required
},
predefined: { // VoiceBotToolVariablePredefinedHandler
description: "STRING_VALUE", // required
},
},
},
],
},
kb: { // VoiceBotKnowledgeBase
knowledgeBaseId: "STRING_VALUE",
instructions: "STRING_VALUE",
},
},
],
},
dialogflowCx: { // BotDialogflowCxEndpoint
credentials: "DOCUMENT_VALUE", // required
agent: "STRING_VALUE", // required
location: "STRING_VALUE", // required
language: "STRING_VALUE", // required
},
openAiAssistant: { // BotOpenAiAssistantEndpoint
key: "STRING_VALUE", // required
assistantId: "STRING_VALUE", // required
},
webhook: { // BotWebhookEndpoint
url: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
sqs: { // BotSqsEndpoint
url: "STRING_VALUE", // required
key: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
},
capabilities: [
{// Union: only one key present
tool: {
id: "STRING_VALUE", // required
variables: [
{
name: "STRING_VALUE", // required
handler: {// Union: only one key present
auto: {},
guided: {
description: "STRING_VALUE", // required
},
predefined: {
description: "STRING_VALUE", // required
},
},
},
],
},
kb: {
knowledgeBaseId: "STRING_VALUE",
instructions: "STRING_VALUE",
},
},
],
company: "STRING_VALUE",
};
const command = new CreateVoiceBotCommand(input);
const response = await client.send(command);
// { // CreateVoiceBotOutput
// bot: { // VoiceBot
// name: "STRING_VALUE", // required
// message: "STRING_VALUE",
// pipeline: { // VoiceBotPipelineSettings
// interuptionsEnabled: true || false,
// maximumDuration: Number("int"),
// maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
// hangup: {},
// transfer: { // VoiceBotTerminateTransferAction
// context: "STRING_VALUE", // required
// extension: "STRING_VALUE", // required
// },
// },
// silenceTimeout: Number("int"),
// silenceTimeoutAction: {// Union: only one key present
// hangup: {},
// transfer: {
// context: "STRING_VALUE", // required
// extension: "STRING_VALUE", // required
// },
// },
// endCallEnabled: true || false,
// endCallPhases: "STRING_VALUE",
// },
// endpoint: { // VoiceBotEndpoint Union: only one key present
// llm: { // VoiceBotLlmEndpoint
// prompt: "STRING_VALUE", // required
// model: "STRING_VALUE",
// metadata: { // VoiceBotPromptMetadata
// userName: { // VoiceBotPromptMetadataEnabled
// enabled: true || false, // required
// },
// userPhoneNumber: {
// enabled: true || false, // required
// },
// userEmail: { // VoiceBotPromptMetadataDisabled
// enabled: true || false, // required
// },
// userCompany: {
// enabled: true || false, // required
// },
// time: { // VoiceBotPromptMetadataTime
// enabled: true || false, // required
// timeZone: "STRING_VALUE", // required
// },
// },
// embeddedTools: [ // VoiceBotEmbeddedToolsList
// { // VoiceBotEmbeddedTool
// type: "HANGUP" || "TRANSFER" || "DELEGATE" || "WAIT", // required
// name: "STRING_VALUE", // required
// parameters: "DOCUMENT_VALUE",
// },
// ],
// tools: [ // VoiceBotToolsList
// { // VoiceBotTool
// type: "function", // required
// function: { // VoiceBotFunctionDefinition
// name: "STRING_VALUE", // required
// description: "STRING_VALUE",
// parameters: "DOCUMENT_VALUE",
// integration: { // VoiceBotFunctionIntegration Union: only one key present
// webhook: { // VoiceBotFunctionIntegrationWebhook
// url: "STRING_VALUE", // required
// method: "get" || "post" || "put" || "delete" || "patch",
// async: true || false,
// authorization: { // VoiceBotFunctionIntegrationWebhookAuthorization Union: only one key present
// bearer: { // VoiceBotFunctionIntegrationWebhookAuthorizationBearer
// token: "STRING_VALUE", // required
// },
// basic: { // VoiceBotFunctionIntegrationWebhookAuthorizationBasic
// username: "STRING_VALUE", // required
// password: "STRING_VALUE", // required
// },
// oauth: { // VoiceBotFunctionIntegrationWebhookAuthorizationOAuth
// clientId: "STRING_VALUE", // required
// clientSecret: "STRING_VALUE", // required
// endpointUrl: "STRING_VALUE", // required
// scope: "STRING_VALUE",
// },
// },
// headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
// { // VoiceBotFunctionIntegrationWebhookHeader
// key: "STRING_VALUE", // required
// value: "STRING_VALUE", // required
// },
// ],
// timeout: Number("int"),
// startMessage: "STRING_VALUE",
// parameters: "DOCUMENT_VALUE",
// },
// },
// },
// },
// ],
// capabilities: [ // VoiceBotCapabilitiesList
// { // VoiceBotCapability Union: only one key present
// tool: { // VoiceBotCapabilityTool
// id: "STRING_VALUE", // required
// variables: [ // VoiceBotToolVariablesList
// { // VoiceBotToolVariable
// name: "STRING_VALUE", // required
// handler: { // VoiceBotToolVariableHandler Union: only one key present
// auto: {},
// guided: { // VoiceBotToolVariableGuidedHandler
// description: "STRING_VALUE", // required
// },
// predefined: { // VoiceBotToolVariablePredefinedHandler
// description: "STRING_VALUE", // required
// },
// },
// },
// ],
// },
// kb: { // VoiceBotKnowledgeBase
// knowledgeBaseId: "STRING_VALUE",
// instructions: "STRING_VALUE",
// },
// },
// ],
// },
// dialogflowCx: { // BotDialogflowCxEndpoint
// credentials: "DOCUMENT_VALUE", // required
// agent: "STRING_VALUE", // required
// location: "STRING_VALUE", // required
// language: "STRING_VALUE", // required
// },
// openAiAssistant: { // BotOpenAiAssistantEndpoint
// key: "STRING_VALUE", // required
// assistantId: "STRING_VALUE", // required
// },
// webhook: { // BotWebhookEndpoint
// url: "STRING_VALUE", // required
// secret: "STRING_VALUE", // required
// },
// sqs: { // BotSqsEndpoint
// url: "STRING_VALUE", // required
// key: "STRING_VALUE", // required
// secret: "STRING_VALUE", // required
// },
// },
// capabilities: [
// {// Union: only one key present
// tool: {
// id: "STRING_VALUE", // required
// variables: [
// {
// name: "STRING_VALUE", // required
// handler: {// Union: only one key present
// auto: {},
// guided: {
// description: "STRING_VALUE", // required
// },
// predefined: {
// description: "STRING_VALUE", // required
// },
// },
// },
// ],
// },
// kb: {
// knowledgeBaseId: "STRING_VALUE",
// instructions: "STRING_VALUE",
// },
// },
// ],
// id: "STRING_VALUE", // required
// createdAt: "STRING_VALUE", // required
// updatedAt: "STRING_VALUE",
// },
// };