Stream Create
Creates a new stream within a specific application.
Request
| Property | Value |
|---|---|
| Method | POST |
| URL | /api/streams/{appName} |
| Content-Type | application/json |
| Authentication | Bearer Token |
Request
curl -X POST "{BASE_URL}/api/streams/{appName}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "value"}'
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appName | string | Yes | Application name |
Request With Parameters
curl -X POST "{BASE_URL}/api/streams/{appName}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "value"}'
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
data.attributes.streamKey | string | Yes | Stream key (unique per application) |
data.attributes.type | "ingest" | "pull" | Yes | Stream type |
data.attributes.allowPublishing | boolean | No | Allow stream publishing |
data.attributes.recordStream | boolean | No | Enable stream recording |
data.attributes.source | object | Yes | Source configuration |
Source configuration depends on the stream type. See the Source Types section below.
Source Types
Ingest Stream
Accepts incoming stream from an encoder (e.g. OBS).
| Parameter | Type | Required | Description |
|---|---|---|---|
source.authType | string | Yes | Authorization type |
source.auth | object | No | Authorization details |
| Auth Type | Additional Parameters |
|---|---|
"none" | No additional parameters |
"credentials" | source.auth.username, source.auth.password |
"token" | source.auth.token |
"secret" | source.auth.secret |
Pull Stream
Pulls a stream from a remote source via RTMP, RTSP, or SRT.
| Parameter | Type | Required | Description |
|---|---|---|---|
source.protocol | string | Yes | Protocol: "rtmp", "rtsp", "srt", or "file" |
source.url | string | Yes | Source URL |
source.authType | string | Yes | Authorization type |
source.auth | object | No | Authorization details |
| Auth Type | Protocols | Additional Parameters |
|---|---|---|
"none" | RTMP, RTSP, SRT | No additional parameters |
"credentials" | RTMP, RTSP | source.auth.username, source.auth.password |
"token" | RTSP | source.auth.token |
"secret" | SRT | source.auth.secret |
File Stream
Plays a local media file as a stream.
| Parameter | Type | Required | Description |
|---|---|---|---|
source.path | string | Yes | Path to the media file |
source.loop | boolean | No | Loop playback |
source.transcodePreset | string | No | Transcode preset (e.g. "720p") |
Ingest - No Auth
{
"data": {
"attributes": {
"streamKey": "test",
"type": "ingest",
"allowPublishing": false,
"recordStream": true,
"source": {
"authType": "none"
}
}
}
}
Ingest - Credentials Auth
{
"data": {
"attributes": {
"streamKey": "test",
"type": "ingest",
"allowPublishing": false,
"recordStream": true,
"source": {
"authType": "credentials",
"auth": {
"username": "nabu",
"password": "enter1"
}
}
}
}
}
Pull - RTMP
{
"data": {
"attributes": {
"streamKey": "wowza",
"type": "pull",
"allowPublishing": false,
"recordStream": true,
"source": {
"protocol": "rtmp",
"url": "rtmp://192.168.10.20/live/test",
"authType": "none"
}
}
}
}
Pull - RTSP With Credentials
{
"data": {
"attributes": {
"streamKey": "test",
"type": "pull",
"allowPublishing": false,
"recordStream": true,
"source": {
"protocol": "rtsp",
"url": "rtsp://acme.com/live/test",
"authType": "credentials",
"auth": {
"username": "username",
"password": "password"
}
}
}
}
}
Pull - SRT With Passphrase
{
"data": {
"attributes": {
"streamKey": "test",
"type": "pull",
"allowPublishing": false,
"recordStream": true,
"source": {
"protocol": "srt",
"url": "srt://acme.com/live/test",
"authType": "passphrase",
"auth": {
"secret": "12312312321"
}
}
}
}
}
File Stream
{
"data": {
"attributes": {
"streamKey": "test",
"type": "file",
"allowPublishing": false,
"recordStream": true,
"source": {
"loop": true,
"path": "/Volumes/Samples/test.mp4",
"transcodePreset": "720p"
}
}
}
}
Response Body
| Parameter | Type | Description |
|---|---|---|
data.streamKey | string | Created stream key |
data.application | string | Application name |
message | string | Response status message |
meta.executionTime | integer | Request processing time in milliseconds |
meta.generatedAt | integer | Response generation timestamp (Unix timestamp in ms) |
Successful Response (200)
{
"data": {
"streamKey": "test",
"application": "mono"
},
"meta": {
"executionTime": 33,
"generatedAt": 1771944069327
},
"message": "New Stream has been created"
}
Error Response (4xx/5xx)
| Parameter | Type | Description |
|---|---|---|
message | string | Human-readable error message |
Application Not Found (404)
{
"message": "Application not found"
}
Error Response
{
"message": "Error message"
}
Support Needed?
Create a free ticket and our support team will provide you necessary assistance.