# Channel Import

post `/ui/connectors/channels-api/latest/import/`

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}/` (`sync_state`).

## Request

This endpoint expects an object.

### payload
object [ExportPayload](https://docs.mediakind.com/api-reference/channels-api/schemas/exportpayload) Required

- **schemaVersion** string Optional Defaults to 1
- **description** object Optional  
  - **string** string
  - **null** null
- **exportedAt** string Required format: date-time
- **sourceVersion** object Optional  
  - **string** string
  - **null** null
- **channels** list of objects [ExportedChannel](https://docs.mediakind.com/api-reference/channels-api/schemas/exportedchannel) Required

### Channel Properties

- **kind** string Optional Defaults to BeamChannel
- **metadata** object [ChannelMetadata](https://docs.mediakind.com/api-reference/channels-api/schemas/channelmetadata) Required  
  - **name** string Required
  - **displayName** string Required
- **spec** object [ChannelSpec](https://docs.mediakind.com/api-reference/channels-api/schemas/channelspec) Required  
  - **type** enum [ChannelType](https://docs.mediakind.com/api-reference/channels-api/schemas/channeltype) Required  
    Allowed values: EncodingContribution EncodingDistribution Reception Decoding ReceptionGateway EncodingStreaming
  - **state** enum [DesiredState](https://docs.mediakind.com/api-reference/channels-api/schemas/desiredstate) Optional Defaults to Stopped  
    Allowed values: Running Stopped
  - **inputs** list of objects Optional Defaults to []

### Discriminated by `type`. Select one variant:

- **SRTCaller** object [SrtCallerInput](https://docs.mediakind.com/api-reference/channels-api/schemas/srtcallerinput)  
  - **type** string Optional Defaults to SRTCaller
  - **name** string Required
  - **transport** object [SrtCallerTransport](https://docs.mediakind.com/api-reference/channels-api/schemas/srtcallertransport) Required  
    - **url** string Required pattern: ^srt://
    - **interface** object Optional  
      - **string** string
      - **null** null
    - **latency** double Optional 0.06 to 8 Defaults to 0.125
    - **encryptionStandard** enum [SrtEncryptionStandard](https://docs.mediakind.com/api-reference/channels-api/schemas/srtencryptionstandard) Optional Defaults to None  
      Allowed values: Unsynced None AES128 AES192 AES256
  - **passPhrase** object Optional  
    - **string** string
    - **null** null
  - **payload** object Optional  
    - **MptsPayload** object
      - **programNumber** string Optional Defaults to 1
      - **delayMode** enum [DelayMode](https://docs.mediakind.com/api-reference/channels-api/schemas/delaymode) Optional Defaults to Standard  
        Allowed values: Unsynced Standard Low SuperLow
      - **decrypt** object Optional  
        - **DecryptConfig** object
          - **type** enum [DecryptType](https://docs.mediakind.com/api-reference/channels-api/schemas/decrypttype) Optional Defaults to None  
            Allowed values: Unsynced None BISS BISS CAD BCI

- **... (Other input types omitted for brevity)**

## Response

200 Successful Response

- **imported** list of objects [ImportedChannelResult](https://docs.mediakind.com/api-reference/channels-api/schemas/importedchannelresult) Optional  
  - **name** string Required
  - **sourceName** string Required
  - **displayName** string Required
  - **status** enum Required  
    Allowed values: accepted skipped rejected
  - **error** object Optional  
    - **string** string
    - **null** null
  - **deleted** list of strings Optional
  - **errors** list of strings Optional
  - **warnings** list of strings Optional

## Errors

422 Validation Error

- **detail** list of objects [ValidationError](https://docs.mediakind.com/api-reference/channels-api/schemas/validationerror) Optional
  - **loc** list of objects Required  
    - **string** string
    - **integer** integer
  - **msg** string Required
  - **type** string Required
  - **input** any Optional
  - **ctx** object Optional
