Place an AI call
/api/v1/ext/calls/ai
Call a contact with a voice agent on the line.
The dashboard's Call with AI: the call is placed from the workspace's own devices in its Call Routing order (or over the channel named) and a voice agent talks to the contact. The agent is chosen as in the dashboard: the AI agent whose Contact Tag the contact carries, else the workspace's default voice agent (*Voice agents → inbound*); voice_agent_id names one instead. Dialling is asynchronous: 202 means the call was placed; follow it with *Get AI call*, and read it afterwards, transcript included, in *Voice agents → List voice calls*. A contact with AI turned off, with Do-Not-Disturb on for the channel, or with no agent to call it is refused with the dashboard's own wording.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| workspace_id | body | number | yes | A workspace of the installer. |
| contact_id | body | number | yes | A contact in that workspace. |
| voice_agent_id | body | string | no | A voice agent of the workspace, instead of the one the contact's tag picks. |
| channel | body | enum | no | Dial over this line only. Default: the workspace's Call Routing order. |
Responses
| Status | When |
|---|---|
202 | Placed — follow it with Get AI call |
400 | Refused before dialling (no agent, AI off for the contact, no Call Routing, no device ready) |
401 | Missing or invalid token |
403 | Voice agents are switched off for the account |
403 | Missing scope |
404 | Contact does not exist or is not the installer's (same response for both) |
409 | Every device is on a call (busy), or the contact has outbound DND (dnd) |
curl -X POST "https://backend.mysmsgateway.app/api/v1/ext/calls/ai" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 7,
"contact_id": 1234
}'{
"success": true,
"message": "Call placed",
"data": {
"call_id": "c7f1a2b3-4d5e-4f60-8a9b-0c1d2e3f4a5b",
"channel": "whatsapp",
"contact_id": 1234,
"workspace_id": 7,
"voice_agent_name": "Sales Voice",
"agent_name": "Sales Agent",
"matched_by": "tag",
"matched_tag": "sales",
"from_number": "+61400000099"
}
}« End call
Preview an AI call »
