API keys
Secret and publishable keys, limiting a key to read-only, to named tables, to certain addresses and to an expiry, rotating with a grace period, and revoking.
On this page
Keys are managed on the API tab by the website's owner. Press New key to make one. Make one key per tool, so you can turn one off without breaking the rest.
Two kinds
| Kind | Prefix | Where it lives | What it can do |
|---|---|---|---|
| Secret | pxa_sk_ | Your server. Never in a page. | Read and write every table, run functions. Refused if a browser presents it. |
| Publishable | pxa_pk_ | A page, a mobile app, anywhere public | Read tables anyone can read, on a website anyone can visit. Never writes, never sees who created a row. |
Creating a key
Name the key after the tool it serves, so you recognise it later.
Secret for a server, Publishable for a page. A publishable key only works on a website anyone can visit.
Optional. Access: Read and write or Read only. Stops working: Never, or in 1, 7, 30 or 90 days, or in a year. Data it can reach: tick the tables it may touch, or leave all unticked for everything. Only from these addresses: the IP addresses or CIDR blocks it may be used from.
The key is shown a single time. If you lose it, make another key and revoke this one.
Rotating
Rotate gives you a replacement straight away, with the same name and limits. Under The old key keeps working for, choose No time, it stops now (use this if it leaked), 1 hour, 24 hours or 7 days, so every tool can be switched over without a gap.
Revoking
Press Revoke and every call with that key answers unauthorized from that moment. A key past its Stops working date answers the same way. Nothing else about the website changes.
Seeing what a key does
On the Logs tab, API calls lists every call with the key it used. Filter by key to see what one tool is doing.
What went wrong? Pick any that apply.
That didn't send. Try again in a moment.