Hubzone DevelopersBack to hubzone.appTR

Authentication

Keys, permissions (scopes) and how to keep a key safe.

Every call carries an API key in the Authorization header. A key cannot be sent in the body or the query string.

Authorization: Bearer hzk_your_key_here

Permissions (scopes)

Give each key only what it needs. A permission is a kind of record and a mode: <type>.read or <type>.write. A call without the right permission answers 403.

PermissionAllows
contacts.readRead contacts: list, find, read one, list properties
contacts.writeCreate and change contacts
companies.readRead companies: list, find, read one, list properties
companies.writeCreate and change companies
deals.readRead deals: list, find, read one, list properties
deals.writeCreate and change deals
tickets.readRead tickets: list, find, read one, list properties
tickets.writeCreate and change tickets
products.readRead products: list, find, read one, list properties
products.writeCreate and change products
orders.readRead orders: list, find, read one, list properties
orders.writeCreate and change orders
calls.readRead calls: list, find, read one, list properties
calls.writeCreate and change calls

Good practice

  • Keep keys on your server. Never put one in a web page, a mobile app or a public repository.
  • Make a separate key for every system, with the smallest set of permissions. Start with read only.
  • Revoke a key at any time under Settings > Developers; the last calls of each key are listed there.
  • A key can have an expiry date and a list of allowed IP addresses.
  • Wrong keys are limited per address, so guessing does not work.

Authentication errors

// 401: no key, a wrong key, or a revoked or expired key
{ "statusCode": 401, "message": "..." }

// 403: the key is valid but lacks the permission (or the address is not allowed)
{ "statusCode": 403, "message": "..." }