# Broadcasts Control individual runs and inspect independently managed outputs. These methods run on your backend and require a compatible API/SDK build; see [installation](/installation). ## Import and client Set `RELAYRTC_API_URL` and `RELAYRTC_SECRET_KEY` in your backend environment. Keep the secret key on the server. ```ts import { RelayServer } from '@relayrtc/node' const relay = new RelayServer({ apiUrl: process.env.RELAYRTC_API_URL!, apiKey: process.env.RELAYRTC_SECRET_KEY!, }) ``` ## Authorization and inputs Reads require streams:read; run commands require streams:write. Create snapshots the source, profile, destinations and automatic recording policy. A run includes exactly one HLS output. Start can wait for a source; terminal runs cannot restart. Stop preserves the source session and room. Output retry affects only the selected failed output. ## Methods All methods return promises. Their final argument is optional [RequestOptions](/reference/sdk/server/node/request-options). Input and result names are public imports from `@relayrtc/node`. | Method | Signature | | --- | --- | | `broadcasts.outputs.retry` | `(broadcastId: string, outputId: string, input?: BroadcastCommandInput, options?: RequestOptions): Promise` | | `broadcasts.create` | `(input: CreateBroadcastInput, options?: RequestOptions): Promise` | | `broadcasts.list` | `(query?: ListBroadcastsQuery, options?: RequestOptions): Promise` | | `broadcasts.get` | `(broadcastId: string, options?: RequestOptions): Promise` | | `broadcasts.start` | `(broadcastId: string, input?: BroadcastCommandInput, options?: RequestOptions): Promise` | | `broadcasts.stop` | `(broadcastId: string, input?: BroadcastCommandInput, options?: RequestOptions): Promise` | | `broadcasts.getOutputs` | `(broadcastId: string, options?: RequestOptions): Promise<{ data: BroadcastOutput[]; }>` | ## Behavior and results BroadcastPage uses data and nextCursor. ListBroadcastsQuery accepts streamId, state, cursor, limit (1–100; default 30), order (id or newest) and activeOnly (boolean). StreamingOperation represents asynchronous start/stop/retry; poll streamingOperations.get before treating work as complete. ## Requests and errors Streaming commands generate an idempotency key when omitted. Use an explicit stable key when retrying an uncertain application command; reuse its payload and target. Mutations do not retry automatically. Read retries and cancellation follow [RequestOptions](/reference/sdk/server/node/request-options). A canceled HTTP request does not undo committed server work. Failures throw [RelayApiError](/reference/sdk/server/node/RelayApiError). Reload resources after version conflicts; inspect asynchronous operation/processing states before reporting completion. See [REST parameters, defaults and errors](/reference/api/v1/broadcasts) and the [public type index](/reference/sdk/server/node/types).