Phone numbers
List and manage phone numbers, provision new ones, and import numbers from your own Twilio account.
A phone number is an assistant's calling channel. Callers reach the assistant on it, and the assistant's outbound calls dial from it (from a number provisioned by dBel, on request). It is attached to at most one assistant (assistantId), and an assistant has at most one number. Attach a number with connectPhoneId on the assistant endpoints. Numbers arrive one of two ways:
- Provisioned by dBel (
provider: "dbel") — searched and bought through the provision endpoints. Billed on the workspace owner's subscription; deleting one releases it for good. - Imported from Twilio (
provider: "twilio") — a number you already own in a Twilio account connected on the Integrations page. Deleting one only detaches it; you keep the number.
Beta. This API is documented but not yet frozen. Response fields and error codes may change without a version bump. Pin your integration to the fields you use, and expect additions.
Roles
Any member can list, read and search. Provisioning, importing and deleting need ADMIN or OWNER. Provisioning also needs a paid plan on the workspace owner's subscription, and that subscription must be active with no failed payment. Otherwise it answers FREE_PLAN_RESTRICTED or SUBSCRIPTION_ISSUE.
Provisioning is asynchronous
GET /api/phones/provision?countryCode=US— search the inventory. OnlyUSandCAare available. The search returnslocalnumbers only, each with its monthly and per-minute prices.POST /api/phones/provisionwith the chosenphoneNumber,countryCodeandtype— you get202and astatusUrl(also in theLocationheader) at once. Before it answers, the POST charges the prorated amount to the workspace owner's subscription, and adds the number only once that payment succeeds. If the payment does not go through (the card is declined or needs authentication), nothing changes: the invoice is voided, the request endsfailed, and the POST answersPURCHASE_PAYMENT_FAILED(402). Send a newclientRequestIdto try again. Toll-free numbers are no longer sold:type: "tollFree", or a toll-freephoneNumber, answersPHONE_TYPE_NOT_SOLD(422) and charges nothing. To use a toll-free number, import it from your own Twilio account (below).GETthe status URL untilstatusissucceeded(thenphoneIdis set) orfailed(errorholds a code that says why).errorcan also be set whilestatusispending, for examplein_progress, so branch onstatus, not onerror. A request can staypendingfor a day or more while the purchase is retried. After 5 failed purchase attempts it ends asfailed, with the last attempt's code inerror. Set a polling limit of your own as well.
Send a clientRequestId to make step 2 safe to retry. Generate a new UUID for each purchase. While that request is still pending, a retry of the same purchase returns it (202) instead of buying twice. Once the request has failed, the same id answers 409; send a new id to try again. A number that any workspace already holds, or that another workspace has pending, answers 409 (RESOURCE_CONFLICT) whatever id you send. ?dryRun=1 checks your role, the body and the owner's plan, then answers 202 with dryRun: true. It does not price, buy or bill. It skips the checks for a number that is already taken, and its statusUrl answers NOT_FOUND.
# A new id for each purchase. Reuse it only to retry this one.
REQUEST_ID=$(uuidgen)
curl -X POST "https://dbel.ai/api/phones/provision" \
-H "Authorization: Bearer $DBEL_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+14155550123",
"countryCode": "US",
"type": "local",
"clientRequestId": "'"$REQUEST_ID"'"
}'
# → 202 { "requestId": "<your REQUEST_ID>", "status": "pending", "statusUrl": "/api/phones/provision/<your REQUEST_ID>" }Importing from Twilio
With a Twilio account connected, GET /api/phones/import lists the US, Canadian and Australian numbers in that account that no dBel workspace has imported yet. To import one, POST /api/phones/import with { "sid": "<twilioSid from a list row>" }. A number from any other country answers PHONE_COUNTRY_NOT_ALLOWED (422), and nothing changes in your Twilio account. Without a connected account both answer TWILIO_NOT_CONFIGURED. The import returns no body; the number then appears in the phone list. Before the first import, a workspace owner or admin must confirm STOP handling in Settings, once. Until then the import answers STOP_HANDLING_NOT_CONFIRMED (403). The API can check this confirmation but cannot give it.
US texting registration
Each number carries smsRegistrationStatus and smsRegistrationReason. They say whether the number may text US mobiles. Your assistant texts a US mobile only from an imported number whose status is registered, and only after the caller says yes on the call. See the US texting guide.
registered— the number's US texting registration (A2P 10DLC campaign, or toll-free verification) is approved in its Twilio account. This is not a promise that every text delivers: a carrier can still refuse one, and then the status changes.pending— the registration is waiting for approval.unregistered— the number may not text US mobiles.smsRegistrationReasonsays why: for examplenot_in_campaign(not in an approved campaign),tollfree_unverified,not_us_sender(a number from outside the US and Canada),dbel_number(texts to US numbers are off for numbers bought through dBel for now) orcarrier_blocked(a carrier refused a text).unknown— not checked yet, or dBel could not read the Twilio account (no_twilio_access).
dBel checks each number when you import it, again from time to time after that, and when a carrier reports a problem with a text.
Deleting a number
DELETE /api/phones/{phoneId} first sets the number count on the workspace owner's subscription from a fresh count, then removes the number from the workspace, then releases or detaches it. If the billing update or the removal fails, the number is kept, nothing is released or detached yet, and the call answers PHONE_DELETE_FAILED (502). Retry it. A retry is safe: it counts again, so it never takes a second number off the bill. A 204 means the number is gone from the workspace and off the bill. Some steps are best-effort and do not change a 204: removing the number from our call routing, detaching an imported number from your Twilio trunk, and releasing a provisioned number at Twilio (we retry the release later). A released number can't be recovered: see When a number is released.
Endpoints
GET/api/phones
List the workspace's phone numbers.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| limit | integer 1–100 | Rows per page. Default 20. |
| cursor | string | The nextCursor from the previous page. |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| phones | object[] | capabilities uses lowercase keys (voice, sms, mms); older rows can carry SMS / MMS. Read both spellings. smsRegistrationStatus is registered when the number's US texting registration is approved in its Twilio account — not a promise that every text delivers; smsRegistrationReason says why a number is not registered. |
| phones[].id | string | |
| phones[].friendlyName | string | |
| phones[].phoneNumber | string | |
| phones[].countryCode | string | |
| phones[].assistantId | string | null | |
| phones[].provider | enum: dbel | twilio | ringcentral | telnyx | custom | |
| phones[].capabilities | json | |
| phones[].smsRegistrationStatus | enum: unknown | unregistered | pending | registered | |
| phones[].smsRegistrationReason | enum: not_in_campaign | campaign_pending | campaign_failed | sole_prop_shared | tollfree_pending | tollfree_unverified | not_us_sender | dbel_number | carrier_blocked | carrier_pending | no_twilio_access | null | |
| phones[].createdAt | datetime | |
| phones[].updatedAt | datetime | |
| hasMore | boolean | |
| nextCursor | string | null |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_QUERY — The request query is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/phones/{phoneId}
Fetch one phone number.
Auth: Bearer token · any workspace member
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| phone | object | capabilities uses lowercase keys (voice, sms, mms); older rows can carry SMS / MMS. Read both spellings. smsRegistrationStatus is registered when the number's US texting registration is approved in its Twilio account — not a promise that every text delivers; smsRegistrationReason says why a number is not registered. |
| phone.id | string | |
| phone.friendlyName | string | |
| phone.phoneNumber | string | |
| phone.countryCode | string | |
| phone.assistantId | string | null | |
| phone.provider | enum: dbel | twilio | ringcentral | telnyx | custom | |
| phone.capabilities | json | |
| phone.smsRegistrationStatus | enum: unknown | unregistered | pending | registered | |
| phone.smsRegistrationReason | enum: not_in_campaign | campaign_pending | campaign_failed | sole_prop_shared | tollfree_pending | tollfree_unverified | not_us_sender | dbel_number | carrier_blocked | carrier_pending | no_twilio_access | null | |
| phone.createdAt | datetime | |
| phone.updatedAt | datetime |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_PHONE_ID — The phoneId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 PHONE_NOT_FOUND_OR_UNAUTHORIZED — Phone not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
DELETE/api/phones/{phoneId}
Release (dBel-provisioned) or detach (imported) a phone number.
Auth: Bearer token · workspace ADMIN or OWNER
Responses
204 No body.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_PHONE_ID — The phoneId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 502 PHONE_DELETE_FAILED — The phone number was not removed, so its billing may not have changed yet. Please try again. A retry is safe.
- 404 PHONE_NOT_FOUND_OR_UNAUTHORIZED — Phone not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/phones/provision
Search numbers available to provision in a country.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| countryCode * | `US` | `CA` | Country to search. Any other code answers INVALID_REQUEST_QUERY. |
| requireSms | boolean | true limits results to SMS-capable numbers (the pool decides type). |
| areaCode | string — 3 digits, first digit 2–9 | A US or Canadian area code. |
| limit | integer 1–100 | Rows per page. Default 50. |
| cursor | string | The nextCursor from the previous page. |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| phones | object[] | |
| phones[].phoneNumber | string | |
| phones[].friendlyName | string | |
| phones[].capabilities | object | |
| phones[].capabilities.voice | boolean | |
| phones[].capabilities.SMS | boolean | |
| phones[].capabilities.MMS | boolean | |
| phones[].addressRequirements | enum: none | any | local | foreign | |
| phones[].locality | string | null | |
| phones[].region | string | null | |
| phones[].isoCountry | string | |
| phones[].postalCode | string | null | |
| phones[].monthlyPrice | number | |
| phones[].perMinPrice | number | |
| phones[].type | enum: local | |
| totalPhones | number | |
| hasMore | boolean | |
| nextCursor | string | null |
totalPhones counts the rows on this page only. The search returns local numbers today.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_QUERY — The request query is invalid.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
POST/api/phones/provision
Provision a number from the search results. Asynchronous — poll the status URL.
Auth: Bearer token · workspace ADMIN or OWNER · plan: a paid subscription
Query parameters
| Field | Type | Notes |
|---|---|---|
| dryRun | `1` | Check the role, body and plan without provisioning or billing. Returns no price and skips the already-taken checks; the statusUrl answers NOT_FOUND. Also accepted as an x-dry-run: 1 header. Not read from the body. |
Request body
application/json
type: send local. Toll-free numbers are no longer sold: tollFree, or a toll-free phoneNumber, answers PHONE_TYPE_NOT_SOLD (422), and you can import a toll-free number from your own Twilio account instead. clientRequestId (a UUID) becomes the requestId. A retry while that request is pending returns it; once it has succeeded or failed, the same id answers RESOURCE_CONFLICT.
| Field | Type | Notes |
|---|---|---|
| countryCode * | string | |
| type * | enum: local | tollFree | |
| phoneNumber * | string | |
| clientRequestId | string | UUID |
Responses
202 JSON body:
| Field | Type | Notes |
|---|---|---|
| requestId | string | |
| status | enum: pending | succeeded | error_pending | failed | |
| statusUrl | string | |
| dryRun | true — present only on a dry run |
A POST for a number this workspace already has pending returns that request's requestId and statusUrl, whatever clientRequestId you send. A Location header carries statusUrl.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 402 FREE_PLAN_RESTRICTED — This action is not available on the free plan.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 422 PHONE_TYPE_NOT_SOLD — This type of number is no longer sold. Toll-free numbers can be imported from your own Twilio account instead.
- 402 PURCHASE_PAYMENT_FAILED — The payment did not go through, so the number was not bought and nothing was charged. Check the card in Account → Manage Billing, then try again.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 402 SUBSCRIPTION_ISSUE — Your subscription is inactive or incomplete or has a payment issue.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/phones/provision/{requestId}
Poll a provisioning request.
An id from another workspace answers WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED, not NOT_FOUND.
Auth: Bearer token · any workspace member
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| requestId | string | |
| status | enum: pending | succeeded | error_pending | failed | |
| error | string | null | |
| stripeSubscriptionId | string | null | |
| phoneId | string | null | |
| createdAt | datetime | |
| updatedAt | datetime |
phoneId is set once the phone exists. error can be set on a pending or succeeded request too. No code sets status to error_pending today. After 5 failed purchase attempts a request ends failed. A request still waiting on entitlement after 24 hours, or holding its number after 7 days, ends failed with the error provisioning_expired. A purchase whose payment did not go through ends failed with the error stripe_payment_failed (the POST answered PURCHASE_PAYMENT_FAILED).
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 404 NOT_FOUND — The requested resource was not found.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/phones/import
List the US, Canadian and Australian numbers in the connected Twilio account that are not imported yet.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| limit | integer 1–100 | Rows per page. Default 50. |
| cursor | string | The nextCursor from the previous page. |
| friendlyName | string | Filter by Twilio friendly name. |
| phoneNumber | string | Filter by number (Twilio pattern match). |
| origin | enum: twilio | hosted | Filter by Twilio origin. |
| beta | boolean | Filter by Twilio beta flag. |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| phones | object[] | |
| phones[].twilioSid | string | |
| phones[].phoneNumber | string | |
| phones[].friendlyName | string | |
| phones[].capabilities | object | |
| phones[].capabilities.voice | boolean | |
| phones[].capabilities.SMS | boolean | |
| phones[].capabilities.MMS | boolean | |
| phones[].addressRequirements | enum: none | any | local | foreign | |
| totalPhones | number | |
| hasMore | boolean | |
| nextCursor | string | null |
totalPhones counts the rows on this page only. Numbers already imported, and numbers from other countries, are dropped after paging, so a page can be short or empty while hasMore is true — keep paging until it is false.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_QUERY — The request query is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 400 TWILIO_NOT_CONFIGURED — Twilio is not fully configured for this workspace. Add the Twilio integration first.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
POST/api/phones/import
Import a Twilio number by its SID.
Returns no body. Find the new number with GET /api/phones. Only a US, Canadian or Australian number imports; any other answers PHONE_COUNTRY_NOT_ALLOWED (422) and nothing changes in your Twilio account or the workspace.
Auth: Bearer token · workspace ADMIN or OWNER
Request body
application/json
| Field | Type | Notes |
|---|---|---|
| sid * | string | min 34, max 34 |
Responses
204 No body.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 422 PHONE_COUNTRY_NOT_ALLOWED — Only US, Canadian and Australian numbers can be imported.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 403 STOP_HANDLING_NOT_CONFIRMED — STOP handling isn't confirmed for this workspace. A workspace owner or admin must confirm it in settings.
- 400 TWILIO_NOT_CONFIGURED — Twilio is not fully configured for this workspace. Add the Twilio integration first.
- 404 TWILIO_SID_RESOURCE_NOT_FOUND — Twilio SID resource not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.