Calls
Send Call with an Agent
Place an outbound call with one of your agents.
POST
/
v1
/
calls
Send Call with an Agent
curl --request POST \
--url https://api.bland.ai/v1/calls \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"voice": "<string>",
"agent_id": "<string>",
"agent_version": "<string>",
"language": "<string>",
"wait_for_greeting": true,
"pronunciation_guide": [
{}
],
"temperature": 123,
"interruption_threshold": 123,
"interruptibility": 123,
"from": "<string>",
"dialing_strategy": {},
"timezone": "<string>",
"start_time": "<string>",
"transfer_phone_number": "<string>",
"transfer_list": {},
"max_duration": 123,
"background_track": "<string>",
"noise_cancellation": true,
"block_interruptions": true,
"record": true,
"ivr_mode": true,
"voicemail": {},
"stream_post_transfer_transcript": true,
"post_call_evals": {},
"summary_prompt": "<string>",
"retry": {},
"request_data": {},
"metadata": {},
"external_id": "<string>",
"webhook": "<string>",
"webhook_events": [
{}
],
"dynamic_data": [
{}
],
"keywords": [
"<string>"
],
"ignore_button_press": true,
"precall_dtmf_sequence": "<string>",
"guard_rails": [
{}
]
}
'import requests
url = "https://api.bland.ai/v1/calls"
payload = {
"phone_number": "<string>",
"voice": "<string>",
"agent_id": "<string>",
"agent_version": "<string>",
"language": "<string>",
"wait_for_greeting": True,
"pronunciation_guide": [{}],
"temperature": 123,
"interruption_threshold": 123,
"interruptibility": 123,
"from": "<string>",
"dialing_strategy": {},
"timezone": "<string>",
"start_time": "<string>",
"transfer_phone_number": "<string>",
"transfer_list": {},
"max_duration": 123,
"background_track": "<string>",
"noise_cancellation": True,
"block_interruptions": True,
"record": True,
"ivr_mode": True,
"voicemail": {},
"stream_post_transfer_transcript": True,
"post_call_evals": {},
"summary_prompt": "<string>",
"retry": {},
"request_data": {},
"metadata": {},
"external_id": "<string>",
"webhook": "<string>",
"webhook_events": [{}],
"dynamic_data": [{}],
"keywords": ["<string>"],
"ignore_button_press": True,
"precall_dtmf_sequence": "<string>",
"guard_rails": [{}]
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
voice: '<string>',
agent_id: '<string>',
agent_version: '<string>',
language: '<string>',
wait_for_greeting: true,
pronunciation_guide: [{}],
temperature: 123,
interruption_threshold: 123,
interruptibility: 123,
from: '<string>',
dialing_strategy: {},
timezone: '<string>',
start_time: '<string>',
transfer_phone_number: '<string>',
transfer_list: {},
max_duration: 123,
background_track: '<string>',
noise_cancellation: true,
block_interruptions: true,
record: true,
ivr_mode: true,
voicemail: {},
stream_post_transfer_transcript: true,
post_call_evals: {},
summary_prompt: '<string>',
retry: {},
request_data: {},
metadata: {},
external_id: '<string>',
webhook: '<string>',
webhook_events: [{}],
dynamic_data: [{}],
keywords: ['<string>'],
ignore_button_press: true,
precall_dtmf_sequence: '<string>',
guard_rails: [{}]
})
};
fetch('https://api.bland.ai/v1/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/v1/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([
'phone_number' => '<string>',
'voice' => '<string>',
'agent_id' => '<string>',
'agent_version' => '<string>',
'language' => '<string>',
'wait_for_greeting' => true,
'pronunciation_guide' => [
[
]
],
'temperature' => 123,
'interruption_threshold' => 123,
'interruptibility' => 123,
'from' => '<string>',
'dialing_strategy' => [
],
'timezone' => '<string>',
'start_time' => '<string>',
'transfer_phone_number' => '<string>',
'transfer_list' => [
],
'max_duration' => 123,
'background_track' => '<string>',
'noise_cancellation' => true,
'block_interruptions' => true,
'record' => true,
'ivr_mode' => true,
'voicemail' => [
],
'stream_post_transfer_transcript' => true,
'post_call_evals' => [
],
'summary_prompt' => '<string>',
'retry' => [
],
'request_data' => [
],
'metadata' => [
],
'external_id' => '<string>',
'webhook' => '<string>',
'webhook_events' => [
[
]
],
'dynamic_data' => [
[
]
],
'keywords' => [
'<string>'
],
'ignore_button_press' => true,
'precall_dtmf_sequence' => '<string>',
'guard_rails' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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://api.bland.ai/v1/calls"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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://api.bland.ai/v1/calls")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Call successfully queued.",
"call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"batch_id": null
}
Overview
Send an AI phone call with one of your agents. The agent’s published version supplies the conversation, its prompt, scenarios, nodes and tools, so this request names the agent and sets anything you want to override for this one call.International calls need a completed purchase: buy at least $5 of credits in the dashboard under Billing, or turn on auto-recharge. Numbers on the Agent Phone Plan call the US and Canada only, regardless of your credit balance.
Headers
string
required
Your API key for authentication. Send it as
Bearer YOUR_API_KEY. A bare Authorization: YOUR_API_KEY with no prefix is also accepted, so older examples keep working. x-api-key is not read and does not authenticate.Get a key from the dashboard. An autonomous agent with no dashboard session can mint its own with the Agent onboarding API.string
A special key for using a BYOT (Bring Your Own Twilio) account. Only required for sending calls from your own Twilio account.Learn more about BYOT here.
Body Parameters
Basic Parameters
string
default:"Karen"
The voice of the AI agent to use. Accepts any form of voice ID, including custom voice clones and voice presets. If you omit it, the call uses Karen.Default voices can be referenced directly by their name instead of an id.Usage example: voice: “Karen”For Bland’s recommended voices, call List voices and pick voices tagged
"Bland Curated" whose service is BTTS_V3.string
required
The agent to call, as a UUID from List Agents. The agent’s published version supplies the prompt, scenarios, nodes and tools that run the conversation.Cannot be combined with
pathway_id or persona_id. Sending more than one is rejected with AGENT_PARAM_CONFLICT, a value that is not a UUID with AGENT_ID_INVALID, and an agent your organization does not own with AGENT_NOT_FOUND.string
default:"production"
Which version of the agent runs the call. Omit it and the call runs the version pinned to production. Requires
A string in none of these forms is rejected before the call is placed, with a message naming the accepted forms.A semver or a branch selector runs the call as the dev environment, so
agent_id, and must be a string: a bare number is rejected.Accepted values
Accepted values
| Value | Runs |
|---|---|
"production" | The version pinned to production. The default. |
"staging" | The version pinned to staging. |
"dev" or "latest" | The newest saved version, published or not. |
"1.2.0" | That exact version, by semver. |
"branch:my-branch" | The head of an open branch. The name is 1 to 64 characters of letters, digits, underscore, dot or hyphen. |
{{env.KEY}} references resolve against dev’s values. The two environment labels run as themselves.The agent’s own tools always drive the call, so the call-level tools parameter is rejected for agent calls.An environment with no pinned version returns AGENT_ENV_UNPINNED. A missing version or branch returns AGENT_VERSION_NOT_FOUND or AGENT_BRANCH_NOT_FOUND.Only calls that omit
agent_version are eligible for experiments. Any explicit selector bypasses assignment, including "production", and is never attributed to a variant.Model Parameters
string
default:"babel-en"
Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings.
Expand to view language options
Expand to view language options
The available language options are as follows:
babel- Babel (All Languages) - Experimental1fluent- Fluent (Multilingual)2en- Englishbabel-en- English (Babel)en-US- English (US)en-GB- English (UK)en-AU- English (Australia)en-NZ- English (New Zealand)en-IN- English (India)es- Spanishbabel-es- Spanish (Babel)es-419- Spanish (Latin America)fr- Frenchbabel-fr- French (Babel)fr-CA- French (Canada)de- Germanbabel-de- German (Babel)el- Greekhi- Hindihi-Latn- Hindi (Latin script)hu- Hungarianja- Japaneseko- Koreanko-KR- Korean (Korea)vi- Vietnamesept- Portuguesept-BR- Portuguese (Brazil)pt-PT- Portuguese (Portugal)zh- Chinese (Mandarin, Simplified)zh-CN- Chinese (Mandarin, Simplified, China)zh-Hans- Chinese (Mandarin, Simplified, Hans)zh-TW- Chinese (Mandarin, Traditional)zh-Hant- Chinese (Mandarin, Traditional, Hant)it- Italiannl- Dutchpl- Polishru- Russiansv- Swedishsv-SE- Swedish (Sweden)da- Danishda-DK- Danish (Denmark)fi- Finnishno- Norwegianid- Indonesianms- Malaytr- Turkishuk- Ukrainianbg- Bulgariancs- Czechro- Romaniansk- Slovakauto- Auto Detect (English & Spanish)
fluent mode is a multilingual option that auto-detects the spoken language and switches between languages on the fly, powered by a multilingual transcription model. Note: prompt your agent to respond in the language it is spoken to.boolean
default:"false"
By default, the agent starts talking as soon as the call connects.When wait_for_greeting is set to true, the agent will wait for the call recipient to speak first before responding.
array
The pronunciation guide is an
array of objects that guides the agent on how to say specific words. Use this to improve clarity for acronyms, names, brand terms, or jargon. [
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": "false",
"spaced": "false"
},
{
"word": "API",
"pronunciation": "A P I",
"case_sensitive": "true",
"spaced": "true"
}
]
Object Parameters
Object Parameters
word: the word you want to guide the LLM on how to pronouncepronunciation: how the AI should pronounce the word, using syllables or space-separated characters. For example,"A P I"ensures each letter is spoken clearly rather than read as a word.case_sensitive: whether or not to consider case. Particularly useful with names. EG: ‘Max’ the name versus ‘max’ the word. Defaults to false.Not required.spaced: whether to match whole words only. When true, “high” will match “high” but not “hightop”. When false, it will match any word that contains “high”. Defaults to true.Not required.
float
default:0.7
A value between 0 and 1 that controls the randomness of the LLM. 0 will cause more deterministic outputs while 1 will cause more random.Example Values: “0.9”, “0.3”, “0.5”
number
default:"500"
Adjusts how patient the AI is when waiting for the user to finish speaking.Lower values mean the AI will respond more quickly, while higher values mean the AI will wait longer before responding.
integer
default:"2"
Controls how readily the AI stops speaking when the caller talks over it. A higher value yields more easily; a lower value holds the turn through more of the caller’s speech.
0: Block. The AI ignores interruptions and finishes speaking (same asblock_interruptions: true).1: Difficult. Harder to interrupt.2: Balanced (default).3: Easy. The AI stops quickly when the caller begins speaking.
Dispatch Parameters
string
Specify a phone number to call from that you own or have uploaded from your Twilio account. Country code is required, spaces or parentheses must be excluded.By default, calls are initiated from a separate pool of numbers owned by Bland. If you are using your own twilio numbers, you must specify a matching encrypted_key in the create call request headers.
object
Controls how the caller number (1.
Automatically selects a 2.
Selects a number from your own pre-configured pool of phone numbers. Designed for organizations that want full control over the caller IDs being used.This is an enterprise only feature, to use this feature contact your Bland representative or reach out to sales.Example:By default, Bland will choose a US-based number from our own pool of numbers.
from) is selected when placing an outbound call.Use this field to influence how the system chooses a number that appears local or relevant to the callee, improving pickup rates. There are two supported strategies:1. local
Automatically selects a from number that matches the callee’s area code for US-based calls. You must have purchased a local dialing add-on in the add-ons section.Example:{
"dialing_strategy": { "type": "local" }
}
2. custom_pooling
Selects a number from your own pre-configured pool of phone numbers. Designed for organizations that want full control over the caller IDs being used.This is an enterprise only feature, to use this feature contact your Bland representative or reach out to sales.Example:{
"dialing_strategy": {
"type": "custom_pooling",
"pool_id": "bd039087-decb-435a-a6e3-ca1ffbf89974"
}
}
string
default:"America/Los_Angeles"
Set the timezone for the call. Handled automatically for calls in the US.This helps significantly with use cases that rely on appointment setting, scheduling, or behaving differently based on the time of day.Timezone options are here in the TZ identifier column.
string
The time you want the call to start. If you don’t specify a time (or the time is in the past), the call will send immediately.Set your time in the format YYYY-MM-DD HH:MM:SS -HH:MM (ex. 2021-01-01 12:00:00 -05:00).The timezone is optional, and defaults to UTC if not specified.Note: Scheduled calls can be cancelled with the POST /v1/calls/:call_id/stop endpoint.
string
A phone number that the agent can transfer to under specific conditions - such as being asked to speak to a human or supervisor.
Prompting Notes
Prompting Notes
For best results:
- Specify conditions that the agent should transfer to a human under (examples are great!)
- In the agent’s prompt, refer to the action solely as “transfer” or “transferring”.
- Alternate phrasing such as “swap” or “switch” can mislead the agent, causing the action to be ignored.
object
Give your agent the ability to transfer calls to a set of phone numbers.Overrides transfer_phone_number if a transfer_list.default is specified.Will default to transfer_list.default, or the chosen phone number.Example usage to route calls to different departments:
{
"transfer_list": {
"default": "+12223334444",
"sales": "+12223334444",
"support": "+12223334444",
"billing": "+12223334444"
}
}
integer
default:"30"
When the call starts, a timer is set for the
max_duration minutes. At the end of that timer, if the call is still active it will be automatically ended.Example Values: 20, 2Audio Parameters
string
Select an audio track that you’d like to play in the background during the call. The audio will play continuously when the agent isn’t speaking, and is incorporated into it’s speech as well.Use this to provide a more natural, seamless, engaging experience for the conversation. We’ve found this creates a significantly smoother call experience by minimizing the stark differences between total silence and the agent’s speech.Options:
- null - Default, will play audible but quiet phone static.
- office - Office-style soundscape. Includes faint typing, chatter, clicks, and other office sounds.
- cafe - Cafe-like soundscape. Includes faint talking, clinking, and other cafe sounds.
- restaurant - Similar to cafe, but more subtle.
- none - Minimizes background noise
boolean
default:"true"
Toggles noise filtering or suppression in the audio stream to filter out background noise.This parameter was previously documented as defaulting to
false. The server has been applying true when the field is omitted, so send it explicitly whenever the behavior matters to you.boolean
default:"false"
When set to
true, the AI will not respond or process interruptions from the user.boolean
default:"false"
To record your phone call, set
record to true. When your call completes, you can access through the recording_url field in the call details or your webhook.Voicemail Parameters
boolean
default:"false"
Set to
true when the number you are calling answers with a phone menu rather than a person.IVR mode changes two things. The agent stops responding on the conversational timing it uses with a human, so it does not talk over a menu’s prompts or fill its pauses. And voicemail handling is suppressed: the effective voicemail action becomes "ignore" no matter what you passed, because a phone tree has no voicemail to leave a message on.Pair it with precall_dtmf_sequence to play a fixed sequence of digits before the call starts, or leave the agent to navigate the menu from its own prompt.amd is a legacy alias for this parameter. It sets the same switch, and passing ivr_mode: true sets amd for you. Prefer ivr_mode: the name says what it does.object
Configuration for handling voicemails during outbound calls. This object controls how the AI behaves when it encounters a voicemail, including whether to leave a message, send an SMS notification, or detect voicemails more intelligently using AI.It has the following parameters:
Example:
message(string): The message the AI will leave if a voicemail is detected. This message will be played after the beep, then the call will end. This field is required ifactionis set toleave_message.
action(enum): What the AI should do when it detects a voicemail. The default is"hangup". Available options:"hangup": Immediately end the call without leaving a message."leave_message": Play themessageand then end the call."leave_message_and_sms": Play themessage, end the call, and send the SMS configured insms. Supply bothmessageandsms: with nosmsconfig this falls back toleave_message."ignore": Continue the call as if no voicemail was detected (used for IVRs or special routing).
-
sms(object): Optional. Configuration for sending an SMS notification when a voicemail is left. Contains:message(string): Required. The body of the SMS message. Keep concise and clear.from(string): Optional. The phone number to send the SMS from (must be a number you own and have SMS permissions for).
tofield, and passing one has no effect.
sensitive(boolean): Whentrue, uses LLM-based analysis to detect frequent voicemails. The default isfalse.
The effective action is derived from the whole request, not from
action alone. Supplying a message implies leaving one, so "action": "hangup" sent alongside a message leaves the message. And ivr_mode forces ignore regardless of action, since a phone menu has no voicemail. See Voicemail for the full precedence.{
"voicemail": {
"message": "Hi, just calling to follow up. Please call us back when you can.",
"action": "leave_message",
"sms": {
"from": "+18005550678",
"message": "We just left you a voicemail. Call us back anytime!"
},
"sensitive": true
}
}
Analysis Parameters
boolean
default:"false"
When
true and the call is transferred to a human, Bland transcribes the conversation after the transfer live and streams it over the Post-Transfer Transcript Stream WebSocket while the transferred conversation is happening. Works for both cold and warm transfers.This option controls the live stream only. To receive the post-transfer transcript in the post-call webhook, subscribe with "post_transfer_transcript" in webhook_events. The two are independent: you can use either one or both.This feature is in limited rollout. If it is not enabled for your organization, the option has no effect.
object
Attach an evals workbench to this call. When the call completes, Bland automatically runs the workbench’s eval configuration against the call, no separate eval-run submission needed.Provide at least one of:
workbench_setup_id(string): The workbench setup to attach. Bland pins the setup’s current published version at call creation, so editing the workbench mid-call does not change what gets evaluated.workbench_setup_version_id(string): An exact published workbench setup version to pin.
record: false alongside post_call_evals, the request is rejected; otherwise recording is enabled automatically.The post-call webhook acknowledges the attachment with post_call_evals: { workbench_setup_id, workbench_setup_version_id, status: "pending" }. Eval scores arrive later on a separate evals webhook event once the run completes.Example:{
"post_call_evals": {
"workbench_setup_id": "b7c2e1d4-8f3a-4c9e-9a2b-1e5f6d7c8a9b"
}
}
Post Call Parameters
string
(Optional) Custom instructions for how the call summary should be generated after the call completes. Use this to provide specific guidance or context for the AI when writing the post-call summary. Maximum length: 2000 characters.Example:
{
"summary_prompt": "Summarize the call in 2-3 sentences, focusing on the customer's main concern and any next steps discussed."
}
object
If the call goes to voicemail, you can set up the call to retry, after a configurable delay. You can also update the voicemail_action, and voicemail_message in the retry object, for the re-tried call.Takes in the following parameters:
wait(integer): The delay in seconds before the call is retried.voicemail_action(enum): The action to take when the call goes to voicemail. Options:hangup,leave_message,leave_message_and_sms,ignore.voicemail_message(string): The message to leave when the call goes to voicemail.
{
"retry": {
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
}
}
Advanced Parameters
object
Custom key-value data you send with the call. The runtime interpolates these as An agent whose greeting reads
{{variable}} inside the agent’s prompt, scenarios, nodes and tools.This is separate from the agent’s environment variables, which are written as {{env.KEY}} and resolve from the environment the call runs as. A referenced environment key with no value fails the call with AGENT_VARIABLE_UNRESOLVED.{
"agent_id": "41282230-dd13-4546-8785-0afa19b708c0",
"phone_number": "+15551234567",
"request_data": {
"name": "John Doe"
}
}
Hello, {{name}} then opens with “Hello, John”.object
Add any additional information you want to associate with the call. This data is accessible for all calls, regardless of if they are picked up or not. This can be used to track calls or add custom data to the call.Anything that you put here will be returned in the post call webhook under metadata.Example:
{
"metadata": {
"campaign_id": "1234",
"source": "web"
}
}
string
Your own identifier for the call, such as a CRM interaction ID or a contact center session ID. Use it to look the call up later without storing Bland’s
call_id.Must be a non-empty string of at most 256 printable characters. The call is returned in Call details, List calls, and the post-call webhook with this external_id.{
"external_id": "crm-interaction-48213"
}
string
When the call ends, call information is sent to this webhook URL.
array
Specify which events you want to stream to the webhook, during the call.Options:
Citation Webhook Requirements:
- Include
citationsfor any citation webhooks (sent separately after call completion) - For delayed post-call webhooks with citations, you need
citations+ dashboard delay toggle enabled
queuecalllatencywebhooktooldynamic_datacitations(Required for any citation webhooks)evals(Eval scores from an attached evals workbench, sent as a separate webhook when the run completes)post_transfer_transcript(Adds the post-transfer conversation to the post-call webhook when the call is transferred to a human; see Post-transfer transcript. Requires call recording:recordis enabled automatically when unset, and passingrecord: falsealongside this subscription returns a 400. In limited rollout: if not enabled for your organization, the subscription has no effect.)
// ex 1
{
"message": "Call enqueued",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "queue",
"log_level": "info"
}
// ex 1
{
"message": "Call connected",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "call",
"log_level": "info"
}
// ex 2
{
"message": "Sending first sentence: Hello, thank you for reaching out. I'd like to get to know you a bit better. How are you feeling today?",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "call",
"log_level": "info"
}
// ex 3
{
"message": "Agent speech: Hello, thank you for reaching out.",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "call",
"log_level": "info"
}
// ex 4
{
"message": "Handling user speech: Yeah. I'm thirty six. And I'm five foot nine.",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "call",
"log_level": "info"
}
// ex 5
{
"message": "Webhook Response: 200 | Webhook Response Data: [object Object] | Response Time: 689ms",
"call_id": "87654321-4321-4321-4321-cba987654321",
"category": "call",
"log_level": "info"
}
// ex 1
{
"message": "TTS: 218ms",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "latency",
"log_level": "performance"
}
// ex 2
{
"message": "LLM: 266ms",
"call_id": "12345678-1234-1234-1234-123456789abc",
"category": "latency",
"log_level": "performance"
}
{
"message": "Storing dynamic data messages: \n\n answer : \"true\"",
"call_id": "87654321-4321-4321-4321-cba987654321",
"category": "call",
"log_level": "info"
}
{
"message": "Executing custom tool: Test Tool 4 with input: [object Object]",
"call_id": "abcdef12-3456-7890-abcd-ef1234567890",
"category": "call",
"log_level": "info"
}
{
"message": "Storing dynamic data: \n\n vector_data : {\"data\":{\"results\":[{\"id\":\"fedcba98-7654-3210-fedc-ba9876543210\",\"input_text\":\"Here are details on the restaurant...\",\"similarity\":0.103339002763233,\"chunk_index\":0}]},\"errors\":null}",
"call_id": "abcdef12-3456-7890-abcd-ef1234567890",
"category": "call",
"log_level": "info"
}
{
"call_id": "12345678-1234-1234-1234-123456789abc",
"user_id": "11111111-2222-3333-4444-555555555555",
"event_type": "citations",
"timestamp": "2025-07-03T16:41:15.231Z",
"citations": [
{
"call_id": "12345678-1234-1234-1234-123456789abc",
"variable_name": "User height",
"variable_type": "boolean",
"value": true,
"cited_utterances": [
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"idx": 3,
"start_time": 24.096,
"end_time": 27.424,
"confidence": 0.17166666666666666,
"channel": 1,
"transcript": "I am 36 and I am 5'9\".",
"speaker_id": "SPEAKER_1_0",
"speaker_name": null,
"speaker_description": null,
"topics": [
"customer_information_provided"
],
"topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}",
"utterance_type": "answer"
}
],
"schema_id": "99999999-8888-7777-6666-555555555555"
},
{
"call_id": "12345678-1234-1234-1234-123456789abc",
"variable_name": "Caller Age",
"variable_type": "number",
"value": 36,
"cited_utterances": [
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"idx": 3,
"start_time": 24.096,
"end_time": 27.424,
"confidence": 0.17166666666666666,
"channel": 1,
"transcript": "I am 36 and I am 5'9\".",
"speaker_id": "SPEAKER_1_0",
"speaker_name": null,
"speaker_description": null,
"topics": [
"customer_information_provided"
],
"topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}",
"utterance_type": "answer"
},
{
"id": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff",
"idx": 4,
"start_time": 30.56,
"end_time": 35.455,
"confidence": 0.5672727272727273,
"channel": 0,
"transcript": "All right. So you're 36 years old and five foot nine. That's great. How's your day been so far? Anything exciting happened?",
"speaker_id": "SPEAKER_0_0",
"speaker_name": null,
"speaker_description": null,
"topics": [
"day_review_inquiry"
],
"topics_meta": "{\"day_review_inquiry\":\"agent inquiring about the customer's day and any exciting events\"}",
"utterance_type": "question"
}
],
"schema_id": "99999999-8888-7777-6666-555555555555"
},
{
"call_id": "12345678-1234-1234-1234-123456789abc",
"variable_name": "Caller feeling",
"variable_type": "string",
"value": null,
"cited_utterances": [],
"schema_id": "99999999-8888-7777-6666-555555555555"
}
]
}
object[]
Integrate data from external APIs into your agent’s knowledge.Set to
null or an empty string to clear dynamic data settings. "dynamic_data": [
{
"url": "endpoint",
"method": "GET",
"body": [],
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"query": [],
"cache": true,
"response_data": [
{
"context": "",
"data": "$",
"name": ""
}
]
}
],
string[]
default:"[]"
These words will be boosted in the transcription engine - recommended for proper nouns or words that are frequently mis-transcribed.For example, if the word Blandy is frequently transcribed as a homonym like “Reese” you could do this:For stronger keyword boosts, you can place a colon then a boost factor after the word. The default boost factor is 2.
{
"keywords": ["Blandy"]
}
{
"keywords": ["Blandy:3"]
}
boolean
default:"false"
When
This disables any in-call actions triggered by keypad input, such as menu navigation or transfers.
Useful when your agent should handle the entire call conversationally, without responding to button presses.
true, the system will ignore DTMF input (Dual-Tone Multi-Frequency), the tones generated when a user presses keys on their phone keypad (e.g., 0-9, *, #).This disables any in-call actions triggered by keypad input, such as menu navigation or transfers.
Useful when your agent should handle the entire call conversationally, without responding to button presses.
string
A sequence of DTMF digits that will be played before the call starts. Acceptable characters are 0-9, *, #, and w, where w is a pause of 0.5 seconds. Only available on calls that leave over Twilio, and rejected with a 400 on any other platform. Example:
{
"precall_dtmf_sequence": "1234567890*#w"
}
array
Configure guard rails to monitor the call for compliance violations and trigger actions automatically. Guard rails continuously analyze AI and user responses during the call.Learn more about guard rails in the Guard Rails documentation.Each item in the array can be one of three types:
Full example with multiple guard rails:
TCPA Guard Rails
TCPA Guard Rails
tcpa:ai_disclosure- AI must disclose it’s an AItcpa:self_introduction- Must identify who is callingtcpa:recording_disclosure- Must disclose the call is being recordedtcpa:opt_out- This out-of-the-box guard rail is different as it’s not time-based and instead monitors the entire conversation to see if the agent continues to engage in the conversation after the user opts out.config.end_secondsis not needed for this type.
{
"type": "tcpa:ai_disclosure",
"actions": [
{ "type": "end_call" }
],
"config": {
"end_seconds": 30
}
}
| Field | Type | Description |
|---|---|---|
type | string | One of: tcpa:ai_disclosure, tcpa:self_introduction, tcpa:recording_disclosure |
actions | array | Actions to take if disclosure is NOT made within the time window |
config.end_seconds | number | Time window in seconds (default: 30) |
Custom Guard Rails (Enterprise)
Custom Guard Rails (Enterprise)
Custom guard rails with your own prompt. Enterprise customers can create up to 5 custom guard rails.
{
"type": "custom",
"prompt": "Flag if the agent provides any medical advice or diagnosis...",
"actions": [
{ "type": "transfer", "config": { "phone_number": "+15551234567" } }
]
}
| Field | Type | Description |
|---|---|---|
type | string | custom |
prompt | string | Your custom detection prompt |
actions | array | Actions to take when the guard rail triggers |
Action Types
Action Types
Each guard rail requires an
actions array. Available action types:| Action Type | Description | Config |
|---|---|---|
end_call | Immediately terminate the call | None |
transfer | Transfer to a human agent | { "phone_number": "+15551234567" } |
move_to_node | Jump to a specific node in the agent | { "node_id": "node-uuid" } |
{
"guard_rails": [
{
"type": "tcpa:ai_disclosure",
"actions": [{ "type": "end_call" }],
"config": { "end_seconds": 30 }
},
{
"type": "tcpa:opt_out",
"actions": [{ "type": "end_call" }]
},
{
"type": "custom",
"prompt": "Flag if the agent makes any investment recommendations",
"actions": [
{ "type": "transfer", "config": { "phone_number": "+15551234567" } }
]
}
]
}
Response
string
Can be
success or error.string
A message explaining the status of the call.
string
A unique identifier for the call (present only if status is
success).string
The batch ID of the call (present only if status is
success).array
For validation errors, a detailed list of each field with an error and it’s error message.Example:
{
"status": "error",
"message": "Invalid parameters",
"errors": [
"Missing required parameter: phone_number.",
"Phone number must be a string or number."
]
}
{
"status": "success",
"message": "Call successfully queued.",
"call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"batch_id": null
}
Error Codes Reference
View All Error Codes
View All Error Codes
This section documents all possible error codes and HTTP status codes you can receive when making a POST request to
/v1/calls.Authentication & Authorization Errors
object
agent_id was sent alongside pathway_id or persona_id.{
"status": "error",
"code": "AGENT_PARAM_CONFLICT",
"message": "agent_id cannot be combined with pathway_id or persona_id"
}
object
agent_version was not a semantic version, a branch:<name>, or one of the four labels. It must be a string; a bare number is rejected.{
"status": "error",
"message": "Invalid parameters. Error: [\n \"agent_version must be a semantic version like '1.2.0', 'branch:<name>', or one of 'dev', 'latest', 'staging', 'production'.\"\n]"
}
object
The environment named by
agent_version has no version pinned to it.{
"status": "error",
"code": "AGENT_ENV_UNPINNED",
"message": "Environment has no pinned version"
}
object
No agent in your organization matches
agent_id. A malformed id returns AGENT_ID_INVALID instead, and a missing version or branch returns AGENT_VERSION_NOT_FOUND or AGENT_BRANCH_NOT_FOUND.{
"status": "error",
"code": "AGENT_NOT_FOUND",
"message": "Agent not found"
}
object
Authentication failed due to missing or invalid API key.Common causes:
{
"data": null,
"errors": [
{
"error": "AUTH_FAILURE",
"message": "Unauthorized"
}
]
}
- Missing Authorization header
- Invalid API key
- Expired API key
object
Account has been flagged or banned for security purposes.
{
"status": "error",
"message": "The Bland Team has flagged your account for security purposes. As a precautionary measure against recent heightened malicious use cases, we have flagged your account for review and temporarily blocked from dispatching calls. If you need to be unblocked urgently, please email us at support@bland.ai with your account phone number."
}
object
Calls sent too frequently to the same number.
{
"status": "error",
"message": "Calls can only be sent every 10 seconds to the same number. Please try again in a few seconds."
}
object
Rate limit exceeded for your account.
{
"status": "error",
"message": "Rate limit exceeded"
}
object
Attempting to call a blacklisted number.
{
"status": "error",
"message": "This number is blacklisted."
}
object
Rate limits for newly created accounts.
{
"status": "error",
"message": "Rate limit exceeded for newly created accounts. Please try again soon."
}
object
International calling rate limit exceeded.
{
"status": "error",
"message": "International rate limit exceeded for your account type."
}
object
Required parameters are missing from the request.Required parameters:
{
"status": "error",
"message": "Invalid parameters. Error: [\"Missing required parameter: phone_number.\"]",
"errors": ["Missing required parameter: phone_number."]
}
phone_number(always required)agent_id(names the agent that makes the call)
object
Field values are the wrong data type according to TypeBox validation.Common type validation errors:
{
"status": "error",
"message": "Record must be a boolean"
}
"Record must be a boolean""Max duration must be a number""Temperature must be a number""Dynamic data must be an array""Metadata must be a record of string keys and any values"
object
Voicemail action must be one of the allowed values.
{
"status": "error",
"message": "Invalid voicemail action. Must be one of: hangup, leave_message, leave_message_and_sms, ignore"
}
object
Numeric values are outside their allowed ranges.
{
"status": "error",
"message": "Max duration must be at least 1"
}
object
Precall DTMF sequence contains invalid characters.Valid DTMF characters: 0-9, *, #, w (wait)
{
"status": "error",
"message": "Precall DTMF sequence must be a valid DTMF sequence"
}
object
Start time must be a valid ISO date-time string.
{
"status": "error",
"message": "Start time must be a valid date-time format"
}
object
Webhook URL format is invalid.
{
"status": "error",
"message": "Webhook must be a valid URI"
}
object
From number doesn’t match phone number pattern.
{
"status": "error",
"message": "Invalid from number format"
}
object
Transfer phone number format validation error.
{
"status": "error",
"message": "Invalid transfer phone number format"
}
object
Transfer list contains phone numbers with invalid format.
{
"status": "error",
"message": "Invalid phone number format in transfer list"
}
object
Request contains fields that are not allowed in the schema.
{
"status": "error",
"message": "Additional properties are not allowed"
}
object
Phone number format is invalid, missing country code, or invalid length.Other variations:Common causes:
{
"status": "error",
"message": "Invalid phone number. Please include a country code if outside the US."
}
{
"status": "error",
"message": "Invalid phone number. `+1234567890123456789` has these validation errors: [specific errors]"
}
{
"error": "Invalid phone number format"
}
- Phone number too long (>15 digits) or too short (<7 digits)
- Invalid characters in phone number
- Missing country code for international numbers
- Phone number fails Twilio validation
object
Language code is not supported.
{
"status": "error",
"message": "Invalid language code"
}
object
Pronunciation guide format is incorrect.
{
"status": "error",
"message": "Invalid pronunciation guide type."
}
object
Feature not supported on the specified platform.
{
"status": "error",
"message": "Precall DTMF sequence is not supported for this platform."
}
object
The ‘from’ number is invalid or not owned by your account.
{
"status": "error",
"message": "Invalid 'from' - must be a phone number string with 10 or 12 digits."
}
object
Attempting to call a number on the Do Not Call list.
{
"status": "DNC Error",
"message": "Number found in DNC list. You cannot dial sensitive numbers. More attempts will result in being blocked."
}
object
Transfer list configuration errors.
{
"status": "error",
"message": "Transfer list must be an object."
}
{
"status": "error",
"message": "Invalid transfer phone number."
}
{
"status": "error",
"message": "Transfer phone number cannot be the same as the phone number."
}
object
Retry configuration must be an object.
{
"status": "error",
"message": "Retry must be an object."
}
object
Version number must be a valid number.
{
"status": "error",
"message": "version_number must be a number."
}
object
The ‘from’ number format is invalid.
{
"status": "error",
"message": "Invalid from phone number."
}
object
Boolean parameters must be true/false or string equivalents.Valid for parameters:
{
"status": "error",
"message": "wait_for_greeting must be a boolean."
}
wait_for_greeting, record, answered_by_enabled, block_interruptions, sensitive_voicemail_detection, ignore_button_pressobject
First sentence must be a string.
{
"status": "error",
"message": "First sentence must be a string. type: [actual_type]"
}
object
Voicemail message must be a string.
{
"status": "error",
"message": "Voicemail message must be a string. type: [actual_type]"
}
object
Voicemail SMS configuration errors.
{
"status": "error",
"message": "voicemail_sms must be an object. type: [actual_type]"
}
{
"status": "error",
"message": "voicemail_sms.message must be a string. type: [actual_type]"
}
{
"status": "error",
"message": "voicemail_sms.from must be a string. type: [actual_type]"
}
object
Interruption threshold must be a number.
{
"status": "error",
"message": "interruption_threshold must be a number."
}
object
Webhook URL must be a valid HTTPS URL.
{
"status": "error",
"message": "webhook must be a string that starts with https://."
}
object
Request data must be an object.
{
"status": "error",
"message": "request_data must be an object."
}
object
Metadata must be an object.
{
"status": "error",
"message": "metadata must be an object."
}
object
Voice parameter must be a string.
{
"status": "error",
"message": "Voice must be a string."
}
object
Voicemail action must be one of the allowed values.
{
"status": "error",
"message": "Invalid voicemail_action. Options are: [list_of_options]."
}
object
Keywords configuration errors.
{
"status": "error",
"message": "Keywords must be an array of strings."
}
{
"status": "error",
"message": "Keywords must be strings."
}
{
"status": "error",
"message": "Keywords each must be less than 100 characters: [keyword]"
}
{
"status": "error",
"message": "Keywords must be in the format 'string' or 'string:number'."
}
{
"status": "error",
"message": "Keyword boosts with a colon must have a valid integer for the boost rate."
}
{
"status": "error",
"message": "At most 20 keywords can be added."
}
object
Timezone validation errors.
{
"status": "error",
"message": "Timezone must be a string."
}
{
"status": "error",
"message": "Invalid timezone: [error_message]"
}
object
Summary prompt validation errors.
{
"status": "error",
"message": "Summary prompt must be a string."
}
{
"status": "error",
"message": "Summary prompt must be less than 2000 characters."
}
object
Start time scheduling validation errors.
{
"status": "error",
"message": "start_time must be a string."
}
{
"status": "error",
"message": "Invalid start_time."
}
{
"status": "error",
"message": "Calls must be scheduled at least 5 minutes in advance, or more"
}
object
Background track validation errors.
{
"status": "error",
"message": "background_track must be a string."
}
{
"status": "error",
"message": "Invalid background_track option. Options are: [list_of_options]."
}
object
Max duration validation errors.
{
"status": "error",
"message": "max_duration must be a number."
}
{
"status": "error",
"message": "max_duration must be a positive number."
}
{
"status": "error",
"message": "max_duration must be at most 12 hours."
}
object
Dynamic data or tools configuration is invalid.
{
"status": "error",
"message": "Unable to parse dynamic data/tools."
}
{
"status": "error",
"message": "Invalid tools: [error_message]"
}
{
"status": "error",
"message": "Invalid dynamic data: [error_message]"
}
object
Content failed moderation and was flagged as inappropriate.
{
"status": "error",
"message": "Flagged Node: [flagged content]"
}
object
Attempting to call emergency or sensitive numbers.
{
"status": "error",
"message": "Cannot dial sensitive numbers. More attempts will result in being blocked."
}
object
Server unable to save the request body or call data.
{
"status": "error",
"message": "Unable to save request body."
}
object
Call could not be queued for processing.
{
"status": "error",
"message": "Unable to queue call."
}
object
Parent call for warm transfer has already completed or doesn’t exist.
{
"status": "error",
"message": "Parent call has completed or does not exist. Warm Transfer Request Cancelled"
}
object
General server errors and catch-all error handlers.Typical scenarios:
{
"status": "error",
"message": "Internal server error during flagging process"
}
- Uncaught exceptions in call processing
- Third-party service failures
- Memory allocation or resource exhaustion errors
- Network connectivity issues
object
Basic call parameters validation from the main validation function.
{
"status": "error",
"message": "Call parameters must be an object."
}
object
No billing record found for your account.
{
"status": "error",
"message": "No billing record found."
}
object
Account balance is insufficient for the call.
{
"status": "error",
"message": "Insufficient balance."
}
object
The objective parameter failed validation (returns validation details).
{
"error": "OBJECTIVE_VALIDATION_ERROR",
"details": "Custom validation response"
}
object
Failed to establish connection with Twilio services.
{
"status": "error",
"message": "Error in creating Twilio connection."
}
object
The encrypted key provided is invalid or corrupted.
{
"status": "error",
"message": "Invalid `encrypted_key`. Please use the correct key for your account."
}
object
General internal server error during call processing.
{
"status": "error",
"message": "Error triggering call. Please check your twilio account for errors"
}
object
Error occurred during the content flagging process.
{
"status": "error",
"message": "Internal server error during flagging process"
}
object
Error retrieving Bring Your Own Twilio (BYOT) phone number.
{
"status": "error",
"message": "Error in getting BYOT Number"
}
object
Error retrieving dialer data from encrypted key.
{
"status": "error",
"message": "Error in getting dialer data from encrypted key"
}
object
Error fetching user data for account verification.Other variations:
{
"status": "error",
"message": "Error in fetching user data"
}
{
"status": "error",
"message": "Error in fetching parent user data"
}
object
Missing retry attempt information for retry calls.
{
"status": "error",
"message": "Retry attempt not provided for retry call: {call_id}"
}
object
Transfer phone number is invalid.
{
"status": "error",
"message": "Invalid transfer_phone_number."
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Send Call with an Agent
curl --request POST \
--url https://api.bland.ai/v1/calls \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"voice": "<string>",
"agent_id": "<string>",
"agent_version": "<string>",
"language": "<string>",
"wait_for_greeting": true,
"pronunciation_guide": [
{}
],
"temperature": 123,
"interruption_threshold": 123,
"interruptibility": 123,
"from": "<string>",
"dialing_strategy": {},
"timezone": "<string>",
"start_time": "<string>",
"transfer_phone_number": "<string>",
"transfer_list": {},
"max_duration": 123,
"background_track": "<string>",
"noise_cancellation": true,
"block_interruptions": true,
"record": true,
"ivr_mode": true,
"voicemail": {},
"stream_post_transfer_transcript": true,
"post_call_evals": {},
"summary_prompt": "<string>",
"retry": {},
"request_data": {},
"metadata": {},
"external_id": "<string>",
"webhook": "<string>",
"webhook_events": [
{}
],
"dynamic_data": [
{}
],
"keywords": [
"<string>"
],
"ignore_button_press": true,
"precall_dtmf_sequence": "<string>",
"guard_rails": [
{}
]
}
'import requests
url = "https://api.bland.ai/v1/calls"
payload = {
"phone_number": "<string>",
"voice": "<string>",
"agent_id": "<string>",
"agent_version": "<string>",
"language": "<string>",
"wait_for_greeting": True,
"pronunciation_guide": [{}],
"temperature": 123,
"interruption_threshold": 123,
"interruptibility": 123,
"from": "<string>",
"dialing_strategy": {},
"timezone": "<string>",
"start_time": "<string>",
"transfer_phone_number": "<string>",
"transfer_list": {},
"max_duration": 123,
"background_track": "<string>",
"noise_cancellation": True,
"block_interruptions": True,
"record": True,
"ivr_mode": True,
"voicemail": {},
"stream_post_transfer_transcript": True,
"post_call_evals": {},
"summary_prompt": "<string>",
"retry": {},
"request_data": {},
"metadata": {},
"external_id": "<string>",
"webhook": "<string>",
"webhook_events": [{}],
"dynamic_data": [{}],
"keywords": ["<string>"],
"ignore_button_press": True,
"precall_dtmf_sequence": "<string>",
"guard_rails": [{}]
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
voice: '<string>',
agent_id: '<string>',
agent_version: '<string>',
language: '<string>',
wait_for_greeting: true,
pronunciation_guide: [{}],
temperature: 123,
interruption_threshold: 123,
interruptibility: 123,
from: '<string>',
dialing_strategy: {},
timezone: '<string>',
start_time: '<string>',
transfer_phone_number: '<string>',
transfer_list: {},
max_duration: 123,
background_track: '<string>',
noise_cancellation: true,
block_interruptions: true,
record: true,
ivr_mode: true,
voicemail: {},
stream_post_transfer_transcript: true,
post_call_evals: {},
summary_prompt: '<string>',
retry: {},
request_data: {},
metadata: {},
external_id: '<string>',
webhook: '<string>',
webhook_events: [{}],
dynamic_data: [{}],
keywords: ['<string>'],
ignore_button_press: true,
precall_dtmf_sequence: '<string>',
guard_rails: [{}]
})
};
fetch('https://api.bland.ai/v1/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/v1/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([
'phone_number' => '<string>',
'voice' => '<string>',
'agent_id' => '<string>',
'agent_version' => '<string>',
'language' => '<string>',
'wait_for_greeting' => true,
'pronunciation_guide' => [
[
]
],
'temperature' => 123,
'interruption_threshold' => 123,
'interruptibility' => 123,
'from' => '<string>',
'dialing_strategy' => [
],
'timezone' => '<string>',
'start_time' => '<string>',
'transfer_phone_number' => '<string>',
'transfer_list' => [
],
'max_duration' => 123,
'background_track' => '<string>',
'noise_cancellation' => true,
'block_interruptions' => true,
'record' => true,
'ivr_mode' => true,
'voicemail' => [
],
'stream_post_transfer_transcript' => true,
'post_call_evals' => [
],
'summary_prompt' => '<string>',
'retry' => [
],
'request_data' => [
],
'metadata' => [
],
'external_id' => '<string>',
'webhook' => '<string>',
'webhook_events' => [
[
]
],
'dynamic_data' => [
[
]
],
'keywords' => [
'<string>'
],
'ignore_button_press' => true,
'precall_dtmf_sequence' => '<string>',
'guard_rails' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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://api.bland.ai/v1/calls"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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://api.bland.ai/v1/calls")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"voice\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_version\": \"<string>\",\n \"language\": \"<string>\",\n \"wait_for_greeting\": true,\n \"pronunciation_guide\": [\n {}\n ],\n \"temperature\": 123,\n \"interruption_threshold\": 123,\n \"interruptibility\": 123,\n \"from\": \"<string>\",\n \"dialing_strategy\": {},\n \"timezone\": \"<string>\",\n \"start_time\": \"<string>\",\n \"transfer_phone_number\": \"<string>\",\n \"transfer_list\": {},\n \"max_duration\": 123,\n \"background_track\": \"<string>\",\n \"noise_cancellation\": true,\n \"block_interruptions\": true,\n \"record\": true,\n \"ivr_mode\": true,\n \"voicemail\": {},\n \"stream_post_transfer_transcript\": true,\n \"post_call_evals\": {},\n \"summary_prompt\": \"<string>\",\n \"retry\": {},\n \"request_data\": {},\n \"metadata\": {},\n \"external_id\": \"<string>\",\n \"webhook\": \"<string>\",\n \"webhook_events\": [\n {}\n ],\n \"dynamic_data\": [\n {}\n ],\n \"keywords\": [\n \"<string>\"\n ],\n \"ignore_button_press\": true,\n \"precall_dtmf_sequence\": \"<string>\",\n \"guard_rails\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Call successfully queued.",
"call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"batch_id": null
}