Tenancy & environments
Every API key belongs to exactly one tenant (merchant) and one environment. Tessera never infers the tenant from a request body or path — it’s always resolved from the bearer key, so a key can only ever see and act on its own tenant’s data.
Two environments, two hosts
Section titled “Two environments, two hosts”| Environment | Base URL |
|---|---|
sandbox | https://sandbox.usetessera.io/v1 |
production | https://api.usetessera.io/v1 |
Sandbox and production are entirely separate deployments with separate data — a member, redemption, or event created in sandbox never appears in production, and vice versa.
Two key scopes
Section titled “Two key scopes”Each environment issues a key pair:
| Key type | Prefix | Can call |
|---|---|---|
| Secret key | sk_test_… (sandbox) / sk_live_… (production) | Every endpoint. Server-side only — never ship it to a browser. |
| Publishable key | pk_test_… (sandbox) / pk_live_… (production) | Only the public reads: the rewards catalogue (GET /v1/rewards / GET /v1/catalogue), the tier ladder (GET /v1/tiers) one programme (GET /v1/programs/{ref}) and a generic earn preview (POST /v1/earn/preview without external_id). Any other call is rejected with publishable_key_forbidden (403) before it touches your data. |
Present whichever key as Authorization: Bearer <key>. See
Authentication for the header details and
Errors & the envelope for the full error catalogue.
The key/host guardrail
Section titled “The key/host guardrail”Because sandbox and production are separate deployments, a sandbox key simply doesn’t resolve
against the production host (and a production key doesn’t resolve against sandbox) — presenting
one to the wrong host fails closed with unauthorized (401), the same as any other invalid
credential.