Send your key
Pass the key in theAuthorization header of every request.
Create and manage keys
Create keys under Settings > API Keys. When you create a key you choose:- Name. A label so you can tell keys apart, such as the name of the integration.
- Scopes. What the key can do. Pick only what the integration needs.
- Expiry. 30, 90 or 365 days.
Scopes
A request without the needed scope fails with
403 and the code insufficient_scope.
A key never exceeds its owner
A key acts as the person who created it. Two things follow from that.Roles are checked on every request
Roles are checked on every request
A scope only works while the owner’s role still allows it. If you remove contact editing from a member’s role, their keys lose
contacts:write immediately, without being revoked or recreated.Some people only see their own records
Some people only see their own records
Roles can limit a member to their own contacts, and the works and documents that belong to those contacts. A key owned by such a member sees only that slice. Records outside it return
404, as if they did not exist, and they never appear in lists.Creating also respects this. Such a key cannot create a work or document for a contact it cannot see, or link an invoice to a work it cannot see.Assigning documents to other users
Assigning documents to other users
By default a new invoice or quotation is assigned to the key’s owner. Setting
user_id to someone else needs the assign user permission on the owner’s role.Keep keys safe
- Use one key per integration so you can revoke one without breaking the others.
- Never put a key in browser code, a mobile app or a public repository.
- Rotate keys before they expire: create the new key, switch the integration over, then revoke the old one.
- If the owner’s account is suspended, their keys return
403with the codeaccount_suspended.
