Keys
Every workspace has one publishable key for apps and websites, and any number of secret keys for servers.
Two keys
| Key | Looks like | Where it goes | What it can do |
|---|---|---|---|
| Publishable key | st_pub_live_… |
Your app and website | Resolve links, report opens, match installs, send events |
| Secret key | st_live_… |
Your server only | Create, list, update and deactivate links, export, send events (or less: see below) |
The publishable key is in Dashboard → Setup → Your keys. Secret keys are in Dashboard → Settings → Keys. Never put a secret key in an app or a web page: anyone can read it from there. When your app needs a new link (a share button, a referral), it asks your server, and your server calls the API with the secret key. See Create links in the app.
What a secret key may do
When you create a secret key you choose what it may do. You can't change it later; make a new key instead.
| Access | It can | Use it for |
|---|---|---|
| Full access | Everything a secret key can do | Your main server |
| Links only | /v1/links (create, read, change, pause, QR codes) and /v1/simulate, nothing else |
A backend that only makes links |
| Read only | Every GET: links, analytics, usage, exports. It changes nothing |
AI tools, reports and dashboards |
A call outside the key's access gets 403 with "error": "key_scope" and a message saying which access it needs. Keys made before 24 October 2026 have full access. With a read-only key, the MCP server offers your AI tool only the tools that read.
Rotating keys
Publishable key. Rotate it in Dashboard → Setup → Your keys. You get a new key right away, and the old one keeps working for 7 days, so apps already on people's phones keep working while you ship an update with the new key. During those 7 days, responses to the old key carry a Strait-Key-Deprecated header with the time it stops working (ISO 8601, for example 2026-01-08T12:00:00.000Z). After that, the old key gets 401. If you rotate again within the 7 days, the key from the earlier rotation stops at once: only one old key is honoured.
Secret keys. You can have several. Each one in Dashboard → Settings → Keys shows when it was last used ("never used" if it hasn't been), so you can spot a key nothing uses any more before you revoke it. We store only a hash, so a new key is shown once. Revoking a secret key stops it immediately. To replace one without downtime, create the new key, deploy it, check the old key's last-used date has stopped moving, then revoke the old one.
If a secret key leaks
Revoke it in Dashboard → Settings → Keys and create a new one. Revoking takes effect on the next request. Then check Links for changes you didn't make.