Skip to content

Authentication

How to authenticate every kind of Rhombus request: which credential to use for REST, media and video, the event WebSocket and cameras on your network, where each one goes, partner credentials, and how to read 401, 403 and 429 responses.

On this page

Every request to Rhombus carries a credential. Which credentials a request can use, and where they go, depends on where the request goes: the REST API, the media and video hosts, the event WebSocket, or a camera on your local network. This page maps each credential to each destination and explains the authentication errors; the pages after it cover each credential in detail.

Choose a credential

You're buildingUseDetails
A backend service, script or scheduled job in one organizationAPI keyAPI keys and certificates
A backend whose security policy requires mutual TLSCertificate API key (mTLS)API keys and certificates
An app that other Rhombus customers sign in to and authorizeOAuth access token ("Sign in with Rhombus")Sign in with Rhombus
A tool for an MSP or reseller that manages many client organizationsPartner API key or partner OAuth tokenPartner API
Video, images, audio or live events in a browser or a mobile app, or anything on a camera's local networkFederated token, minted by your backendFederated tokens
A link anyone can open to watch one cameraShared stream linkMedia and streams
Warning

API keys and partner keys are server-side credentials. Never put one in a web page, a mobile app or any code a user can read. Anything that runs on a user's device gets a short-lived federated token from your backend instead.

Where each credential works

CredentialREST API (api2)Media and videoEvent WebSocket (ws)Cameras on your LAN
API keyHeadersHeadersHandshake headersNot accepted
Certificate API keyClient certificate plus headers (api2 hosts only)Not accepted; use an API key or a federated tokenNot acceptedNot accepted
OAuth access tokenHeadersHeadersHandshake headersNot accepted
Partner key, certificate or OAuth tokenSame as the organization credential, plus x-auth-orgSame, plus x-auth-orgSame, plus x-auth-org (required)Not accepted
Federated tokenHeaders or query parametersHeaders or query parametersHeaders or query parametersHeaders or query parameters

Cameras on your local network accept federated tokens only. That's deliberate: on the local network, every request carries a short-lived token that you can limit to the one camera it needs, never a long-lived key. See Streaming over LAN.

Hosts per destination (US & EU Regions lists the EU variants):

DestinationUS host
REST APIhttps://api2.rhombussystems.com
Media and videohttps://media.rhombussystems.com, plus the per-camera streaming hosts that getMediaUris returns
Event WebSocketwss://ws.rhombussystems.com:8443/websocket
Cameras on your LANhttps://<camera>.lan.rhombussystems.com:8000, returned by getMediaUris

Request headers

A request names its scheme in x-auth-scheme and carries the credential in the header that scheme reads:

Credentialx-auth-schemeCredential headerExtra
API keyapi-tokenx-auth-apikey—
Certificate API keyapix-auth-apikeyTLS client certificate
OAuth access tokenapi-oauth-token, or leave it outx-auth-access-token, or Authorization: Bearer <token>—
Federated tokenfederated-tokenx-auth-ftBoth may be query parameters instead: ?x-auth-scheme=federated-token&x-auth-ft=<token>
Partner key, certificate or OAuth tokenThe same three schemes; partner-api-token, partner-api and partner-api-oauth-token are accepted as aliasesThe same headersx-auth-org: <client org UUID> (see Partner credentials)
bash
curl -X POST "https://api2.rhombussystems.com/api/camera/getMinimalCameraStateList" \
  -H "x-auth-scheme: api-token" \
  -H "x-auth-apikey: $RHOMBUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Rules that apply everywhere:

  • Header names and the scheme value are exact. x-auth-scheme: api-token works; Api-Token does not.
  • Authorization: Bearer carries an OAuth access token only, on the REST API, the media hosts and the event WebSocket. A Bearer header with no x-auth-scheme is read as an OAuth access token. API keys never go in Authorization.
  • Only federated tokens go in a URL. x-auth-scheme and x-auth-ft may be query parameters; API keys, OAuth access tokens and x-auth-org are read from headers only.
  • Credentials are region-bound. A key or token from a US organization doesn't work on EU hosts, and the reverse. The error doesn't mention the region. See US & EU Regions.
  • Lifetimes: an API key works until you delete it or until its expiry (expiresAtMs), if it has one. OAuth access tokens last one hour. Federated tokens last the durationSec you ask for when you mint them: one hour by default, at most 24 hours.
  • Revocation takes effect within 60 seconds on every host. Deleting a key, changing its role or revoking an OAuth grant ends its access, and open WebSocket connections that used it are closed.
  • Send Content-Type: application/json on every POST to the REST API, even with an empty body ({}).

