Skip to content

Getting started with the API

This guide creates a key and uses it to call the API for the first time.

Before you start

  • A Hive Engine user with the Admin role.
  • The Business plan (or an enterprise licence). In a fiduciary Mandant, the lead must first switch on API access for this Mandant.
  • A terminal with curl.
  • About 5 minutes.

Step 1: Create a key

Open Settings → API access, click Create key, give it a name and choose the role. The exact steps are in the API access tutorial. Copy the key right away: it is shown only once.

A key always starts with hek_.

Step 2: First request

Replace <your-instance> with the address of your Hive Engine instance and hek_… with your key:

Terminal window
curl https://<your-instance>/api/v1/me \
-H "Authorization: Bearer hek_…"

The response tells you who you are for the API and what your key may do:

{
"tenant_id": "f4a8c2d6b1e9",
"tenant_name": "Example Ltd",
"key_name": "ERP connection",
"key_prefix": "hek_a1b2c3d4",
"role_name": "Full Access",
"access_level": null,
"modules": [
{ "module": "crm", "read": true, "write": true }
]
}
  • role_name is set for keys of a company, access_level for keys of a Mandant (null otherwise).
  • modules lists for each module whether your key may read and write.

Step 3: Fetch data

Terminal window
curl "https://<your-instance>/api/v1/crm/companies?limit=10" \
-H "Authorization: Bearer hek_…"

To see every endpoint, open the interactive reference at https://<your-instance>/api/v1/docs (you need to be logged in to Hive Engine), click Authorize and paste your key. The CRM endpoints are also explained with examples in the CRM reference. Formats, paging and error codes are explained on the Conventions page.

Troubleshooting

SymptomCauseFix
401 with invalid_api_keyKey copied wrongly, revoked or expiredCheck the header Authorization: Bearer hek_…, create a new key if needed
403 with api_access_not_in_planThe plan does not include API accessSwitch to Business
403 with api_access_disabledThe Mandant switched API access offThe Mandant’s lead switches on API access for this Mandant
403 with module_not_enabledThe endpoint’s module is not active or hidden for the roleEnable the module or choose another role
429 with rate_limitedMore than 120 requests per minuteRetry after Retry-After seconds

What’s next