Skip to main content

PATCH Update stream

PATCH /stream/{id} can be used to modify a stream object. It is a single endpoint that can update any of the mutable properties of a stream. Specifically:

  • record
  • suspended
  • multistream.targets

All fields in the request payload are optional, and any field that is not included will keep the same value as before in the saved object.

A 204 No Content status response indicates the stream was successfully updated.

Turn recording on

curl -X PATCH https://livepeer.studio/api/stream/{id} \
-H 'content-type: application/json' \
-H 'authorization: Bearer {api-key}' \
-d '{ "record": true }'

Suspend stream

curl -X PATCH https://livepeer.studio/api/stream/{id} \
-H 'content-type: application/json' \
-H 'authorization: Bearer {api-key}' \
-d '{ "suspended": true }'

Edit Multistream Targets

curl -X PATCH 'https://livepeer.studio/api/stream/{id}' \
-H 'content-type: application/json' \
-H 'authorization: Bearer {api-key}' \
-d '{
"multistream": {
"targets": [
{ "id" :"0bf161f3-95bd-4971-a7b1-4dcb5d39e78a", "profile": "source" },
{ "id" :"95bd0bf1-61f3-a7b1-4971-39e78a4dcb5d", "profile": "720p", "videoOnly": true }
]
}
}'

Update all fields

curl -X PATCH 'https://livepeer.studio/api/stream/{id}' \
-H 'content-type: application/json' \
-H 'authorization: Bearer {api-key}' \
-d '{
"record": false,
"suspended": false,
"multistream": {
"targets": []
}
}'

Update Access Control Policy

A playbackPolicy type can be either:

  • public - No access control is applied to the asset
  • jwt - A JWT is required to playback the asset

If you set your stream or asset's playback policy to JWT, you will need to sign a token with a signing key and put it in the playback URL to be able to playback your stream.

Request

curl --location --request PATCH 'https://livepeer.studio/api/stream/{id}' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer {api_key}' \
-d {
"playbackPolicy": {
"type":"jwt"
}
}

Response

A 204 No Content status response indicates the asset was successfully updated.