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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.docpartner.dev/en/api/sms-partner/manage-call-forwarding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
