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

# Add a simulcast target to a channel

POST https://api.fastpix.com/v1/cloud-playout/channels/simulcast/{channelId}
Content-Type: application/json

This endpoint restreams a Cloud Playout channel to a third-party platform such as YouTube or Twitch, alongside the channel's own playback.

#### How it works

1. Get the RTMP server URL and stream key from the platform you want to restream to.

2. Make a POST request to this endpoint with the two joined into a single `url`, so the stream key is the last part of it.

3. The response returns the simulcast target, including the `simulcastId` you need to remove it later.

A channel can restream to at most three targets at once.

#### Example

A broadcaster restreams a live event to both YouTube and Twitch while it plays out on their own channel.


Reference: https://fastpix.com/docs/cloud-playout-api/simulcast/add-cloud-playout-channel-simulcast

## Authentication

- `Authorization` header (basic auth, required) — FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request. * Username: Access Token ID * Password: Secret Key Activate your FastPix account to generate your API credentials. See the guide here

## Request

### Path parameters

- `channelId` (string, required) — The unique identifier of the channel to restream.

### Body (application/json)

This endpoint expects a CloudPlayoutSimulcastRequest.

- `url` (string, required) — The RTMP or RTMPS URL to restream to, with the platform's stream key as its last part. It must start with `rtmp://` or `rtmps://`.

## Response

### 200

Simulcast target added successfully

- `success` (boolean, optional) — Shows the request status. Returns true for success and false for failure.
- `data` (liveSimulcast, optional)

## Types

### liveSimulcast

- `simulcastId` (string, optional) — When you create the new simulcast, FastPix assign a universal unique identifier which can contain a maximum of 255 characters.
- `url` (string, optional) — The RTMPS hostname, combined with the application name, is crucial for connecting to third-party live streaming services and transmitting the live stream.
- `streamKey` (string, optional) — A unique stream key is generated for streaming, allowing the user to start streaming on any third-party platform using this key.
- `isEnabled` (boolean, optional) — When the value is true, the simulcast must be enabled for the given stream
- `metadata` (map from string to string, optional) — You can search for videos with specific key value pairs using metadata, when you tag a video in "key":"value"s pairs. Dynamic metadata allows you to define a key that allows any value pair. You can have maximum of 255 characters and upto 10 entries are allowed.

## Examples

**Request**

```json
{
  "url": "rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678"
}
```

**Response**

```json
{
  "success": true,
  "data": {
    "simulcastId": "5f2c8e1b7a934d06b8e4c1a3d9f07e52",
    "url": "rtmp://a.rtmp.youtube.com/live2/",
    "streamKey": "abcd-1234-efgh-5678",
    "isEnabled": true
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c"

payload = { "url": "rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678" }
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"url":"rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678"}'
};

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

```go
package main

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

func main() {

	url := "https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c"

	payload := strings.NewReader("{\n  \"url\": \"rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678\"\n}")

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

	req.SetBasicAuth("<username>", "<password>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c', [
  'body' => '{
  "url": "rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = ["url": "rtmp://a.rtmp.youtube.com/live2/abcd-1234-efgh-5678"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fastpix.com/v1/cloud-playout/channels/simulcast/cc99cae6-56b4-46ab-9f4a-8b2462d8137c")! 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()
```