Initiate a Call
Triggers a single outbound AI voice call to a specified phone number using a published assistant.
This endpoint is non-blocking — it returns immediately once the
call is queued. Use the returned call_id with
Get Call Detail to fetch results once the
call completes.
Optionally, configure automatic retries with retry_count and
retry_interval_minutes. If the call is not connected (for example,
the recipient is busy or does not answer), Twenty2 will re-attempt the
call up to retry_count times, waiting retry_interval_minutes
between each attempt.
Calling window: Calls are only placed between 9:00 AM and 9:00 PM IST to prevent your number from being flagged as spam. Calls triggered outside this window are queued and placed at 9:00 AM the following day. Retry attempts that fall outside the calling window are likewise deferred to the next 9:00 AM.
curl -X POST "https://api.twentytwo.in/api/agent/trigger-outbound-call" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_CREDENTIALS" \
-d '{
"assistant_id": "69de483c68b23495c853b43a",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"input_parameters": {
"customerName": "Rohit"
},
"retry_count": 1,
"retry_interval_minutes": 15
}'
import requests
import json
url = "https://api.twentytwo.in/api/agent/trigger-outbound-call"
headers = {
"Content-Type": "application/json",
"Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
"assistant_id": "69de483c68b23495c853b43a",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"input_parameters": {
"customerName": "Rohit"
},
"retry_count": 1,
"retry_interval_minutes": 15
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.twentytwo.in/api/agent/trigger-outbound-call", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Basic YOUR_CREDENTIALS"
},
body: JSON.stringify({
"assistant_id": "69de483c68b23495c853b43a",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"input_parameters": {
"customerName": "Rohit"
},
"retry_count": 1,
"retry_interval_minutes": 15
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"assistant_id": "69de483c68b23495c853b43a",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"input_parameters": {
"customerName": "Rohit"
},
"retry_count": 1,
"retry_interval_minutes": 15
}`)
req, err := http.NewRequest("POST", "https://api.twentytwo.in/api/agent/trigger-outbound-call", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Basic YOUR_CREDENTIALS")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.twentytwo.in/api/agent/trigger-outbound-call')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
request.body = '{
"assistant_id": "69de483c68b23495c853b43a",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"input_parameters": {
"customerName": "Rohit"
},
"retry_count": 1,
"retry_interval_minutes": 15
}'
response = http.request(request)
puts response.body
{
"success": true,
"statusCode": 201,
"data": {
"call_id": "6a329e7c5a54529ba7f0b4e6",
"message": "Call queued successfully."
}
}
/agent/trigger-outbound-call
Target server for requests. Edit to use your own host.
Username for basic authentication
Password for basic authentication
api_key:api_key_secret
and pass the result in the Authorization header:
``http
Authorization: Basic BASE64(api_key:api_key_secret)
``
Generate your API Key and Secret from **Profile → Integrations →
Build with Twenty2 API → Create new**.
The media type of the request body
The ID of the published assistant to use for the call. To find it, go to My Assistants, click the three-dot menu on the assistant, and select Copy Assistant ID.
The recipient's 10-digit phone number. Do not include
the country code prefix (+91 or 91).
The phone number to call from. Must be an active number in your workspace under Manage Numbers.
Key-value pairs passed into the assistant's script at runtime. Keys must match the Input Variables defined in the assistant's configuration. Required only if the assistant has mandatory input variables.
Number of times to retry the call if it is not connected
(e.g. the recipient is busy or does not answer). Set to
0 or omit to disable retries.
Time in minutes to wait between retry attempts. Only
applies when retry_count is greater than 0.
Request Preview
Response
Response will appear here after sending the request
Authentication
Basic authentication credentials. Base64-encode your credentials in the format api_key:api_key_secret
and pass the result in the Authorization header:
Authorization: Basic BASE64(api_key:api_key_secret)
Generate your API Key and Secret from Profile → Integrations → Build with Twenty2 API → Create new.
Body
The ID of the published assistant to use for the call. To find it, go to My Assistants, click the three-dot menu on the assistant, and select Copy Assistant ID.
69de483c68b23495c853b43aThe recipient's 10-digit phone number. Do not include
the country code prefix (+91 or 91).
9999999999The phone number to call from. Must be an active number in your workspace under Manage Numbers.
9999999999Key-value pairs passed into the assistant's script at runtime. Keys must match the Input Variables defined in the assistant's configuration. Required only if the assistant has mandatory input variables.
{"customerName":"Rohit"}Number of times to retry the call if it is not connected
(e.g. the recipient is busy or does not answer). Set to
0 or omit to disable retries.
1Time in minutes to wait between retry attempts. Only
applies when retry_count is greater than 0.
15