> For the complete documentation index, see [llms.txt](https://twentytwo.documentationai.com/llms.txt).
> Use it to discover all available pages before exploring further.

# 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](#operation/getCallDetail) 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.




<PlaygroundComponent />

<AuthParams schemes={["basicAuth"]}>
<AuthType scheme="basicAuth">
<ParamField header="Authorization" param-type="string" required="true">
Basic authentication credentials. Base64-encode your credentials in the format `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**.

</ParamField>
</AuthType>
</AuthParams>

<BodyParams contentTypes={["application/json"]} defaultType="application/json">
  <ContentType type="application/json">
<ParamField showLocation="false" body="assistant_id" param-type="string" required="true" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6IjY5ZGU0ODNjNjhiMjM0OTVjODUzYjQzYSJ9XQ==">
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**.

</ParamField>

<ParamField showLocation="false" body="callee_phone" param-type="string" required="true" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6Ijk5OTk5OTk5OTkifV0=">
The recipient's 10-digit phone number. Do not include
the country code prefix (`+91` or `91`).

</ParamField>

<ParamField showLocation="false" body="caller_phone" param-type="string" required="true" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6Ijk5OTk5OTk5OTkifV0=">
The phone number to call from. Must be an active number
in your workspace under **Manage Numbers**.

</ParamField>

<ParamField showLocation="false" body="input_parameters" param-type="object" required="false" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6eyJjdXN0b21lck5hbWUiOiJSb2hpdCJ9fV0=">
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.

</ParamField>

<ParamField showLocation="false" body="retry_count" param-type="integer" required="false" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6MX1d">
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.

</ParamField>

<ParamField showLocation="false" body="retry_interval_minutes" param-type="integer" required="false" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6MTV9XQ==">
Time in minutes to wait between retry attempts. Only
applies when `retry_count` is greater than `0`.

</ParamField>
  </ContentType>
</BodyParams>

<Request tabs="curl,python,javascript,go,ruby">

```bash
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
}'
```

```python
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())
```

```javascript
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);
```

```go
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)
}
```

```ruby
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
```

</Request>

### Responses

<div data-component="ResponsesCollection"><Expandable title="201 - Call queued successfully." default-open="false">

<ResponseField name="success" field-type="boolean" required="false">

</ResponseField>

<ResponseField name="statusCode" field-type="integer" required="false">

</ResponseField>

<ResponseField name="data" field-type="object" required="false">

<Expandable title="Object Properties" default-open="false">

<ResponseField name="call_id" field-type="string" required="false">
Unique identifier for the queued call. Pass this
to [Get Call Detail](#operation/getCallDetail) to
retrieve results once the call completes.

</ResponseField>

<ResponseField name="message" field-type="string" required="false">

</ResponseField>

</Expandable>
</ResponseField>

</Expandable>

</div>

<Response tabs="201">

```json
{
  "success": true,
  "statusCode": 201,
  "data": {
    "call_id": "6a329e7c5a54529ba7f0b4e6",
    "message": "Call queued successfully."
  }
}
```

</Response>

