Authentication
Every Dial request is authenticated with an API key — a string that begins with sk_live_. Send it as a Bearer token:
Requests without a valid key get 401 Unauthorized.
Get an API key
Create an account and key with the CLI:
Creating an account requires a verified phone number as well as a verified email, so a new signup runs all four steps. Signing in to an account you already have needs only the first two.
The final step returns your key once and saves it locally, so subsequent dial commands are already authenticated.
Coupon codes
If you have an event coupon, pass it on the first step: dial auth login you@example.com --coupon <code>, or coupon in the POST /v1/auth/signup body. A valid coupon lets a new account sign up even while new signups are paused, and its credit is added when the account is created. Coupon credits can expire: whatever is left is taken back at the coupon’s expiry. An invalid, inactive, or already-used coupon is refused on that first step, before any code is sent. Coupons apply to new accounts only.
Calling the API directly follows the same shape: POST /v1/auth/signup, then POST /v1/auth/verify. If verify returns registrationId rather than an apiKey, the flow isn’t finished — continue with POST /v1/auth/register-number and POST /v1/auth/verify-number, and that last call returns apiKey a single time. Store it.
Use your key
- CLI — handled automatically once
dial auth verify-otpcompletes. - SDKs — pass the key when you construct the client:
Treat your API key like a password. It grants full access to your account — send messages, place calls, and read history. Never commit it; prefer an environment variable.
Base URL
All requests go to:
The CLI and SDKs target this by default. To point a tool at a different deployment, set the DIAL_API_URL environment variable (CLI) or pass baseUrl / base_url when constructing an SDK client.
Older SDK or CLI versions default to https://getdial.ai instead. Both URLs serve the same API — your existing code keeps working. Upgrade when convenient (npm update @getdial/sdk / pip install --upgrade dial-sdk / npm i -g @getdial/cli@latest) to pick up the new default.
Review your keys
GET /v1/account returns your account and a preview of each key (never the full value). See Core concepts for the object model.
Rotate a key
If a key may have leaked (it was committed, logged, or stored with a provider that disclosed a breach), rotate it. Rotation gives the key a new secret value and the old value stops working immediately. The key keeps its id and label, and signing in again returns the new value.
With the CLI, rotate the key it is signed in with. The new key is saved locally, so later dial commands keep working:
Over the API, find the key’s id in GET /v1/account (the key making the request is marked current: true), then rotate it:
The response holds the new value in apiKey, shown only once. You can also rotate keys from Settings in the dashboard.
There is no grace period. Anything still using the old key (a deployed service, an agent, an environment variable) gets 401 Unauthorized until you update it with the new value.
A member can rotate only their own key. To cut off a member’s access entirely, remove the member instead.
Agent registration (auth.md)
The steps above are the main way to get a key, and they don’t change. Dial also supports auth.md agent registration as a second way in, for agents that follow that standard rather than Dial’s own signup calls. A person still signs in to Dial (or signs up, with the same email and phone verification), so every account still belongs to a verified person. What changes is where they type the codes: on getdial.ai instead of in a chat with the agent.
Dial supports the service_auth method only: the agent knows the person’s email. The
anonymous and identity_assertion methods are refused with anonymous_not_enabled and
issuer_not_enabled.
1. Discover. https://api.getdial.ai/.well-known/oauth-protected-resource names the REST
API’s authorization server, https://api.getdial.ai. Its metadata, at
https://api.getdial.ai/.well-known/oauth-authorization-server, lists the endpoints in its
agent_auth block. https://getdial.ai/.well-known/oauth-authorization-server carries the same
block.
2. Register. Send the person’s email:
claim_token is returned once and lasts 24 hours. Keep it in memory until the person has
finished.
3. Hand off to the person. Show them verification_uri and user_code. They open the link,
sign in or sign up with that same email, and type the 6-digit code on the page. A signed-in
person with a different email can’t complete it. The code is valid for 10 minutes.
4. Poll for the key. Every interval seconds, poll the token endpoint with the claim grant:
Until the person finishes, the response is 400 with {"error": "authorization_pending"}.
Polling faster than interval returns slow_down. Once they’ve entered the code:
The access_token is the person’s existing Dial API key, the same one signing in returns. No
new key is created. Use it with the REST API, CLI, and SDKs exactly like a key from the steps
above. It doesn’t expire, and each registration hands it over once. It can’t be exchanged or
refreshed (no identity_assertion is issued). To cut the agent off, rotate the key as described
in Rotate a key; anything else using it will need the new value.
If the code runs out. Polling returns expired_token when the 10-minute code expires. Ask
for a new code with the same claim_token, then hand the new one to the person:
The response carries a fresh claim_attempt block with the same fields as claim. After 24
hours the registration itself expires: this call returns 410 with claim_expired, and
polling returns invalid_grant, so start again at step 2.