Skip to content
中文

Reset the push token of a stream

Code Mode: praxis.media.streams.resetToken.create

HTTP: POST /media/v1/streams/{stream_id}/reset-token

Mint a new push token for a push stream and invalidate the old one, for example when the token leaked or has expired (a token is valid for 24 hours). The response carries the new push {url, token, expires_at}; the token is shown only here. A pull stream has no token and answers 409. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/reset-token with no body.

Signature

praxis.media.streams.resetToken.create(args:{path:{/** e.g. "mst_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ stream_id:string}}):Promise<({/** The stream id (mst_ and 26 lowercase base32 characters); stable and never reused. e.g. "mst_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ id:string;/** Always media.stream; tells a stream from other objects in a mixed list. e.g. "media.stream" */ object:"media.stream";/** idle means no source is connected; waiting means a pulled source is not live yet (no failure and no charge beyond the poll); active means media is flowing and a e.g. "idle" */ status:"idle"|"waiting"|"active"|"disabled";input:{/** pull means Praxis pulls the address in url; push means your encoder or app sends to the push address returned when the stream is created. e.g. "pull" */ kind:"pull"|"push";/** Only for kind push; omit it for a push over the Praxis socket from a browser or app. e.g. "rtmp" */ protocol?:"rtmp"|"srt";/** The address to pull, present only when kind is pull: https, http (HLS .m3u8, HTTP-FLV) or rtmp, rtmps. e.g. "https://live.example.com/room/index.m3u8" */ url?:string};/** Seconds a dropped source may take to come back and continue the same broadcast. e.g. 60 */ reconnect_window_s:number;/** Seconds one broadcast may run before it ends. e.g. 43200 */ max_continuous_duration_s:number;recording:{/** automatic records every broadcast into a Media asset; off records nothing (the default). e.g. "off" */ mode?:"automatic"|"off";/** Which rendition to record: source keeps the stream as it arrives; highest, sd and lowest pick among the renditions the source offers; audio_only keeps no video. e.g. "source" */ rendition?:"source"|"highest"|"sd"|"lowest"|"audio_only";/** The Media library the recordings go to; omit to use the default library of your organization. */ library_id?:string;/** The folder inside the library the recordings are placed in; omit for the library root. */ asset_folder?:string;/** Delete each recording this many days after it was made; omit to keep recordings until you delete them. e.g. 30 */ delete_after_days?:number};playback?:{/** true keeps the newest segments of the broadcast readable so a player can follow it live (about a minute of media at a time); false (the default) keeps nothing f e.g. true */ enabled?:boolean};/** The processing attached to the stream, or null for none. */ pipeline_id:(string)|null;/** The Media asset the current broadcast is being recorded into, or null when no broadcast is recording. */ active_asset_id:(string)|null;/** The assets of the broadcasts before the current one, newest first. */ recent_asset_ids:Array<string>;/** The live health of the broadcast in progress; null unless the stream is active. */ health:(({/** Kilobits per second received over the last minute (bytes received over the media time they cover); null when no segment arrived in that minute. e.g. 2500 */ bitrate_kbps:(number)|null;/** Milliseconds from a segment's wall-clock start to the moment it was processed, averaged over the last minute. e.g. 1800 */ latency_ms:(number)|null;/** Segments the source skipped in this broadcast. e.g. 0 */ dropped_segments:number;/** Times the source dropped and came back inside the reconnect window in this broadcast. e.g. 1 */ reconnects:number;/** When the newest segment was processed, RFC 3339 UTC; null before the first segment of the broadcast. e.g. "2026-11-28T12:05:00.000Z" */ last_segment_at:(string)|null}))|null;usage:{/** The broadcast in progress; null unless the stream is active. */ broadcast:(({/** Seconds the stream was live, to the millisecond. e.g. 90.5 */ stream_seconds:number;/** Seconds of processing (pipeline processors and alert judgments) run for the stream, to the millisecond. e.g. 1.25 */ processor_seconds:number;/** Bytes recorded from the stream. e.g. 18500000 */ recorded_bytes:number}))|null;/** Across every broadcast of the stream. */ total:({/** Seconds the stream was live, to the millisecond. e.g. 90.5 */ stream_seconds:number;/** Seconds of processing (pipeline processors and alert judgments) run for the stream, to the millisecond. e.g. 1.25 */ processor_seconds:number;/** Bytes recorded from the stream. e.g. 18500000 */ recorded_bytes:number})};/** When the stream was created, RFC 3339 UTC. e.g. "2026-11-28T12:00:00.000Z" */ created_at:string;/** When the stream last changed (a setting or its status), RFC 3339 UTC. e.g. "2026-11-28T12:05:00.000Z" */ updated_at:string})&({push?:{/** Where to push: the WebSocket address of Praxis Realtime (it already carries the token as a query parameter), or the rtmps or srt server address of an encoder pu e.g. "wss://realtime.deepraxis.com/v1/media-streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/push?token=Zm9v" */ url:string;/** The capability token inside url, socket push only; keep it secret, only its hash is stored and it is shown only in this response. e.g. "Zm9vYmFy" */ token?:string;/** When the token stops working, RFC 3339 UTC, socket push only; call streams.resetToken.create for a new one. e.g. "2026-11-29T12:00:00.000Z" */ expires_at?:string;/** Encoder push only: rtmp means url and stream_key are an RTMPS address and key; srt means url, stream_id and passphrase are an SRT connection. e.g. "rtmp" */ protocol?:"rtmp"|"srt";/** RTMP push only: the stream key to type into the encoder after url; it is shown only in the response that creates the stream. e.g. "a1b2c3d4e5f60718293a4b5c6d7e8f90k1d2e3f4" */ stream_key?:string;/** SRT push only: the streamid of the connection; shown only in the response that creates the stream. e.g. "a1b2c3d4e5f60718293a4b5c6d7e8f90" */ stream_id?:string;/** SRT push only: the passphrase of the connection; shown only in the response that creates the stream. e.g. "k1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6" */ passphrase?:string}})>;

Parameters

NameInTypeRequiredDescription
stream_idpathstringyesThe stream’s id, the id field returned by streams.create or streams.list (mst_ followed by 26 lowercase base32 characters); a stream of another organization answers 404.

Responses

StatusContent typesDescription
200application/jsonThe stream with its new push credential.
404application/jsonNo stream with this id in your organization, or Media Streams is not released for it.
409application/jsonThe stream is a pull stream and has no push token.
503application/jsonPush is not available in this environment; retry later.