# Manage Call Forwarding

## URL

<mark style="color:green;">`POST`</mark> `https://api.smspartner.fr/v1/vn/callforward`

#### **Required Parameters**

<table data-full-width="false"><thead><tr><th width="180">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.smspartner.fr/dashboard/api">Your API key</a></td></tr><tr><td><code>number</code></td><td>Virtual number</td></tr><tr><td><code>type</code></td><td>Forwarding type:<br>0 → Disabled<br>1 → Call forwarding<br>2 → Voicemail</td></tr><tr><td><code>param</code></td><td>If type = 0 → leave empty<br>If type = 1 → enter forwarding number<br>If type = 2 → enter the email to be notified</td></tr></tbody></table>

#### Request

{% tabs %}
{% tab title="cURL" %}

```
curl --location 'https://api.smspartner.fr/v1/vn/callforward' \
--header 'Content-Type: application/json' \
--data '{
    "apiKey": "API_KEY",
    "number": "NUMBET",
    "type": 0, 
    "param": ""
}'
```

{% endtab %}
{% endtabs %}

#### **Response**

{% tabs %}
{% tab title="json" %}

```json
{
    "success": true,
    "code": 2,
    "message": "Callforward disabled"
}
```

{% endtab %}
{% endtabs %}

#### Errors

{% tabs %}
{% tab title="json" %}

```json
{
    "success": false,
    "code": 5,
    "message": "email is not valid"
}
```

{% endtab %}
{% endtabs %}

**Error Codes**

| Response Code | Message                             |
| ------------- | ----------------------------------- |
| 10            | API key is required                 |
| 1             | name is required                    |
| 5             | Virtual number is required          |
| 6             | Type is required                    |
| 7             | Type is invalid                     |
| 8             | param is required                   |
| 9             | Email is invalid                    |
| 12            | Forwarding number is invalid        |
| 13            | Virtual number does not exist       |
| 14            | Call forwarding is not enabled      |
| 15            | Number is deactivated               |
| 16            | Call forwarding is already enabled  |
| 17            | Voicemail is already enabled        |
| 18            | Call forwarding is already disabled |
