API
Everything Clauhub’s app does goes through the same API, on the same origin: https://clauhub.ai/api.
Each service (domain) publishes its procedures in one of two forms:
| Path | For |
|---|---|
POST /api/rpc/<domain>/<procedure> |
The service’s procedures (reads and writes). |
/api/http/<domain>/... |
A service’s own HTTP routes, such as identity’s sign-in. |
Some public domains: identity (accounts, organizations, members, API keys), books (fiscal and accounting), crm, commerce, payments, supply, insights, data, agents, billing, collaboration and comms.
The full procedure reference: Coming soon.
Authenticating with an API key
Section titled “Authenticating with an API key”An API key acts as the user who created it: what you can do, the key can do. Send it in the x-api-key header.
- Create:
POST /api/rpc/identity/apiKeys/create. The key (ch_...) is shown once; Clauhub stores only its hash. You can give it a name and an expiry. - List:
POST /api/rpc/identity/apiKeys/listshows each key’s name and whether it’s enabled, never the key. - Disable or enable:
POST /api/rpc/identity/apiKeys/updatewithenabled. A disabled key stops working until enabled again. - Delete:
POST /api/rpc/identity/apiKeys/delete. A deleted key stops working for good.
Creating and managing your keys from the app: Coming soon.
A call’s shape
Section titled “A call’s shape”rpc calls are POST with a JSON body: the input goes in json, and the response carries the result in json.
curl -X POST https://clauhub.ai/api/rpc/identity/profile/get \
-H "x-api-key: ch_..." \
-H "content-type: application/json" \
-d '{"json": null}'
list procedures page by cursor (limit, up to 100 per page, and nextCursor until it is null) or by offset, never both at once. Each entity also answers count (how many match the filters) and schema (its fields, filters, sorts and actions, with the permission each needs).
Errors
Section titled “Errors”| Status | Code | When |
|---|---|---|
400 |
BAD_REQUEST |
The input is invalid. |
401 |
No credentials, or a disabled or deleted key. | |
403 |
PERMISSION_DENIED |
You lack the permission; the error names it. |
404 |
…_NOT_FOUND |
It doesn’t exist, or isn’t yours. |
Rate limits and versioning: Coming soon.