> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://doc.youratlas.com/v1/llms.txt
> - v2: https://doc.youratlas.com/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://doc.youratlas.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://doc.youratlas.com/_mcp/server.

# Create forwarding rule

POST https://api.youratlas.com/v1/api/call-forward/{campaignId}
Content-Type: application/json

Adds a call forwarding rule to a campaign: a phone number or SIP destination the agent can transfer to, and who it is for.

Reference: https://doc.youratlas.com/api-reference/atlas-api/calls-forward/create-call-forward

## Authentication

- `api-key` header (required) — Your Atlas API key. Get it from the Atlas Portal under Settings > API Keys.

## Request

### Path parameters

- `campaignId` (string, required) — ID of the campaign.

### Body (application/json)

This endpoint expects a CallForwardBody.

- `PhoneNumber` (string, required)
- `Who` (string, required)
- `Type` (enum, required)
  - Allowed values: `number`, `sip`
- `Extension` (string, optional)
- `TransferMessage` (string, optional)
- `TransferWithSummary` (boolean, optional)
- `SIPURI` (string, optional)
- `SIPHeaders` (string, optional) — JSON-serialized SIP headers

## Response

### 200

Forwarding rule created

## Errors

### 400 Bad Request Error

Bad request

- `error` (ErrorError, optional)

### 401 Unauthorized Error

Invalid or missing API key

- `error` (ErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (ErrorError, optional)

## Types

### ErrorError

- `message` (string, optional)
- `code` (string, optional)
- `requestId` (string, optional)

## Examples

**Request**

```json
{
  "PhoneNumber": "+15555550123",
  "Who": "Front desk",
  "Type": "number",
  "TransferMessage": "One moment while I transfer you.",
  "TransferWithSummary": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python Calls Forward_createCallForward_example
import requests

url = "https://api.youratlas.com/v1/api/call-forward/campaignId"

payload = {
    "PhoneNumber": "+15555550123",
    "Who": "Front desk",
    "Type": "number",
    "TransferMessage": "One moment while I transfer you.",
    "TransferWithSummary": True
}
headers = {
    "api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Calls Forward_createCallForward_example
const url = 'https://api.youratlas.com/v1/api/call-forward/campaignId';
const options = {
  method: 'POST',
  headers: {'api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"PhoneNumber":"+15555550123","Who":"Front desk","Type":"number","TransferMessage":"One moment while I transfer you.","TransferWithSummary":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Calls Forward_createCallForward_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.youratlas.com/v1/api/call-forward/campaignId"

	payload := strings.NewReader("{\n  \"PhoneNumber\": \"+15555550123\",\n  \"Who\": \"Front desk\",\n  \"Type\": \"number\",\n  \"TransferMessage\": \"One moment while I transfer you.\",\n  \"TransferWithSummary\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Calls Forward_createCallForward_example
require 'uri'
require 'net/http'

url = URI("https://api.youratlas.com/v1/api/call-forward/campaignId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"PhoneNumber\": \"+15555550123\",\n  \"Who\": \"Front desk\",\n  \"Type\": \"number\",\n  \"TransferMessage\": \"One moment while I transfer you.\",\n  \"TransferWithSummary\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Calls Forward_createCallForward_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.youratlas.com/v1/api/call-forward/campaignId")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"PhoneNumber\": \"+15555550123\",\n  \"Who\": \"Front desk\",\n  \"Type\": \"number\",\n  \"TransferMessage\": \"One moment while I transfer you.\",\n  \"TransferWithSummary\": true\n}")
  .asString();
```

```php Calls Forward_createCallForward_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.youratlas.com/v1/api/call-forward/campaignId', [
  'body' => '{
  "PhoneNumber": "+15555550123",
  "Who": "Front desk",
  "Type": "number",
  "TransferMessage": "One moment while I transfer you.",
  "TransferWithSummary": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Calls Forward_createCallForward_example
using RestSharp;

var client = new RestClient("https://api.youratlas.com/v1/api/call-forward/campaignId");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"PhoneNumber\": \"+15555550123\",\n  \"Who\": \"Front desk\",\n  \"Type\": \"number\",\n  \"TransferMessage\": \"One moment while I transfer you.\",\n  \"TransferWithSummary\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Calls Forward_createCallForward_example
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "PhoneNumber": "+15555550123",
  "Who": "Front desk",
  "Type": "number",
  "TransferMessage": "One moment while I transfer you.",
  "TransferWithSummary": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.youratlas.com/v1/api/call-forward/campaignId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```