# Destinations Save RTMP output settings and rotate credentials for future runs. 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; mutations require streams:write. CreateDestinationInput takes name, endpoint and streamKey, plus optional profile and enabled. The endpoint is a public RTMP/RTMPS application URL without userinfo, query or fragment. Profiles are remux, 720p or 1080p. ## 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 | | --- | --- | | `streams.destinations.create` | `(streamId: string, input: CreateDestinationInput, options?: RequestOptions): Promise` | | `streams.destinations.list` | `(streamId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise` | | `streams.destinations.get` | `(streamId: string, destinationId: string, options?: RequestOptions): Promise` | | `streams.destinations.update` | `(streamId: string, destinationId: string, input: UpdateDestinationInput, options?: RequestOptions): Promise` | | `streams.destinations.delete` | `(streamId: string, destinationId: string, options?: RequestOptions): Promise<{ id: string; deleted: true; }>` | | `streams.destinations.rotateSecret` | `(streamId: string, destinationId: string, input: RotateDestinationSecretInput, options?: RequestOptions): Promise` | ## Behavior and results Update and rotateSecret require the current destination version. Reads expose host, protocol, port, profile, version and secretConfigured, never the saved URL/key. A broadcast keeps its destination snapshot even if the definition is later disabled, deleted or rotated. Stop the run to disconnect that output. ## 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/destinations) and the [public type index](/reference/sdk/server/node/types).