> This page is for Beam.

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

# Channel Import

POST https://app.mk.io/api/channel-import/
Content-Type: application/json

Import channels from a JSON payload.

`mode=merge` (default): create missing, update changed, leave others alone.
`mode=replace`: delete any channel not in the payload, then create/update.
An empty `channels` list with `mode=replace` deletes all channels.

Returns immediately. Background tasks push service configs to the controller;
observe final per-channel state via `GET /channels/{id}/` (`syncState`).

Reference: https://mediakind.ferndocs.com/beam/api/channels/import-export/channel-import

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an ImportRequest.

- `payload` (ExportPayload, required)
- `mode` (enum, optional)
  - Allowed values: `merge`, `replace`
- `state` (enum, optional, nullable)
  - Allowed values: `Running`, `Stopped`

## Response

### 200

Successful Response

- `imported` (list of ImportedChannelResult, optional)
- `deleted` (list of string, optional)
- `errors` (list of string, optional)
- `warnings` (list of string, optional)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ExportPayload

- `exportedAt` (datetime, required)
- `channels` (list of ExportedChannel, required)
- `schemaVersion` (string, optional, default: 1)
- `description` (string, optional, nullable)
- `sourceVersion` (string, optional, nullable)

### ImportedChannelResult

- `name` (string, required)
- `sourceName` (string, required)
- `displayName` (string, required)
- `status` (enum, required)
  - Allowed values: `accepted`, `skipped`, `rejected`
- `error` (string, optional, nullable)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ExportedChannel

