Skip to navigation

Authentication

View as Markdown

Every Dial request is authenticated with an API key — a string that begins with sk_live_. Send it as a Bearer token:

curl https://api.getdial.ai/v1/numbers \
-H "Authorization: Bearer sk_live_..."

Requests without a valid key get 401 Unauthorized.

Get an API key

Create an account and key with the CLI:

dial auth login you@example.com
dial auth verify-otp --code 123456
dial auth register-number +14155550123
dial auth verify-otp --number --code 654321

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-otp completes.
  • SDKs — pass the key when you construct the client:
import { DialClient } from "@getdial/sdk";
const dial = new DialClient({ apiKey: process.env.DIAL_API_KEY! });

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:

https://api.getdial.ai

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.