Skip to main content

API Keys

API Keys are workspace-level secrets that let external clients call DronaHQ APIs on behalf of your agents. Each key is a sk_ prefixed token. Its Scopes decide which APIs it can call, and its Agent Access can limit it to a specific list of agents.

A single key can hold any combination of scopes — pick the minimum set the integration actually needs.

Overview​

When you generate a key:

  • DronaHQ returns the full secret once. After that only the last 4 characters are visible in the UI.
  • The key is bound to your workspace and to the Scopes and Agent Access you pick at creation time.
  • Every call made with the key is recorded in Request Logs for 30 days.
Create an API Key in the Developer section
Creating an API key under Developer → API Keys

Creating an API Key​

  1. Go to Developer → API Keys.
  2. Click New Key.
  3. Fill in the form:

Name​

  • A friendly label for the key in the UI.
  • Examples: Production backend, CI runner, Zapier integration.
  • Required field.

Scopes​

  • One or more scopes. Scopes are additive — a key with Voice agents and Calls can build agents and call with them.
  • Agent and Data Agent call those agent types.
  • Each of the APIs below has one scope, and it gives the key both read and write access to that API:
ScopeWhat the key can do
Voice agentsCreate, read, update and delete voice agents with the Voice Agents API, and list the LLM models and voices they can use
CallsPlace calls with Outbound Call Dispatch, and read them with the Call Data API
CampaignsCreate, change, control and read campaigns and their attempts with the Campaign API
Phone numbersAdd, read, delete and unlink numbers with the Phone Numbers API
Knowledge basesCreate, read and delete knowledge bases, and add or remove their sources, with the Knowledge Bases API
Structured outputsCreate, read, change, copy, test and delete structured outputs, and read the library, with the Structured Outputs API
Voice providersRead the voice and transcriber providers and their models, and save, switch or delete the workspace's own key for each, with the Voice Providers API
  • A scope reaches only its own API. Calls gives nothing on campaigns or voice agents, for example.
  • In API responses and error messages, a scope is named by its ID and the access a route needs: calls:read for a GET, calls:write for the rest. The Calls scope gives both.
  • Pick the minimum set required by the integration. If the key leaks, a tighter scope limits the blast radius.
  • Required field.
Legacy scopes

Keys created before these scopes may have Voice Agent or Agent Creator. They keep working:

  • Voice Agent gives Calls and Campaigns.
  • Agent Creator gives Voice agents.

Neither gives Phone numbers, Knowledge bases, Structured outputs or Voice providers. A new key can't be given a legacy scope. On an existing key it shows as Voice Agent (legacy) or Agent Creator (legacy), and you can remove it when you Edit the key, but not add it back.

Agent Access​

  • All Agents (default) — the key can target every agent under the selected scopes.
  • Or pick a specific subset of agents. The key will be denied access to anything outside that list. The list must name at least one agent, and it applies to every scope on the key.
  • An agent the key creates with the Voice Agents API is added to that key's list, so the key can keep managing what it builds. If the key also has Calls, it can place calls with the new agent too.
  • Deleting a voice agent removes it from every key's list. A key whose list ends up empty can't reach any agent, so it is disabled. To use it again, Edit its Agent Access, then turn Enabled back on.

Expires​

  • Never / 30 days / 90 days / 1 year / Custom date.
  • For production keys, prefer a non-Never value so a forgotten key eventually stops working.
Create an API Key in the Developer section
Creating an API key under Developer → API Keys → Create key

Saving and copying the secret​

The full sk_... value is shown once, immediately after you click Create. Copy it into your secret store right then.

After you close the dialog, only the last 4 characters are visible — the Key Preview column shows the secret as ••••••••a1b2. If you lose the secret, you cannot recover it; delete the key and create a new one.

danger

Treat the secret like a password. Anyone with the full sk_... value can call your APIs with the same permissions as the key. Never share it in screenshots, support tickets, or public channels.

Using the API Key​

Include the key in every request, in either of these headers. They work the same; if a request sends both, the api-key header is used.

Header format:

Authorization: Bearer sk_<your-secret>

or

api-key: sk_<your-secret>

Example cURL (dispatching an outbound voice call — see the Outbound Call Dispatch API for the full reference):

curl -X POST https://<your-dronahq-host>/voice/outbound/dispatch \
-H "api-key: sk_your-generated-secret-here" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "<voice-agent-uuid>",
"destination_phonenumber": ["+14155551234"]
}'

If the request goes through a reverse proxy, the backend honors x-forwarded-for so the original caller IP appears in Request Logs.

Auth errors​

Every API that takes a key answers an auth failure the same way:

HTTP statusMeaning
401The key is missing, unknown, disabled or expired
403The key is valid, but it lacks the scope the API needs, or the agent isn't on its Agent Access list

detail is a message string, such as "This API key is disabled.". A request whose key is missing or unknown can't be tied to your workspace, so it doesn't appear in Request Logs.

Managing keys​

The API Keys list shows the following columns:

ColumnWhat it shows
NameThe label you set at creation
Key PreviewLast 4 characters of the secret (the full value is never shown again)
ScopesThe scopes on the key, for example Calls
Agent AccessAll Agents, or the count of allowlisted agents
ExpiresExpiry date, or Never
Last UsedTimestamp of the most recent successful auth (see below)
EnabledToggle — controls whether the key authenticates

Last Used moves on every request where the key is valid and has the scope the API needs, even if the request then fails, for example with a 403 because the agent isn't on its Agent Access list, or with a 422. It doesn't move on a 401, or when the key lacks the scope the API needs.

Available operations:

  • Enable / Disable — flip the Enabled toggle. A disabled key fails auth with disabled but is preserved, so its Request Log history stays intact. Use this for temporary lockouts.
  • Edit — change Name, Scopes, Agent Access, or Expires. The secret itself never changes.
  • Delete — hard delete. The key cannot be recovered. There is no rotate operation — to rotate, create a new key, switch traffic over, then delete the old one.

Security Best Practices​

  • Never commit a key to source control. Store it in a secret manager (Vault, AWS Secrets Manager, Doppler) and inject it at runtime.
  • Set an expiry. Time-bound production keys so a forgotten one eventually fails closed.
  • Grant least privilege. Use the narrowest Scopes + Agent Access the integration needs.
  • Disable before deleting. If you might need to roll back, disable first — Request Logs stay attached to the key.
  • Rotate on exposure. On any suspected leak, create a new key, switch traffic, then delete the old one.