Overview
Most Bland integrations start with a human signing up in the dashboard, minting an API key, and pasting it into whatever they’re building. That doesn’t work well for an autonomous bot: there’s no dashboard session to sign into, and often no browser or localhost to redirect back to. Agent onboarding solves this with a device-authorization flow, the same shape used by tools likegh auth login or a smart TV signing into a streaming app: the bot starts the flow over a plain API call, shows its owner a short code and a link, and polls in the background while the owner finishes signup and subscribes in their own browser. No callback URL, no localhost, no client secret. It works the same way whether the bot is running on your laptop or on a server with no browser at all.
At the end of the flow, the bot receives a dedicated API key and the phone number provisioned for it. The owner never sees or handles the key.
This flow signs the owner up for the Agent Phone Plan. If the owner already has a Bland account, they sign in and subscribe instead of creating a new one.
The flow
1
Start the flow
Call
POST /v1/agent/onboarding/start. No API key is required, this is how a bot gets one.Response
client_name is optional (up to 64 characters, letters, numbers, spaces, and ._/-). It’s shown to the owner so they know which bot is asking.2
Show the link and code to your owner
Display
verification_url_complete (or verification_url plus user_code if you can’t render a clickable link) wherever your owner will see it: a chat message, a terminal, a Slack DM.The owner opens the link, signs up or logs in, enters the code if it isn’t already pre-filled, and subscribes to the Agent Phone Plan. This happens once, in their browser. Your bot doesn’t participate in it beyond polling for the result.3
Poll until approved
Call Each response has a Back off to the
POST /v1/agent/onboarding/poll with the device_code, waiting at least interval seconds between calls.status:If you poll faster than
interval, you get a 429 with error code SLOW_DOWN instead of a status:429 SLOW_DOWN
interval in the error body (also sent as a Retry-After header) before polling again.4
Use the key
Once This is the only time
status is approved, the response looks like this:Response
api_key is returned. Store it immediately, the code is single-use, so polling again after this returns expired.The device flow is region-bound. Start and poll must target the same API host the owner’s dashboard uses. For most accounts that is
https://api.bland.ai, paired with https://app.bland.ai. Regional dashboards pair with a regional API host: eu.app.bland.ai with eu.api.bland.ai, ca.app.bland.ai with ca.api.bland.ai, and both asia.app.bland.ai and au.app.bland.ai with asia.api.bland.ai. If poll returns expired right after the owner told you they approved, check the host pairing first.Try it with a client
- cURL
- bland-cli
- bland-skills
Use the two calls above directly:
POST /v1/agent/onboarding/start, then poll POST /v1/agent/onboarding/poll with the returned device_code until status is approved.Error codes
The
/approve codes happen in the owner’s browser during signup, your bot only ever sees their effect: poll staying pending for longer than expected, or eventually returning expired.
Security notes
- Codes expire in 15 minutes. If the owner doesn’t finish in time, start over with a new
/startcall. - Codes are single-use. The first successful
pollafter approval returns theapi_keyand consumes the code. Any poll after that returnsexpired. - The API key is scoped to that org and can be revoked at any time from Settings > API Keys in the dashboard, without affecting any other keys on the account.
- Each approval mints a new key. Running onboarding again for the same org creates another org key rather than reusing one, so the list in Settings > API Keys grows by one per connected agent. Revoke the ones you no longer use.
- Treat the returned
api_keylike a password: store it in your bot’s secret storage, not in logs or chat transcripts.
MCP requires an API key. If your agent talks to Bland over MCP, use the
api_key from this flow the same way you’d use any other Bland API key.Next steps
Agent Phone Plan
What’s included, limits, and how to cancel.
Command Line Interface
bland auth login --device and the rest of the CLI.Docs for agents: llms.txt