Skip to content

Get media relay credentials

GET /relay-credentialsView source specification ↗

Issues short-lived TURN credentials for the Port OS media relay to the authenticated principal. Use them as ICE servers when a WebRTC peer, such as port message record, cannot reach a camera or robot directly. The relay accepts TCP only, relays to public IPv4 peers only, and limits concurrent allocations per principal. Each call mints new credentials and stores nothing, so the response is never cached. Credentials stop working at expiresAt.

Required scope

Any authenticated access token

Returns

200

Relay credentials issued

Fields

iceServersarray<RelayIceServer>Required

ICE servers to add to a WebRTC peer configuration.

One TURN server with its time-limited username and credential.

urlsarray<string>Required

TURN URLs. The relay accepts TCP only.

usernamestringRequired

TURN username, `<unix-expiry>:<subject>`.

credentialstringRequired

TURN password for the username. Treat it as a secret until it expires.

expiresAtstringRequired

When the credentials stop working.

format: "date-time"

Response headers

Cache-Controlstring

Always `no-store`; the response carries a credential.

Errors

401 UNAUTHORIZED

Unauthorized

Obtain a valid access token, then retry.

500 INTERNAL

Internal server error

Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.

503 SERVICE_UNAVAILABLE

This deployment runs no media relay

Wait for the provider or bridge to recover, then retry safely with backoff.