Authentication
Create, send, limit and revoke the API keys that identify your workspace on every public /v1 request.
Every request to /v1 carries a workspace API key. The key tells Dhvanee which workspace you are, and its scopes say what you may do there. Keys are made and revoked in the dashboard, never through the API.
Key kinds
| Property | Secret key | Publishable key |
|---|---|---|
| Starts with | dhvanee_live_ | dhvanee_pub_ |
| Scopes allowed | Any scope, including every write scope and copilot:use. | Read scopes only: every *:read scope. No write scopes and no copilot:use. |
| Where it belongs | Your servers, scripts and the local MCP. Never in a browser or mobile app. | Places where the key is visible to the people using it, such as a partner or mobile app that only reads. |
| After you create it | Shown once. Dhvanee keeps only a one-way hash, so a lost key cannot be recovered; make a new one. | Stays visible in Settings → Developer access → API Keys → Public so you can copy it again. |
Create a key
- Open Settings → Developer access → API Keys in the dashboard. Only the workspace Owner and Admins can see this page.
- Choose Secrets or Public, click Create API Key, give it a name (1 to 120 characters) and tick the scopes it needs.
- A workspace can hold at most 10 active keys. At the limit, creating another is refused with
422andThis workspace already has the maximum of 10 active API keys. Revoke an unused key first. - Use one key per integration. A key's scopes cannot be edited after creation: to change them, create a new key and revoke the old one.
- Keys do not expire. They work until you revoke them.
Send the key
Send the key in either header. They are equivalent:
| Header | Value |
|---|---|
Authorization | Bearer dhvanee_live_YOUR_KEY |
X-API-Key | dhvanee_live_YOUR_KEY |
The word Bearer is not case sensitive. If you send both headers they must hold the same key, otherwise the request is refused with 401.
curl -sS -X GET "https://api.stage.dhvanee.com/v1/contacts?limit=5" \
-H "Authorization: Bearer dhvanee_live_YOUR_KEY"The same request with the other header:
curl -sS "https://api.stage.dhvanee.com/v1/contacts?limit=5" \
-H "X-API-Key: dhvanee_live_YOUR_KEY"Scopes
A scope is a permission written as resource:action. A route needs exactly one scope, shown below. A key may hold several.
| Scope | Lets the key |
|---|---|
contacts:read | List and read contacts. |
contacts:write | Create, update and delete contacts. |
calls:read | List and read calls. |
calls:write | Place a call and stop a call. |
campaigns:read | List and read campaigns. |
campaigns:write | Create, start, pause, resume and cancel campaigns. |
agents:read | List and read agents, their workflow and their published versions. |
agents:write | Create, rename, delete and publish agents, and save a workflow. |
knowledge:read | List knowledge documents and read an agent's attached documents. |
knowledge:write | Upload and delete documents, and change an agent's attached documents. |
automations:read | List and read automations and their runs. |
automations:write | Create, change, activate and run automations. |
numbers:read | List the workspace's phone numbers. |
numbers:write | Import a number you own, and attach or detach a number to an agent. |
account:read | Read the plan, balances and wallet summary. |
copilot:use | Send a message to the workspace copilot. This spends copilot credits. |
contacts:write and nothing else.When a key is refused
| Status | `detail` | Cause |
|---|---|---|
401 | Valid API key is required | No key was sent, the Authorization header is not Bearer <key>, the value does not start with dhvanee_live_ or dhvanee_pub_, or Authorization and X-API-Key disagree. |
401 | API key is invalid or revoked | The key is well formed but unknown or revoked, or its workspace is suspended or deleted. |
403 | API key needs contacts:write scope | The key is valid but lacks the scope the route needs. The message names that scope. |
403 | Publishable API keys cannot use this scope | A publishable key was used on a route that needs a write scope or copilot:use. |
Repeated attempts with a wrong key from one address are throttled; see Rate limits. All status codes are listed under Errors.
Revoke a key
- In Settings → Developer access → API Keys, switch the key off in the Revoke column and confirm.
- A revoked key stops working on its next request and cannot be turned back on. Anything still using it starts getting
401. - A revoked key no longer counts toward the limit of 10, so you can create its replacement.
- If a workspace is suspended or deleted, all of its keys are revoked and its webhooks are switched off automatically.
The key list shows each key's name, a shortened form of the key and when it was created. Name keys after the integration that uses them so you know which one to revoke.