# Place a call

> Call a contact from the workspace's line, and talk through a LiveKit room.

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

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

- Category: myCRMSIM Calls / Calls
- Auth: Bearer access token
- Scope: `calls.write`

The dashboard's call button. The line dials the contact and the response carries the **LiveKit room** the caller joins to talk: connect to `room.url` with `room.token` (the [livekit-client](https://docs.livekit.io/client-sdk-js/) SDK, or any LiveKit client), publish a microphone track and subscribe to the contact's audio. Use the `room.url` of each call: it is not one fixed address (our LiveKit server, LiveKit Cloud, or a white-label account's own calls domain), so never store or hard-code it. `audio: false` means the line rings without browser audio (an Android phone whose calling line is off): the call still happens on the device.

With no `channel`, the first line in Call Routing dials (or the Mac, then Android, when none is set). `allow_backup: true` returns `backup_lines`: when the line fails after dialling, call again with the same body plus `backup_tried` naming the lines tried, and the next line dials. An email can only be called over FaceTime from the Mac. Hang up with *End call*.

To follow the call, its steps are pushed to your callback URL as `call.status` events: see [Build calling into your own system](/guides/call-events).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | body | number | yes | A workspace of the installer. Example: `7` |
| `contact_id` | body | number | no | The contact to call: its phone number, or its email over FaceTime when it has none. One of contact_id, phone or email. Example: `1234` |
| `phone` | body | string | no | A phone number with country code; filed against its contact when there is one. Example: `+61412345678` |
| `email` | body | string | no | An Apple ID email — FaceTime Audio from the workspace's Mac only. |
| `channel` | body | enum | no | The line to call from. Default: Call Routing (Mac first). One of: `imessage`, `android`, `whatsapp`, `twilio`. Example: `imessage` |
| `allow_backup` | body | boolean | no | true = follow Call Routing onto the next line when this one fails after dialling (the response says which lines are left). |
| `backup_tried` | body | array | no | With `allow_backup`: the lines already tried for this call (`imessage`, `android`, `whatsapp`, `twilio`). Send it when the call failed after dialling and you are calling again; the next line in Call Routing dials. Example: `["imessage"]` |
| `whatsapp_line_id` | body | number | no | WhatsApp only: which connected number to call from. Default: the workspace's default line. |

## Request body

```json
{
  "workspace_id": 7,
  "contact_id": 1234,
  "channel": "imessage",
  "allow_backup": true
}
```

## Response 202

Dialling — join the room to talk

```json
{
  "success": true,
  "message": "Call placed",
  "data": {
    "call_id": "c7f1a2b3-4d5e-4f60-8a9b-0c1d2e3f4a5b",
    "channel": "imessage",
    "to": "+61412345678",
    "contact_id": 1234,
    "workspace_id": 7,
    "from_number": null,
    "room": {
      "url": "wss://livekit.example.com",
      "name": "call-c7f1a2b3",
      "token": "eyJhbGciOiJIUzI1NiIs…",
      "identity": "browser-42-c7f1a2b3"
    },
    "audio": true,
    "backup_lines": [
      "android"
    ]
  }
}
```

## Response 400

No recipient, a contact with no handle, an email on a line other than FaceTime, or the line refused (no Mac, offline, no calling plan)

```json
{
  "success": false,
  "message": "No Mac is assigned to this workspace for calling."
}
```

## Response 401

Missing or invalid token

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

## 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

The line is already on a call

```json
{
  "success": false,
  "code": "busy",
  "message": "The WhatsApp line is on a call."
}
```
