# Place an AI call

> Call a contact with a voice agent on the line.

Source: https://docs.mycrmsim.com/docs/calls/start-ai-call

```http
POST https://backend.mysmsgateway.app/api/v1/ext/calls/ai
```

- Category: myCRMSIM Calls / Calls
- Auth: Bearer access token
- Scope: `calls.write`
- Guide: [How calling works — how the voice agent is chosen and where the call's record ends up](https://docs.mycrmsim.com/guides/how-calling-works)

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. Example: `7` |
| `contact_id` | body | number | yes | A contact in that workspace. Example: `1234` |
| `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. One of: `whatsapp`, `imessage`, `android`, `twilio`. |

## Request body

```json
{
  "workspace_id": 7,
  "contact_id": 1234
}
```

## Response 202

Placed — follow it with Get AI call

```json
{
  "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"
  }
}
```

## Response 400

Refused before dialling (no agent, AI off for the contact, no Call Routing, no device ready)

```json
{
  "success": false,
  "code": "no_call_routing",
  "message": "This sub-account has no Call Routing set up."
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Voice agents are switched off for the account

```json
{
  "success": false,
  "code": "voice_agents_off",
  "message": "Voice agents are not enabled for this account."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): calls.write. This integration was granted: …"
}
```

## Response 404

Contact does not exist or is not the installer's (same response for both)

```json
{
  "success": false,
  "message": "Contact not found or not accessible to this token"
}
```

## Response 409

Every device is on a call (`busy`), or the contact has outbound DND (`dnd`)

```json
{
  "success": false,
  "code": "busy",
  "message": "Every device is on a call."
}
```
