Skip to content

Authentication

Every request to https://api.siprtc.io is authenticated with HTTP Basic authentication:

Basic auth field Value
Username Your account Auth ID — a 20-character identifier such as MA0000000000000000AB
Password Your account Auth Secret

Both are in the console under API credentials. The Auth ID also appears in every account-scoped path, so a request names the account it acts on:

Terminal window
curl -u "$SIPRTC_AUTH_ID:$SIPRTC_AUTH_SECRET" \
"https://api.siprtc.io/v1/Accounts/$SIPRTC_AUTH_ID/Balance"
  • A tenant account may only name its own Auth ID in the path.
  • A vendor account (a reseller that creates accounts for its own customers) may name its own Auth ID or the Auth ID of one of its tenants, using the vendor’s credentials. Endpoints built for this, such as tenant balances, say so in their description.

A request that names any other account is refused with 401 or 403.

An account can hold a primary and a secondary secret at the same time, so you can rotate without downtime:

  1. Create a secondary secret (see API credentials).
  2. Deploy it to your applications. Requests signed with either secret succeed.
  3. Promote it to primary and delete the old one.

A changed or revoked secret can take a few minutes to stop being accepted everywhere, because the API caches successful credential checks briefly.

Never put your Auth Secret in a browser, mobile app or anything you ship to users. For the browser and mobile SDKs, have your server create a short-lived client token and hand that to the client instead.