---
updatedAt: 2026-03-01T18:58:56.000Z
---

# Create a stream

```curl cURL
cloneInternalSettingsFromStreamId="175589"

egcurl --eg-section default --request POST \

  --url "https://$hostname/config-media-live/v2/msl-origin/streams?cloneInternalSettingsFromStreamId=$cloneInternalSettingsFromStreamId" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '
{
    "name": "Demostream",
    "contractId": "ABC-123",
    "format": "HLS",
    "cpcode": 123445,
    "ingestAccelerated": false,
    "encoderZone": "EUROPE",
    "backupEncoderZone": "AUSTRALIA",
    "isDedicatedOrigin": false,
    "activeArchiveDurationInDays": 2,
    "groupId": 1234,
    "allowedIps": [
        "1.2.3.4"
    ],
    "additionalEmailIds": [
        "xyz@akamai1.com"
    ],
    "origin": {
        "hostName": "demo-host1"
    },
    "streamAuth": {
        "username": "ajones",
        "password": "123abc!",
        "algorithm": "SHA512"
    }
}'
```

```node Node
const EdgeGrid = require("akamai-edgegrid");
const os = require("os");
const edgercPath = os.homedir + "/.edgerc.txt";
const edgercSection = "default";  
const eg = new EdgeGrid({
  path: edgercPath,
  section: edgercSection
});   


eg.auth({
  path: `/config-media-live/v2/msl-origin/streams`,
  method: "POST",
  headers: {
    "Content-Type": "application/json",

    "Accept": "application/json"},
  body: {
    "name": "Demostream",
    "contractId": "ABC-123",
    "format": "HLS",
    "cpcode": 123445,
    "ingestAccelerated": false,
    "encoderZone": "EUROPE",
    "backupEncoderZone": "AUSTRALIA",
    "isDedicatedOrigin": false,
    "activeArchiveDurationInDays": 2,
    "groupId": 1234,
    "allowedIps": [
        "1.2.3.4"
    ],
    "additionalEmailIds": [
        "xyz@akamai1.com"
    ],
    "origin": {
        "hostName": "demo-host1"
    },
    "streamAuth": {
        "username": "ajones",
        "password": "123abc!",
        "algorithm": "SHA512"
    }
},
  qs: {
    "cloneInternalSettingsFromStreamId": "175589"
}                    
});
eg.send(function(error, response, body) {
  console.log(body);    
});
```

```python Python
import requests
from akamai.edgegrid import EdgeGridAuth, EdgeRc
from urllib.parse import urljoin

edgerc = EdgeRc('~/.edgerc.txt')
section = 'default'
baseurl = 'https://%s' % edgerc.get(section, 'host')

session = requests.Session()
session.auth = EdgeGridAuth.from_edgerc(edgerc, section)
 

path= '/config-media-live/v2/msl-origin/streams'
headers = {
  "Content-Type": "application/json",

  "Accept": "application/json"}
payload = {
    "name": "Demostream",
    "contractId": "ABC-123",
    "format": "HLS",
    "cpcode": 123445,
    "ingestAccelerated": false,
    "encoderZone": "EUROPE",
    "backupEncoderZone": "AUSTRALIA",
    "isDedicatedOrigin": false,
    "activeArchiveDurationInDays": 2,
    "groupId": 1234,
    "allowedIps": [
        "1.2.3.4"
    ],
    "additionalEmailIds": [
        "xyz@akamai1.com"
    ],
    "origin": {
        "hostName": "demo-host1"
    },
    "streamAuth": {
        "username": "ajones",
        "password": "123abc!",
        "algorithm": "SHA512"
    }
} 
querystring = {
  "cloneInternalSettingsFromStreamId": "175589"
}  

result = session.post(urljoin(baseurl, path), headers=headers, json=payload, params=querystring)
print(result.status_code)
print(result.json())
```

```json Response Example
Location: /streams/123
```

# Set up authentication

<!-- curl@3 -->
<!-- node@1-8 -->
<!-- python@1-10 -->

If you haven't already, you need to [create your authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials) in an API client in Control Center. Set up the API client with:

* Access to the Media Streaming API.
* Media Streaming API access level set to READ-WRITE.

Then, you can include this code to apply the token values to validate your requests.

# Pick a CP code

<!-- curl@13 -->
<!-- node@22 -->
<!-- python@22 -->

Run the [List CP codes](https://techdocs.akamai.com/msl/reference/get-cpcodes-1) operation and store the relevant `id` value for the `cpcode` URL parameter.

# Pick a contract

<!-- curl@11 -->
<!-- node@20 -->
<!-- python@20 -->

Run the [List contracts](https://techdocs.akamai.com/msl/reference/get-contracts-1) operation and store the relevant `contractId` value.

# Set ingest stream members

<!-- curl@12,14,17,18,26,27 -->
<!-- node@23,26,27,35,36 -->
<!-- python@23,26,27,35,36 -->

To create an ingest stream request object you need to set the:
- Ingest
- Archive settings (see [Archive stream members](https://techdocs.akamai.com/msl/reference/archive-stream-members))
- Media Services Live origin ([Get an origin](https://techdocs.akamai.com/msl/reference/get-origin-1))

Refer to the [parameters](https://techdocs.akamai.com/msl/reference/post-stream-1).

# Form the URL

<!-- curl@5 -->
<!-- node@12-45 -->
<!-- python@13-45 -->

Inject the `cpcode` and `contractId` into the request URL template string.

Optionally, specify the `cloneInternalSettingsFromStreamId` value. This is the stream to clone the internal settings from.

# Call the API

<!-- curl@0-100 -->
<!-- node@0-100 -->
<!-- python@0-100 -->

Call POST on the request URL.

# Review the response

<!-- curl@0 -->
<!-- node@0 -->
<!-- python@0 -->

The response is successful and returns the `Location` where you can access the new object.