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:
curl -u "$SIPRTC_AUTH_ID:$SIPRTC_AUTH_SECRET" \ "https://api.siprtc.io/v1/Accounts/$SIPRTC_AUTH_ID/Balance"Which accounts a request may name
Section titled “Which accounts a request may name”- 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.
Rotating your Auth Secret
Section titled “Rotating your Auth Secret”An account can hold a primary and a secondary secret at the same time, so you can rotate without downtime:
- Create a secondary secret (see API credentials).
- Deploy it to your applications. Requests signed with either secret succeed.
- 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.
Keep secrets on the server
Section titled “Keep secrets on the server”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.