POST
/
v1
/
batches
curl --request POST \
  --url https://api.bland.ai/v1/batches \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "base_prompt": "<string>",
  "call_data": [
    {}
  ],
  "label": "<string>",
  "campaign_id": "<string>",
  "test_mode": true
}'
{
    "message": "success",
    "batch_id": "3p$7rQ3p9sT5bzmF-gen-batch"
}

Headers

authorization
string
required

Your API key for authentication.

Body

base_prompt
string
required

This is the prompt or task used for all the phone calls in the request. Information can be inserted into it surrounding variable names with {{curly braces}}.

Example:

"You are calling {{business}} to renew their subscription to {{service}} before it expires on {{date}}."
call_data
array
required

Define a list of calls to make and their properties. Each call in call_data MUST have a “phone_number” property. Properties are case-sensitive.

Example:

[
  {   
    "phone_number": "1234567890",
    "business": "ABC Corp",
    "service": "Netflix",
    "date": "September 4th"
  },
  {
    "phone_number": "32176540987",
    "business": "XYZ inc.",
    "service": "Window Cleaning",
    "date": "December 20th"
  }
]
label
string

Adds a user-friendly label to your batch to keep track of it’s original intention. This can help differentiate multiple call batches that are part of the same Campaign. Shown when a batch is retreived.

campaign_id
string

Use campaign_id to organize related batches together. This can be set manually or auto-generated through Campaigns.

test_mode
boolean
default: "false"

When this is set to true, only the first call of call_data will be dispatched. A common use case is to set the first phone_number value to your own to confirm everything’s set up properly.

Includes additional information in the response when true so that it’s easier to find any issues.

*

All other parameters supported by the Send Call endpoint are supported here as well. They will be applied to each call in the batch.

Response

message
string

If anything other than “success” is returned, there was an error.

batch_id
string

The unique identifier for the batch.