The API¶
The API is JSON under /api/v1/. The API Reference lists every endpoint.
API keys¶
An admin makes keys in Admin > API and Webhooks. A key:
- acts as a user, with exactly that user's permissions. Make a user with a role that has only what the app needs.
- is read only or read and write.
- can be limited to some endpoints.
- is shown once when it's made. Only its hash is stored.
Send the key in the Authorization header:
curl -H "Authorization: Bearer $NBS_KEY" "https://erp.example.com/api/v1/contacts?type=Customer"
Errors¶
A failed call answers with an HTTP status and a JSON body that has an error message:
| Status | Meaning |
|---|---|
| 401 | Missing or wrong key, or its user is switched off. |
| 403 | The key is read only, isn't allowed this endpoint, or its user lacks the permission. A user whose access covers only some records can't list them through the API. |
| 404 | The endpoint's module is switched off. |
Writes and approvals¶
Write endpoints use the same rules as the forms. If an entry would need a verifier or approver, the API refuses it rather than skipping the approval.