Partner credentials

Partner keys, partner certificate keys and partner OAuth tokens use the same schemes as the organization credentials. To act in a client organization, send that organization's UUID in x-auth-org:

  • x-auth-org is a header only; it's never read from a query parameter. It means the same for partner keys, certificates and OAuth tokens, and an empty value counts as absent.
  • Outside the /api/partner/ endpoints, always send x-auth-org. A partner request without it still works, but the response carries Deprecation: true and Sunset: Tue, 05 Jan 2027 00:00:00 GMT, and after that date the request fails. The event WebSocket refuses a partner handshake without x-auth-org with 403 PERMISSION_REQUIRED.
  • A malformed value returns 400 INVALID_AUTH_ORG; a client organization your partner account doesn't manage returns 403 PARTNER_CLIENT_ACCESS_DENIED.

See Partner API for listing clients and calling into them.

Reading authentication errors

Every error response from the REST API, the media hosts and the WebSocket handshakes has the same JSON body, and carries the request ID in the x-rhombus-txid header too:

json
{
  "msg": "Unauthorized",
  "error": true,
  "errorCode": "CREDENTIAL_EXPIRED",
  "errorMsg": "The supplied credential has expired.",
  "status": 401,
  "timestamp": 1792371600000,
  "txid": "yJ2kQw8LTaO1xX4hVd7mPA"
}

Branch on the status and errorCode, show or log errorMsg, and quote txid when you contact support. The status says which part of the request to fix:

  • 401: Rhombus couldn't establish who is calling. The credential is missing, malformed, unknown, expired or revoked. Fix or replace the credential.
  • 403: the credential is valid but isn't allowed to do this. Change the role, the OAuth scopes, the organization or the token's limits; a new credential of the same kind won't help.
StatuserrorCodeWhat to check
401UNAUTHENTICATEDNo credential was presented: x-auth-scheme or the credential header is missing or misspelled, or an API key was sent as a query parameter
401INVALID_CREDENTIALThe value is damaged (copy and paste, whitespace), belongs to the other region, or was sent with the wrong scheme; or it no longer exists: a deleted key, a revoked federated token or one whose minting credential is gone, an access token already replaced by a refresh
401CREDENTIAL_EXPIREDRefresh the OAuth access token, mint a new federated token, or rotate a key that reached its expiresAtMs
401CREDENTIAL_REVOKEDThe OAuth grant was revoked, by the user, an administrator, or automatically after a replaced refresh token was reused. Sign in again
401CERTIFICATE_MISMATCHClient certificate does not match the api key: present the certificate issued for this key, with the scheme api (certificate keys work on api2 only)
403PERMISSION_REQUIREDThe key's role (Permissions). For an OAuth token, also its scopes: a missing scope adds WWW-Authenticate: Bearer error="insufficient_scope", scope="<required>"
403PARTNER_CLIENT_ACCESS_DENIEDYour partner account doesn't manage the x-auth-org organization
403DOMAIN_NOT_ALLOWEDA federated token minted with a domain was used from another origin, or from a client that sends no Origin or Referer (The domain field)
403DEVICE_SCOPE_MISMATCHA device-scoped federated token was used for a different device
400INVALID_AUTH_ORGx-auth-org isn't a valid organization UUID
404NOT_FOUNDThe /api path doesn't exist. Paths are case-sensitive, so a wrong capital letter gets 404 too
429RATE_LIMITEDYour organization's rate limit, or a per-camera limit on clips and frames. Wait Retry-After seconds (Rate Limits)
503SERVICE_UNAVAILABLEAuthentication couldn't be checked. Retry with backoff

Some operations report a refused action with HTTP 200 and "error": true in the body, so check the body as well as the status. The Errors page has the full catalog of codes and the retry rules.

Media hosts and the event WebSocket have their own failure cases; see Media and streams and WebSocket authentication.

Next steps