---
title: Create a Multi-Stream Entry Set
url: https://docs.kaltura.com/docs/rich-media-cms-apis/content-management/multi-stream-create-a-multi-stream-entry-set
---

## Create a Multi-Stream Entry Set


This workflow creates a parent entry and links child entries to it. For the upload steps (`uploadToken.add`, `uploadToken.upload`, `media.add`, `media.addContent`), see the [Upload & Ingestion Guide](/docs/rich-media-cms-apis/content-management/upload-ingestion-overview) for full details including chunked/resumable uploads.

### Create the Parent Entry

Upload and create the parent entry using the standard upload flow:


```bash
# Step 1: Create upload token
curl -X POST "$KALTURA_SERVICE_URL/service/uploadToken/action/add" \
  -d "ks=$KALTURA_KS" \
  -d "format=1"
# Save the "id" from response as PARENT_TOKEN_ID

# Step 2: Upload the file
curl -X POST "$KALTURA_SERVICE_URL/service/uploadToken/action/upload" \
  -F "ks=$KALTURA_KS" \
  -F "format=1" \
  -F "uploadTokenId=$PARENT_TOKEN_ID" \
  -F "resume=false" \
  -F "finalChunk=true" \
  -F "resumeAt=-1" \
  -F "fileData=@primary-video.mp4;type=video/mp4"

# Step 3: Create the media entry
curl -X POST "$KALTURA_SERVICE_URL/service/media/action/add" \
  -d "ks=$KALTURA_KS" \
  -d "format=1" \
  -d "entry[objectType]=KalturaMediaEntry" \
  -d "entry[mediaType]=1" \
  -d "entry[name]=Speaker Camera"
# Save the "id" from response as PARENT_ENTRY_ID

# Step 4: Attach the file to the entry
curl -X POST "$KALTURA_SERVICE_URL/service/media/action/addContent" \
  -d "ks=$KALTURA_KS" \
  -d "format=1" \
  -d "entryId=$PARENT_ENTRY_ID" \
  -d "resource[objectType]=KalturaUploadedFileTokenResource" \
  -d "resource[token]=$PARENT_TOKEN_ID"
```


Wait for the parent entry status to become `2` (Ready) before proceeding.

### Create a Child Entry with parentEntryId

The key difference from a normal upload: set `entry[parentEntryId]` in the `media.add` call to link the child to the parent.


```bash
# Step 1: Create upload token for child
curl -X POST "$KALTURA_SERVICE_URL/service/uploadToken/action/add" \
  -d "ks=$KALTURA_KS" \
  -d "format=1"
# Save the "id" from response as CHILD_TOKEN_ID

# Step 2: Upload the child file
curl -X POST "$KALTURA_SERVICE_URL/service/uploadToken/action/upload" \
  -F "ks=$KALTURA_KS" \
  -F "format=1" \
  -F "uploadTokenId=$CHILD_TOKEN_ID" \
  -F "resume=false" \
  -F "finalChunk=true" \
  -F "resumeAt=-1" \
  -F "fileData=@screen-share.mp4;type=video/mp4"

# Step 3: Create the child entry — set parentEntryId
curl -X POST "$KALTURA_SERVICE_URL/service/media/action/add" \
  -d "ks=$KALTURA_KS" \
  -d "format=1" \
  -d "entry[objectType]=KalturaMediaEntry" \
  -d "entry[mediaType]=1" \
  -d "entry[name]=Screen Share" \
  -d "entry[parentEntryId]=$PARENT_ENTRY_ID"
# Save the "id" from response as CHILD_ENTRY_ID

# Step 4: Attach the file
curl -X POST "$KALTURA_SERVICE_URL/service/media/action/addContent" \
  -d "ks=$KALTURA_KS" \
  -d "format=1" \
  -d "entryId=$CHILD_ENTRY_ID" \
  -d "resource[objectType]=KalturaUploadedFileTokenResource" \
  -d "resource[token]=$CHILD_TOKEN_ID"
```


Repeat this step for each additional stream. Each child entry must reference the same `$PARENT_ENTRY_ID`.
