# Save call routing

> Set the order of lines a workspace's calls try.

Source: https://docs.mycrmsim.com/docs/calls/save-call-routing

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

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

Up to 4 rows, one line per row, each line in one row only; an empty list clears the routing. Twilio can be named only when Twilio calling is enabled for the account. The same rules as the dashboard's Call Routing page.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | body | number | yes | A workspace of the installer. Example: `7` |
| `routing` | body | array<array<string>> | yes | Rows of one line each, from imessage, android, whatsapp, twilio. Example: `[["whatsapp"],["imessage"]]` |

## Request body

```json
{
  "workspace_id": 7,
  "routing": [
    [
      "whatsapp"
    ],
    [
      "imessage"
    ]
  ]
}
```

## Response 200

OK

```json
{
  "success": true,
  "message": "Call routing saved",
  "data": {
    "workspace_id": 7,
    "routing": [
      [
        "whatsapp"
      ],
      [
        "imessage"
      ]
    ]
  }
}
```

## Response 400

A rule failed

```json
{
  "success": false,
  "message": "Only one line per row: two lines can't both be first for a call. Put the other line in a row below."
}
```

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

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

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