Keys and access
A key acts as the person who made it, limited to what the key was made for.
What a key reaches
A key reaches an inventory only when all of these are true.
- The inventory's owner is on Business.
- The person who made the key is still in the inventory.
- The key was made for that inventory, or for every inventory.
- Their role there allows API access. Owners and Managers have it. For anyone else the owner switches on Use with an API key, and Change with an API key to make changes, in a role. The role needs Export too, because a key can read everything in the inventory.
What a key may change
Each change needs two things. The person's role must allow it, such as Add, Edit, Move or Delete, and the key must have been made to do it. A key made with nothing ticked never changes anything. All of this is checked on every call, so taking someone out of an inventory or changing their role takes effect straight away. List inventories says what your key may do in each inventory.
Give each key only what it needs
A shop that records sales needs Move and nothing else, and a key for one warehouse needs only that inventory. If it ever leaks, that's all it can do. You can have up to 10 keys at a time.
Treat a key like a password. Anyone who has it can do what it allows. If one leaks, revoke it on the API keys page of the web app and it stops working straight away.
Test against an inventory of its own
There's no separate test system. You build against the real API, using an inventory made for testing, so nothing your code does can reach real stock.
- Make an inventory called something like API test, and leave it unshared.
- Give it some realistic data. The quickest way is to export your real inventory to CSV, in the apps or the web app, and import some of its rows into the test inventory. The import creates their locations, tags and custom fields too. Leave out the QR Code column. Otherwise scanning one of your real labels asks which of the two items you mean, the real one or its test copy.
- Make a key for only that inventory. Even if your code sends the wrong id, the key can't reach anything else.
- Run every call that changes something there first, and check the results in the app and in the history.
- When it works, make a new key for the real inventories with only what the job needs, and revoke the test key. Then delete the test inventory, or keep it for next time.
Test calls count towards the same limits as everything else, so keep load tests short if another integration is already live.
Who did what
Changes appear in each item's history with the key's name, such as Sam (via API key "Shop"). The owner sees every key that can reach their inventories on the People page of the web app, and can revoke any of them.