Adding a push target instructs the restreamer to forward incoming video from a stream to an additional RTMP destination. You can add targets to a stream at any time, whether the stream is currently live or idle. The restreamer starts forwarding to the new target on the very next batch of video frames it receives.
The new target takes effect immediately after the request completes. No restart or reinitialization is required.

Endpoint

POST /api/streams/{id}/targets

Path parameters

id
string
required
The name of the stream to add a push target to.

Request body

name
string
required
A human-readable label for the push target, such as "YouTube" or "Twitch". Used for identification only; it does not affect routing.
url
string
required
The full RTMP destination URL to forward video to, including the stream key if required by the platform.

Example request

curl -X POST http://your-server:6070/api/streams/my-stream/targets \
  -H "Content-Type: application/json" \
  -d '{"name":"YouTube","url":"rtmp://a.rtmp.youtube.com/live2/YOUR_KEY"}'
With authentication enabled:
curl -u user:pass -X POST http://your-server:6070/api/streams/my-stream/targets \
  -H "Content-Type: application/json" \
  -d '{"name":"YouTube","url":"rtmp://a.rtmp.youtube.com/live2/YOUR_KEY"}'

Response

Returns 200 OK with an empty body on success.

Error responses

StatusError valueCause
404stream not foundNo stream with the given name exists.
400HTTP status textThe request body was missing or malformed.