- `metadata` (ChannelMetadata, required)
- `spec` (ChannelSpec, required)
- `kind` (string, optional, default: BeamChannel)
- `services` (list of ExportedService, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

### ChannelMetadata

- `name` (string, required)
- `displayName` (string, required)

### ChannelSpec

- `type` (enum, required)
  - Allowed values: `EncodingContribution`, `EncodingDistribution`, `ReceptionDecoding`, `ReceptionGateway`, `EncodingStreaming`
- `state` (enum, optional)
  - Allowed values: `Running`, `Stopped`
- `inputs` (list of ChannelSpecInputsItems, optional, default: [])
- `transform` (TransformConfig, optional, nullable)
- `outputs` (list of ChannelSpecOutputsItems, optional, default: [])

### ExportedService

- `name` (string, required)
- `type` (string, required)
- `id` (string, required)
- `config` (map from string to any, required)
- `configVersion` (string, required)

### ChannelSpecInputsItems

- `type`: `ASI` (AsiInput)
  - `name` (string, required)
  - `transport` (AsiInputTransport, required)
  - `decrypt` (DecryptConfig, optional, nullable)
  - `payload` (MptsPayload, optional, nullable)
- `type`: `SDI` (SdiInput)
  - `name` (string, required)
  - `transport` (SdiInputTransport, required)
  - `payload` (SdiPayload, optional, nullable)
- `type`: `SRTCaller` (SrtCallerInput)
  - `name` (string, required)
  - `transport` (SrtCallerTransport, required)
  - `decrypt` (DecryptConfig, optional, nullable)
  - `payload` (MptsPayload, optional, nullable)
- `type`: `SRTListener` (SrtListenerInput)
  - `name` (string, required)
  - `transport` (SrtListenerTransport, required)
  - `decrypt` (DecryptConfig, optional, nullable)
  - `payload` (MptsPayload, optional, nullable)
- `type`: `SatDemod` (SatDemodInput)
  - `name` (string, required)
  - `transport` (SatDemodTransport, required)
  - `decrypt` (DecryptConfig, optional, nullable)
  - `payload` (MptsPayload, optional, nullable)
- `type`: `Smpte2110` (Smpte2110Input)
  - `name` (string, required)
  - `transport` (Smpte2110InputTransport, required)
  - `payload` (Smpte2110Payload, optional, nullable)
- `type`: `UDP` (UdpInput)
  - `name` (string, required)
  - `transport` (UdpTransport, required)
  - `decrypt` (DecryptConfig, optional, nullable)
  - `payload` (MptsPayload, optional, nullable)
- `type`: `Unsynced` (UnsyncedInput)
  - `name` (string, required)
  - `unsupportedValue` (string, optional, default: )

### TransformConfig

- `encoding` (EncodingConfig, optional, nullable)
- `abrEncoding` (AbrEncodingConfig, optional, nullable)
- `multiplexing` (MultiplexingConfig, optional, nullable)

### ChannelSpecOutputsItems

- `type`: `ASI` (AsiOutput)
  - `transport` (AsiOutputTransport, required)
  - `name` (string, optional, nullable)
- `type`: `HttpStreaming` (HttpStreamingOutput)
- `type`: `RF` (RfOutput)
- `type`: `SDI` (SdiOutput)
  - `transport` (SdiOutputTransport, required)
  - `payload` (SdiOutputPayload, optional, nullable)
  - `processing` (OutputProcessing, optional, nullable)
- `type`: `SRTCaller` (SrtCallerOutput)
  - `transport` (SrtCallerOutputTransport, required)
- `type`: `SRTListener` (SrtListenerOutput)
  - `transport` (SrtListenerOutputTransport, required)
- `type`: `Smpte2110` (Smpte2110Output)
  - `payload` (Smpte2110OutputPayload, required)
  - `transports` (list of Smpte2110OutputTransport, required)
  - `processing` (OutputProcessing, optional, nullable)
- `type`: `UDP` (UdpOutput)
  - `transport` (UdpOutputTransport, required)
- `type`: `Unsynced` (UnsyncedOutput)
  - `unsupportedValue` (string, optional, default: )

### AsiInputTransport

- `url` (string, required)
- `tsPacketSize` (enum, optional, nullable)
  - Allowed values: `188`, `204`

### DecryptConfig

- `type` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `BISS`, `BISSCA`, `DVBCI`
- `bissMode` (enum, optional, nullable)
  - Allowed values: `Unsynced`, `Mode1`, `ModeE`
- `bissKey` (string, optional, nullable)
- `bissInjectedKeyId` (string, optional, nullable)
- `camUrl` (string, optional, nullable)

### MptsPayload

- `programNumber` (string, required, default: Auto)
- `video` (MptsVideoConfig, required)
- `audioAutoSelect` (boolean, required)
- `resolutionMode` (enum, required)
  - Allowed values: `UHD`, `HDSD`
- `delayMode` (enum, optional)
  - Allowed values: `Unsynced`, `Standard`, `Low`, `SuperLow`
- `audios` (list of MptsAudioConfig, optional, default: [])

### SdiInputTransport

- `url` (string, required)

### SdiPayload

- `audios` (list of SdiAudioInput, optional, default: [])

### SrtCallerTransport

- `url` (string, required)
- `interface` (string, optional, nullable)
- `latency` (double, optional, default: 0.125)
- `encryptionStandard` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `AES128`, `AES192`, `AES256`
- `passPhrase` (string, optional, nullable)

### SrtListenerTransport

- `interface` (string, required)
- `port` (integer, required) — Port number
- `latency` (double, optional, default: 0.125)
- `encryptionStandard` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `AES128`, `AES192`, `AES256`
- `passPhrase` (string, optional, nullable)

### SatDemodTransport

- `url` (string, required)
- `tunerSymbolRateSps` (integer, required)
- `lnbFrequencyHz` (integer, required)
- `tunerFrequencyHz` (integer, required)
- `lnbVoltage` (enum, optional)
  - Allowed values: `Unsynced`, `Off`, `13V`, `18V`
- `lnbToneEnabled` (boolean, optional, default: false)
- `tunerSearchRangeHz` (integer, optional, default: 2000000)
- `tunerMISEnabled` (boolean, optional, default: false)
- `tunerGoldCode` (integer, optional, default: 0)
- `tunerMISStreamId` (integer, optional, nullable)

### Smpte2110InputTransport

- `interface` (string, optional, nullable)
- `nmosEnabled` (boolean, optional, default: false)

### Smpte2110Payload

- `video` (Smpte2110VideoInputEssence, optional, nullable)
- `audios` (list of Smpte2110AudioInputEssence, optional, default: [])

### UdpTransport

- `url` (string, required) — udp://[sourceAddress@]destinationAddress:port. sourceAddress is optional and enables source-specific multicast filtering (currently only applied by CP inputs).
- `interface` (string, required)

### EncodingConfig

- `video` (VideoEncoding, required)
- `audios` (list of AudioEncoding, optional, default: [])

### AbrEncodingConfig

- `representations` (list of Representation, optional, default: [])
- `sharedAudios` (list of AudioEncoding, optional, default: [])

### MultiplexingConfig

- `enabled` (boolean, optional, default: false)

### AsiOutputTransport

- `url` (string, required)

### SdiOutputTransport

- `url` (string, required)
- `linkMode` (enum, optional, nullable)
  - Allowed values: `Quadrant`, `Interleaved`, `12GSDI`

### SdiOutputPayload

- `audios` (list of SdiOutputAudioConfig, optional, default: [])

### OutputProcessing

- `videoScaling` (enum, optional, nullable)
  - Allowed values: `Unsynced`, `None`, `720p`, `1080p`, `1080i`
- `dynamicRangeConversion` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `BT709`

### SrtCallerOutputTransport

- `url` (string, required)
- `latency` (double, optional, default: 0.125)
- `encryptionStandard` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `AES128`, `AES192`, `AES256`
- `passPhrase` (string, optional, nullable)

### SrtListenerOutputTransport

- `interface` (string, required)
- `port` (integer, required) — Port number
- `maxConnections` (integer, optional, default: 10)
- `latency` (double, optional, default: 0.125)
- `encryptionStandard` (enum, optional)
  - Allowed values: `Unsynced`, `None`, `AES128`, `AES192`, `AES256`
- `passPhrase` (string, optional, nullable)

### Smpte2110OutputPayload

- `essences` (list of Smpte2110OutputPayloadEssencesItems, required)

### Smpte2110OutputTransport

One named destination (multicast group) an output essence transmits over.

- `name` (string, required)
- `interface` (string, required)
- `destinationAddress` (string, required)
- `destinationPort` (integer, required) — Port number
- `sourcePort` (integer, optional, nullable)

### UdpOutputTransport

- `url` (string, required) — udp://[sourceAddress@]destinationAddress:port. sourceAddress is optional and enables source-specific multicast filtering (currently only applied by CP inputs).
- `interface` (string, required)
- `sourceAddress` (string, optional, nullable)
- `sourcePort` (integer, optional, nullable)

### MptsVideoConfig

- `pid` (string, required)

### MptsAudioConfig

- `name` (string, required)
- `mode` (enum, required)
  - Allowed values: `stereo`, `16`, `5.1`, `passthrough`
- `pid` (string, required)

### SdiAudioInput

- `name` (string, required)
- `aggregation` (SdiAudioInputAggregation, optional, default: {"pair":"G1P1","type":"None"})

### Smpte2110VideoInputEssence

- `type` ("video", optional, default: video)
- `transportFile` (TransportFile, optional, nullable) — SDP transport file for an ST 2110 stream.
- `sdpUrl` (string, optional, nullable)
- `streamIndex` (integer, optional, default: 1)

### Smpte2110AudioInputEssence

- `type` ("audio", optional, default: audio)
- `transportFile` (TransportFile, optional, nullable) — SDP transport file for an ST 2110 stream.
- `sdpUrl` (string, optional, nullable)
- `streamIndex` (integer, optional, default: 1)
- `channelGroupIndex` (integer, optional, default: 1)
- `name` (string, optional, nullable)

### VideoEncoding

- `codec` (enum, required)
  - Allowed values: `Unsynced`, `HEVCMain`, `HEVCMain10bit`, `HEVCMain422`, `HEVCMain10bit422`, `H264Main`, `H264High`, `H264High422`, `H264High10bit`, `H264High10bit422`, `H264Baseline`, `MPEG2`, `MPEG2422`, `JPEGXS`, `JPEGXS10bit`
- `videoFormat` (enum, required)
  - Allowed values: `Unsynced`, `3840x2160p`, `1920x1080p`, `1920x1080i`, `1440x1080p`, `1440x1080i`, `1280x1080p`, `1280x1080i`, `960x1080p`, `960x1080i`, `1280x720p`, `960x720p`, `854x720p`, `848x720p`, `640x720p`, `720x576p`, `720x576i`, `704x576p`, `704x576i`, `544x576p`, `544x576i`, `528x576p`, `528x576i`, `480x576p`, `480x576i`, `352x576p`, `352x576i`, `720x480p`, `720x480i`, `704x480p`, `704x480i`, `640x480p`, `640x480i`, `544x480p`, `544x480i`, `528x480p`, `528x480i`, `480x480p`, `480x480i`, `352x480p`, `352x480i`, `352x288p`, `320x240p`, `192x192p`, `176x144p`, `176x120p`, `128x96p`, `96x96p`
- `bitrate` (integer, required, default: 6000000)
- `frameRate` (enum, optional, nullable, default: TrueMotion)
  - Allowed values: `Unsynced`, `TrueMotion`, `Standard`, `Half`, `Quarter`, `Eighth`

### AudioEncoding

- `codec` (enum, required)
  - Allowed values: `Unsynced`, `PassThrough`, `SMPTE302PassThrough`, `MPEG1Layer2`, `AAC`, `HEAAC`, `HEAACv2`, `AC3`, `EAC3`, `AC4`
- `name` (string, optional, nullable)
- `inputName` (string, optional, nullable)
- `audioName` (string, optional, nullable)
- `mode` (enum, optional, nullable, default: Stereo)
  - Allowed values: `Unsynced`, `Mono`, `MonoLeft`, `MonoRight`, `DualMono`, `Stereo`, `Surround51`
- `bitrate` (enum, optional, nullable, default: 192000)
  - Allowed values: `16000`, `20000`, `24000`, `28000`, `32000`, `40000`, `48000`, `56000`, `64000`, `80000`, `96000`, `112000`, `128000`, `144000`, `160000`, `192000`, `224000`, `256000`, `288000`, `320000`, `384000`, `448000`, `512000`, `640000`, `704000`, `768000`, `832000`, `896000`, `960000`, `1024000`
- `ac4Config` (Ac4Config, optional, nullable)

### Representation

- `video` (VideoEncoding, required)
- `audios` (list of AudioEncoding, optional, default: [])

### SdiOutputAudioConfig

- `inputName` (string, required)
- `audioInputName` (string, required)
- `embedding` (enum, required)
  - Allowed values: `Unsynced`, `G1P1`, `G1P2`, `G2P1`, `G2P2`, `G3P1`, `G3P2`, `G4P1`, `G4P2`, `G1P1ToG2P1`, `G1P2ToG2P2`, `G2P1ToG3P1`, `G2P2ToG3P2`, `G3P1ToG4P1`, `G3P2ToG4P2`, `G1P1ToG4P2`

### Smpte2110OutputPayloadEssencesItems

- `essenceType`: `AudioAES3` (Smpte2110AudioEssence)
  - `transportName` (string, required)
  - `audios` (list of Smpte2110OutputAudio, optional, default: [])
  - `packetTime` (enum, optional)
    - Allowed values: `PT_1ms`, `PT_125us`
- `essenceType`: `AudioPCM` (Smpte2110AudioEssence)
  - `transportName` (string, required)
  - `audios` (list of Smpte2110OutputAudio, optional, default: [])
  - `packetTime` (enum, optional)
    - Allowed values: `PT_1ms`, `PT_125us`
- `essenceType`: `Video` (Smpte2110VideoEssence)
  - `transportName` (string, required)

### SdiAudioInputAggregation

- `type`: `None` (SdiNoAggregation)
  - `pair` (enum, required)
    - Allowed values: `Unsynced`, `G1P1`, `G1P2`, `G2P1`, `G2P2`, `G3P1`, `G3P2`, `G4P1`, `G4P2`

### TransportFile

SDP transport file for an ST 2110 stream.

- `data` (string, required) — Raw file contents; expects SDP format by default.

### Ac4Config

- `frameRate` (string, optional, default: 25)
- `language` (string, optional, default: auto)
- `contentClassifier` (enum, optional)
  - Allowed values: `Unsynced`, `classCompleteMain`, `classEmergency`, `classMusicEffect`, `classMainAssociatedMix`

### Smpte2110OutputAudio

A reference to one of the input's named audios, bundled into an audio essence — may itself be a stereo pair or multi-channel group, not necessarily a single raw channel. `inputName` names the input the audio comes from, and `audioInputName` normally references that input's own payload.audios[].name; see `CPSmpte2110Output` in cp.py for how the pair resolves to a real decode stream. The two together mirror `SdiOutputAudioConfig` — `inputName` was missing here originally, which left the reference implicit and resolved against every input at once. For an input using audioAutoSelect (where audios aren't individually named by the user), `audioInputName` instead holds one of the reserved `Audio_1`..`Audio_8` identifiers — CP's own decode-stream identifiers for that input's auto-selected decode streams, used directly with no translation at the cp.py boundary (see _build_smpte2110_named_audio_streams / _smpte2110_audio_essence_from_stream in cp.py). lipSyncOffset is deliberately not exposed here — channels-api doesn't let a user set it; it's only adjustable from the CP Advanced UI.

- `inputName` (string, required)
- `audioInputName` (string, required)

## Examples

**Request**

```json
{
  "payload": {
    "exportedAt": "2024-01-15T09:30:00Z",
    "channels": [
      {
        "metadata": {
          "name": "string",
          "displayName": "string"
        },
        "spec": {
          "type": "EncodingContribution"
        }
      }
    ]
  }
}
```

**Response**

```json
{
  "imported": [
    {
      "name": "string",
      "sourceName": "string",
      "displayName": "string",
      "status": "accepted",
      "error": "string"
    }
  ],
  "deleted": [
    "string"
  ],
  "errors": [
    "string"
  ],
  "warnings": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://app.mk.io/api/channel-import/"

payload = { "payload": {
        "exportedAt": "2024-01-15T09:30:00Z",
        "channels": [
            {
                "metadata": {
                    "name": "string",
                    "displayName": "string"
                },
                "spec": { "type": "EncodingContribution" }
            }
        ]
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://app.mk.io/api/channel-import/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":{"exportedAt":"2024-01-15T09:30:00Z","channels":[{"metadata":{"name":"string","displayName":"string"},"spec":{"type":"EncodingContribution"}}]}}'
};

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://app.mk.io/api/channel-import/"

	payload := strings.NewReader("{\n  \"payload\": {\n    \"exportedAt\": \"2024-01-15T09:30:00Z\",\n    \"channels\": [\n      {\n        \"metadata\": {\n          \"name\": \"string\",\n          \"displayName\": \"string\"\n        },\n        \"spec\": {\n          \"type\": \"EncodingContribution\"\n        }\n      }\n    ]\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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://app.mk.io/api/channel-import/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": {\n    \"exportedAt\": \"2024-01-15T09:30:00Z\",\n    \"channels\": [\n      {\n        \"metadata\": {\n          \"name\": \"string\",\n          \"displayName\": \"string\"\n        },\n        \"spec\": {\n          \"type\": \"EncodingContribution\"\n        }\n      }\n    ]\n  }\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://app.mk.io/api/channel-import/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": {\n    \"exportedAt\": \"2024-01-15T09:30:00Z\",\n    \"channels\": [\n      {\n        \"metadata\": {\n          \"name\": \"string\",\n          \"displayName\": \"string\"\n        },\n        \"spec\": {\n          \"type\": \"EncodingContribution\"\n        }\n      }\n    ]\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.mk.io/api/channel-import/', [
  'body' => '{
  "payload": {
    "exportedAt": "2024-01-15T09:30:00Z",
    "channels": [
      {
        "metadata": {
          "name": "string",
          "displayName": "string"
        },
        "spec": {
          "type": "EncodingContribution"
        }
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.mk.io/api/channel-import/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": {\n    \"exportedAt\": \"2024-01-15T09:30:00Z\",\n    \"channels\": [\n      {\n        \"metadata\": {\n          \"name\": \"string\",\n          \"displayName\": \"string\"\n        },\n        \"spec\": {\n          \"type\": \"EncodingContribution\"\n        }\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payload": [
    "exportedAt": "2024-01-15T09:30:00Z",
    "channels": [
      [
        "metadata": [
          "name": "string",
          "displayName": "string"
        ],
        "spec": ["type": "EncodingContribution"]
      ]
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/channel-import/")! 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()
```