For full setup and authentication options, see the Installation guide: Installation guide and Authentication.
Parameters
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Caller ID phone number to originate the call from (E.164 format). If omitted, the system default will be used.
Runtime overrides for this call. Use namespaced keys such as
experience.*, listen.*, speak.*, speaker.*, model.*, or agentkit.*.Runtime options
Each item inphoneCalls is a CreatePhoneCallRequest, so each recipient can receive different runtime overrides.
{
"phoneCalls": [
{
"assistant": {
"assistantId": "2230142097179373568",
"version": "latest"
},
"toNumber": "+14155550123",
"args": {
"name": "Jane"
},
"options": {
"experience.greeting": "Hi {{name}}, this is Rapida calling about your appointment.",
"listen.language": "en",
"speak.voice.id": "VOICE_ID_PLACEHOLDER"
}
}
]
}
Usage
import {
AssistantDefinition,
CreateBulkPhoneCall,
ConnectionConfig,
CreateBulkPhoneCallRequest,
CreatePhoneCallRequest,
} from '@rapidaai/react';
const connectionCfg = ConnectionConfig.DefaultConnectionConfig(
ConnectionConfig.WithSDK({ ApiKey: "YOUR_API_KEY_PLACEHOLDER" })
);
const phoneCallRequest = new CreatePhoneCallRequest();
const assistant = new AssistantDefinition();
assistant.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
assistant.setVersion("latest");
phoneCallRequest.setAssistant(assistant);
phoneCallRequest.setTonumber("TO_NUMBER_PLACEHOLDER");
const bulkPhoneCallRequest = new CreateBulkPhoneCallRequest();
bulkPhoneCallRequest.addPhonecalls(phoneCallRequest);
CreateBulkPhoneCall(connectionCfg, bulkPhoneCallRequest)
.then((x) => {
if (x.getSuccess()) {
console.dir(x.getData().toObject());
return;
}
const err = x.getError();
if (err?.getHumanmessage()) console.error(err.getHumanmessage());
})
.catch((x) => {
console.dir(x);
});
import {
AssistantDefinition,
CreateBulkPhoneCall,
ConnectionConfig,
CreateBulkPhoneCallRequest,
CreatePhoneCallRequest,
} from "@rapidaai/nodejs";
let connectionCfg = ConnectionConfig.DefaultConnectionConfig(
ConnectionConfig.WithSDK({
ApiKey: "YOUR_API_KEY_PLACEHOLDER",
})
);
const phoneCallRequest = new CreatePhoneCallRequest();
// define assistant
const assistant = new AssistantDefinition();
assistant.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
assistant.setVersion("latest");
phoneCallRequest.setAssistant(assistant);
phoneCallRequest.setTonumber("TO_NUMBER_PLACEHOLDER");
const bulkPhoneCallRequest = new CreateBulkPhoneCallRequest();
bulkPhoneCallRequest.addPhonecalls(phoneCallRequest);
CreateBulkPhoneCall(connectionCfg, bulkPhoneCallRequest)
.then((x) => {
if (x.getSuccess()) {
console.dir(x.getData().toObject());
return;
}
const err = x.getError();
if (err?.getHumanmessage()) console.error(err.getHumanmessage());
})
.catch((x) => {
console.dir(x);
});
import os
from rapida import (
ConnectionConfig,
create_bulk_phone_call,
CreatePhoneCallRequest,
CreateBulkPhoneCallRequest,
AssistantDefinition,
)
from pprint import pprint
connectionConfig = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk(os.getenv("RAPIDA_API_KEY"))
)
call = CreatePhoneCallRequest(
assistant=AssistantDefinition(
assistantId=2230142097179373568,
version="latest",
),
toNumber="+14155550123",
)
response = create_bulk_phone_call(
client_cfg=connectionConfig,
request=CreateBulkPhoneCallRequest(
phoneCalls=[call],
),
)
pprint(response)
package main
import (
"context"
"fmt"
"os"
clients "github.com/rapidaai/rapida-go/rapida/clients"
connections "github.com/rapidaai/rapida-go/rapida/connections"
protos "github.com/rapidaai/rapida-go/protos"
)
func main() {
// for more authentication check https://doc.rapida.ai/api-reference/authentication
connectionConfig := connections.
DefaultconnectionConfig(connections.WithSDK(os.Getenv("RAPIDA_API_KEY")))
response, err := clients.CreateBulkPhoneCall(context.Background(), connectionConfig, &protos.CreateBulkPhoneCallRequest{
PhoneCalls: []*protos.CreatePhoneCallRequest{
{
Assistant: &protos.AssistantDefinition{
AssistantId: 2227823180112723968,
Version: "latest",
},
ToNumber: "+14155550123",
}},
})
if err != nil {
fmt.Printf("error while creating bulk phone calls: %+v\n", err)
return
}
fmt.Printf("create bulk phone calls response: %+v\n", response)
}
Response
Show child attributes
Show child attributes
Stable, machine-readable numeric code. Represented as a string in JS/TS; parse only if you need numeric comparisons.
Show child attributes
Show child attributes