---
updatedAt: 2026-07-15T14:56:44.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/msl5-harmonic/llms.txt
---

# Import a v4 stream

Imports an existing stream configuration from v4 format.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Media Services Live API",
    "description": "",
    "license": {
      "name": ""
    },
    "version": "1.9.7"
  },
  "servers": [
    {
      "url": "https://{hostname}"
    }
  ],
  "security": [
    {
      "jwt": []
    }
  ],
  "paths": {
    "/api/v1/streams/import": {
      "post": {
        "tags": [
          "Stream"
        ],
        "summary": "Import a v4 stream",
        "description": "Imports an existing stream configuration from v4 format.",
        "operationId": "import_stream",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportStreamRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Stream import accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStreamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "Backup mismatch": {
                    "summary": "Invalid backup zone",
                    "value": {
                      "error": "Backup encoder zone does not match origin"
                    }
                  },
                  "IP limit": {
                    "summary": "Too many IP addresses",
                    "value": {
                      "error": "Maximum allowed IPs is 270"
                    }
                  },
                  "Invalid DVR": {
                    "summary": "Invalid DVR window",
                    "value": {
                      "error": "DVR window must be between 5 and 720 minutes"
                    }
                  },
                  "Invalid backup hostname": {
                    "summary": "Invalid backup hostname provided",
                    "value": {
                      "error": "Invalid backup hostname"
                    }
                  },
                  "Invalid hostname": {
                    "summary": "Invalid hostname provided",
                    "value": {
                      "error": "Invalid hostname"
                    }
                  },
                  "Invalid name": {
                    "summary": "Invalid name format",
                    "value": {
                      "error": "Host name should not contain '.'"
                    }
                  },
                  "Same zones": {
                    "summary": "Same zones for primary and backup",
                    "value": {
                      "error": "Encoder zone and backup encoder zone should not be the same"
                    }
                  },
                  "Zone mismatch": {
                    "summary": "Invalid encoder zone",
                    "value": {
                      "error": "Encoder zone does not match origin"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Invalid or expired token",
                    "value": {
                      "error": "Error decoding token"
                    }
                  },
                  "no_token": {
                    "summary": "Missing authentication token",
                    "value": {
                      "error": "No token found in request"
                    }
                  },
                  "token_verification_failed": {
                    "summary": "Token verification failed",
                    "value": {
                      "error": "No key found for kid"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "insufficient_permissions": {
                    "summary": "Insufficient permissions",
                    "value": {
                      "error": "Forbidden"
                    }
                  },
                  "no_stream_access": {
                    "summary": "No access to stream",
                    "value": {
                      "error": "No access on stream 'stream_id' because not authorized on Group ID 'group_id' of Contract 'contract_id'"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Resource conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "Already exists": {
                    "summary": "Stream exists",
                    "value": {
                      "error": "Stream with same stream ID already exists"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message."
          }
        }
      },
      "HarmonicG2OCredential": {
        "type": "object",
        "title": "Harmonic G2O Credential",
        "required": [
          "key",
          "nonce"
        ],
        "properties": {
          "key": {
            "type": "string",
            "example": "asdfa12313"
          },
          "nonce": {
            "type": "string",
            "example": "st21321321adsf"
          }
        },
        "example": {
          "key": "asdfa12313",
          "nonce": "st21321321adsf"
        }
      },
      "HashAlgorithm": {
        "type": "string",
        "enum": [
          "SHA256",
          "SHA512_256",
          "SHA512",
          "MD5"
        ]
      },
      "ImportStreamRequest": {
        "type": "object",
        "required": [
          "id",
          "name",
          "type",
          "contractId",
          "format",
          "cpcode",
          "encoderZone",
          "allowedIps",
          "origin",
          "primaryPublishingUrl",
          "backupPublishingUrl",
          "groupId"
        ],
        "properties": {
          "activeArchiveDurationInDays": {
            "type": "integer",
            "format": "int32",
            "example": 7,
            "nullable": true
          },
          "allowedIps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IpNet"
            },
            "maxItems": 270
          },
          "backupEncoderZone": {
            "type": "string",
            "example": "US_EAST",
            "nullable": true
          },
          "backupPublishingUrl": {
            "type": "string",
            "example": "b-ep2093317.i.akamaientrypoint.net/cmaf/2093317-b/(event_name)"
          },
          "contractId": {
            "type": "string",
            "example": "K-0N7RAK7"
          },
          "cpcode": {
            "type": "integer",
            "format": "int32",
            "example": 1582765
          },
          "dvrWindow": {
            "type": "integer",
            "format": "int32",
            "example": 30,
            "nullable": true
          },
          "encoderZone": {
            "type": "string",
            "example": "US_WEST"
          },
          "events": {
            "type": "array",
            "items": {},
            "nullable": true
          },
          "format": {
            "$ref": "#/components/schemas/StreamFormat"
          },
          "groupId": {
            "type": "integer",
            "format": "int32",
            "example": 19717
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "example": 2093317
          },
          "name": {
            "type": "string",
            "example": "ncaa_cmaf_clear_34"
          },
          "origin": {
            "$ref": "#/components/schemas/OriginImportObject"
          },
          "primaryPublishingUrl": {
            "type": "string",
            "example": "p-ep2093317.i.akamaientrypoint.net/cmaf/2093317/(event_name)"
          },
          "streamAuth": {
            "nullable": true,
            "$ref": "#/components/schemas/StreamAuthImportObject"
          },
          "streamAuthPrevious": {
            "nullable": true,
            "$ref": "#/components/schemas/StreamAuthImportObject"
          },
          "streamLevelPurgeDays": {
            "type": "integer",
            "format": "int32",
            "example": 7,
            "nullable": true
          },
          "type": {
            "type": "string",
            "example": "MSL4"
          }
        },
        "example": {
          "activeArchiveDurationInDays": 7,
          "allowedIps": [
            "192.0.2.168"
          ],
          "backupEncoderZone": "US_EAST",
          "backupPublishingUrl": "b-ep2093317.i.akamaientrypoint.net/cmaf/2093317-b/(event_name)",
          "contractId": "K-0N7RAK7",
          "cpcode": 1582765,
          "dvrWindow": 30,
          "encoderZone": "US_WEST",
          "format": "CMAF",
          "groupId": 19717,
          "id": 2093317,
          "name": "ncaa_cmaf_clear_34",
          "origin": {
            "backupEncoderZone": "US_EAST",
            "backupHostName": "020-dn002-tnr01-lwscmaflive.akamaiorigin.net",
            "cpcode": 880696,
            "encoderZone": "US_WEST",
            "groupId": 80380,
            "harmonicG2OCredential": {
              "key": "asdfa12313",
              "nonce": "st21321321adsf"
            },
            "hostName": "020-dn001-tnr01-lwscmaflive.akamaiorigin.net",
            "id": 23528
          },
          "primaryPublishingUrl": "p-ep2093317.i.akamaientrypoint.net/cmaf/2093317/(event_name)",
          "streamAuth": {
            "algorithm": "SHA256",
            "ha1Backup": "def456",
            "ha1Primary": "abc123",
            "username": "stream_user"
          },
          "streamAuthPrevious": {
            "algorithm": "SHA256",
            "ha1Backup": "def456",
            "ha1Primary": "abc123",
            "username": "stream_user"
          },
          "streamLevelPurgeDays": 7,
          "type": "MSL4"
        }
      },
      "ImportStreamResponse": {
        "type": "object",
        "required": [
          "stream_id",
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/StreamStatus",
            "description": "Current status of the stream."
          },
          "stream_id": {
            "type": "string",
            "description": "Unique identifier for the stream.",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        },
        "example": {
          "status": "READY",
          "stream_id": "123e4567-e89b-12d3-a456-426614174000"
        }
      },
      "IpNet": {
        "type": "string",
        "example": "192.168.1.0/24"
      },
      "OriginImportObject": {
        "type": "object",
        "required": [
          "id",
          "hostName",
          "cpcode",
          "encoderZone",
          "groupId"
        ],
        "properties": {
          "backupEncoderZone": {
            "type": "string",
            "example": "US_EAST",
            "nullable": true
          },
          "backupHostName": {
            "type": "string",
            "example": "020-dn002-tnr01-lwscmaflive.akamaiorigin.net",
            "nullable": true
          },
          "cpcode": {
            "type": "integer",
            "format": "int32",
            "example": 880696
          },
          "encoderZone": {
            "type": "string",
            "example": "US_WEST"
          },
          "groupId": {
            "type": "integer",
            "format": "int32",
            "example": 80380
          },
          "harmonicG2OCredential": {
            "nullable": true,
            "$ref": "#/components/schemas/HarmonicG2OCredential"
          },
          "hostName": {
            "type": "string",
            "example": "020-dn001-tnr01-lwscmaflive.akamaiorigin.net"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "example": 23528
          }
        },
        "example": {
          "backupEncoderZone": "US_EAST",
          "backupHostName": "020-dn002-tnr01-lwscmaflive.akamaiorigin.net",
          "cpcode": 880696,
          "encoderZone": "US_WEST",
          "groupId": 80380,
          "harmonicG2OCredential": {
            "key": "asdfa12313",
            "nonce": "st21321321adsf"
          },
          "hostName": "020-dn001-tnr01-lwscmaflive.akamaiorigin.net",
          "id": 23528
        }
      },
      "StreamAuthImportObject": {
        "type": "object",
        "title": "Stream Authentication Import Object",
        "required": [
          "username",
          "algorithm",
          "ha1Primary",
          "ha1Backup"
        ],
        "properties": {
          "algorithm": {
            "$ref": "#/components/schemas/HashAlgorithm"
          },
          "expiryDate": {
            "type": "string",
            "format": "date-time",
            "example": "2024-12-31T23:59:59Z",
            "nullable": true
          },
          "ha1Backup": {
            "type": "string",
            "example": "def456"
          },
          "ha1Primary": {
            "type": "string",
            "example": "abc123"
          },
          "username": {
            "type": "string",
            "example": "stream_user"
          }
        },
        "example": {
          "algorithm": "SHA256",
          "expiryDate": "2024-12-31T23:59:59Z",
          "ha1Backup": "def456",
          "ha1Primary": "abc123",
          "username": "stream_user"
        }
      },
      "StreamFormat": {
        "type": "string",
        "enum": [
          "CMAF",
          "HLS",
          "DASH"
        ]
      },
      "StreamStatus": {
        "type": "string",
        "enum": [
          "CREATING",
          "READY",
          "DELETED"
        ]
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```

# Sibling pages

* [Create stream](https://techdocs.akamai.com/msl5-harmonic/reference/create_stream.md)
* [List streams](https://techdocs.akamai.com/msl5-harmonic/reference/list_streams.md)
* [Get stream details](https://techdocs.akamai.com/msl5-harmonic/reference/get_stream.md)
* [Update stream](https://techdocs.akamai.com/msl5-harmonic/reference/update_stream.md)
* [Delete stream](https://techdocs.akamai.com/msl5-harmonic/reference/delete_stream.md)