Pairing & security
How a device joins your account, the safeguards on pairing codes and device keys, and what to do if one is exposed.
A device joins an account in one of two ways. Pairing: the device redeems a 6-digit code from the dashboard and receives its own key. Registering with an API key: for a device that can't pair, you name it and choose its bin in the dashboard, which shows its key once for you to copy onto the device.
- Pairing code
- 6 digits, single use
- Code lifetime
- 10 minutes
- Wrong-code limit
- 10 per 15 minutes, per IP
Pairing codes
When you add a device, the dashboard creates a 6-digit code. You enter it on the device's own page, and the device redeems it with the API. The code is the only thing that links a device to your account, so it is deliberately short-lived.
429. The proxy also limits pairing requests to 10 a minute per IP.Device keys
Every device has its own API key, which it sends in the x-key header with every upload to POST /records. The key can do nothing else.
401, and the device can be paired again.Pairing step by step
- 1Dashboard
Get a code. Choose Pair a device, then Get pairing code. The code works for 10 minutes.
POST /pairing/codes - 2Device page
Enter the code. The device sends it with its hardware ID and receives its key.
POST /pairing/redeem - 3Dashboard
Check the hardware ID. The dashboard shows which device redeemed the code. Make sure it matches the ID on the device's page.
GET /pairing/codes/{code} - 4Dashboard
Confirm. Name the device and choose its bin. Until you do, its uploads are answered with
409.POST /devices/{id}/setup
If the hardware ID in step 3 isn't yours, don't confirm it. Remove the device and create a new code. An unconfirmed device can't add readings to your account.
If a code or key is exposed
| What was exposed | What to do |
|---|---|
| A pairing code nobody has used | Nothing. Let it expire, or create a new one. |
| A pairing code someone else redeemed | Don't confirm the unknown hardware ID. Remove it and create a new code. |
| A paired device's key | Remove the device in its settings, then pair it again. The old key stops working when you remove it. |
| A registered device's key | Choose New API key in the device's settings and copy the new key onto the device. The old one stops working at once. |
| Your password | Change it on the account page. Sessions that are already signed in end within 8 hours. |
Accounts and sessions
401 response./auth/, then 429.404.What the open data includes
The research API only ever returns figures summed up per country: never names, emails, bin names, locations finer than country, or device identifiers. It needs a research key, which only a researcher account can create. Keys are stored as SHA-256 hashes, and deleting one stops it working at once. The data dictionary lists every field.
The public figures on this website need no key and are coarser still: totals across every bin, the number of bins in each country, and daily averages across all bins.
Reporting a vulnerability
Email [SECURITY CONTACT EMAIL] with the steps to reproduce it. Please don't disclose it publicly until it has been fixed.