CallsInitiate a Call

Initiate a Call

Trigger a single outbound call using a published assistant. Calls are non-blocking — the API returns immediately once the call is queued.

curl -X POST "https://api.twentytwo.in/api/agent/trigger-outbound-call" \
  -H "Content-Type: application/json" \
  -H "x-workspace-id: 69b671241b2dacf0c0f15885" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "agent_id": "69de483c68b23495c853b43a",
  "callee_phone": "9999999999",
  "caller_phone": "9999999999",
  "input_parameters": {
    "agentName": "Rohit"
  }
}'
{
  "success": true,
  "call_id": "call_9c4d7e12ab",
  "status": "initiated",
  "message": "Call queued successfully."
}
POST
/agent/trigger-outbound-call
POST
Basic Authentication
Usernamestring
Required

Username for basic authentication

Passwordpassword
Required

Password for basic authentication

Pass your Basic auth token in the Authorization header along with your workspace ID in the x-workspace-id header on every request.
Content-Typestring
Required

The media type of the request body

Options: application/json
header
x-workspace-idstring
Required

Your Twenty2 workspace ID

agent_idstring
Required

The ID of the published agent to use for the call.

callee_phonestring
Required

The phone number to call (recipient), without country code.

caller_phonestring
Required

The phone number to call from, without country code. Must be active in your Twenty2 workspace.

input_parametersobject

Key-value pairs to pass into the agent's script at runtime. Keys must match the input parameters defined on the agent.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Basic authentication credentials. Pass your Basic auth token in the Authorization header along with your workspace ID in the x-workspace-id header on every request.

Headers

x-workspace-idstring
Required

Your Twenty2 workspace ID

Body

application/json
agent_idstring
Required

The ID of the published agent to use for the call.

callee_phonestring
Required

The phone number to call (recipient), without country code.

caller_phonestring
Required

The phone number to call from, without country code. Must be active in your Twenty2 workspace.

input_parametersobject

Key-value pairs to pass into the agent's script at runtime. Keys must match the input parameters defined on the agent.

Responses

successboolean
call_idstring
statusstring
messagestring