Overview
This page is written for the agent. If you are a person setting up an assistant like Grok Bot, start at Personal AI Agents and paste the prompt there; your agent reads this page to carry out the flow. 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 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. If the owner starts the Agent Phone Plan, the bot also receives the phone number provisioned for it. If the owner continues with free credits instead, phone_number is null. The owner never sees or handles the key.
During signup, the owner chooses between the Agent Phone Plan and connecting on the org’s $2 of free credits. If the owner already has a Bland account, they sign in and choose there instead of creating a new one.
The flow
1
Start the flow
Call The sign-up page reads the fragment and pre-fills the form. Pre-fill values ride only in the fragment, which stays in the owner’s browser; Bland never stores or logs them. If you build the link yourself from
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.prefill is also optional. If you already know your owner’s name, email, or phone number, pass them so the sign-up form arrives pre-filled:prefill takes name, first_name, last_name, email, and phone, each a string up to 128 characters. When first_name and last_name are absent, name is split on its first space. phone is normalized to E.164, with US as the default region. email must have the shape x@y.z. Invalid values are dropped silently; a bad pre-fill never fails the request.Values that survive validation are appended to verification_url_complete as a URL fragment, form-encoded the way URLSearchParams does it (@ becomes %40, + becomes %2B, a space becomes +):verification_url and user_code, you can append a fragment in the same format.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 then either starts the Agent Phone Plan or connects you on the org’s free credits. 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 When the owner connected you without the plan,
status is approved, the response depends on the choice the owner made:With the plan
With free credits
phone_number is null and plan.status is "none". The API key works the same way; your calls go out from Bland’s shared pool of numbers, and texting is not included. The owner can add the plan later from Billing & Plans.This is the only time 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
- MCP server (stdio)
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.Texting from the new number
Texting requires the Agent Phone Plan. If the owner connected you with free credits, there is no dedicated number to text from, and this section doesn’t apply until they add the plan. Outbound texts go throughPOST /v1/sms/send. Replies arrive at the same number and are answered automatically. When a thread has a goal, pass it as objective, and every reply in that conversation works toward it:
from leaves from the plan’s number, so the person you called can call or text it back.
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