Get started

Authentication

Log in with a one-time code, get a token per environment, rotate it, and keep it on your server.

Log in with a code

There are no API keys to request: you log in with the phone number registered on your partner account.

  1. /login sends a 6-digit code by SMS or WhatsApp. Any usual number format works (05…, +966…).
  2. /enter exchanges the code for an accessToken.

loginType picks the environment: prod for real money and real eSIMs, test for the sandbox.

Using the token

Send the token on every other call as Authorization: Bearer <token>. Tokens don’t expire; they stay valid until you rotate them. A missing or invalid token answers HTTP 401 with AUTH_UNAUTHORIZED.

One token per environment

Each partner has two separate accounts with their own balance, orders, webhooks and token. The base URL is the same; the token decides where a request goes.

LiveSandbox
Log in withloginType: "prod"loginType: "test"
MoneyReal, topped up by card / mada / Apple PayTest, set with /sandbox/balance
eSIMsReal, installableSimulated, with their own ICCIDs
Webhooksenvironment: "production"environment: "sandbox"

Store both, labelled. Most integrations read the token from an environment variable per deployment.

Rotating a token

/accesstoken/refresh issues a new token and invalidates the old one immediately. Rotate when someone who had access leaves, when a token may have leaked, or on a schedule.

Keep tokens on your server

A token can spend your balance. Treat it like a password:

  • Keep it on your server. Never put it in a mobile app, a browser bundle or a public repo: anything shipped to a device can be extracted.
  • Your apps call your backend; your backend calls Burj.
  • Keep it in a secret manager or environment variable, not in code. Don't log it.
  • Use the sandbox token for development and CI, and the live token only in production.
  • If it leaks, rotate it at once.