Buy a number
Buy a number and make it an SMS channel in the same call. The purchase follows the same rules as POST /v1/phone-numbers, including regulatory requirements, and the number comes back with SMS on. There is no separate assign step. Where it lands: when the project's default channel group has no number yet, the number joins that group (and becomes the project's first channel and default when there is none); otherwise it gets a channel group of its own.
While the number is in regulatory review (number.regulatoryStatus: pending_review) it is attached but cannot send, and channels can be empty until it is approved. If the purchase succeeded but turning SMS on failed, the number is still bought and billed; the response says so in setupError rather than failing the call.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Body
application/json
phoneNumberstringrequiredPhone number in E.164 format.
namestringOptional custom name for the phone number.
Limitsmax length 100typestringType the number was found under in
GET /v2/numbers/available. Used to look the number up and to keep regulatory information for reuse. Required whenregulatoryRequirementsis sent.toll_freeis accepted as an alias oftollFree. A number not listed under this type is refused with400 number_unavailablesaying so.One oflocalnationaltollFreemobileregulatoryRequirementsobject[]Regulatory information, for numbers whose requirements list is not empty. Get the list with
GET /v1/phone-numbers/requirements?phoneNumber=...and send one entry per requirement id, exceptactionrequirements, which take no value. Every required id must be present, once, and no unknown id may be sent; otherwise the purchase is refused with400 invalid_requestbefore anything is charged.The information is kept for your project under the number's country and
type. A later purchase there may omit this field if what is kept still covers that number's requirements. Omit it for numbers without requirements.Limitsmax items 502 properties
requirementTypestringrequiredA
requirementTypes[].idfromGET /v1/phone-numbers/requirements. Each id may appear only once.Limitsmin length 1 · max length 200fieldValuestringrequiredDepends on the requirement's
type: the text itself fortextual; foraddress, theidof an address created in this project withPOST /v1/addresses; fordocument, theidof a document created withPOST /v1/documents. An address or document from another project, or one rejected in review, is refused.Limitsmin length 1 · max length 1000
Responses
201Bought.
numberobjectrequired10 properties
idstringrequiredphoneNumberstringrequirednamestringOptional custom name for the phone number.
capabilitiesstring[]requiredstatusstringrequiredBilling state of an owned number, separate from
regulatoryStatus.pendingis legacy and is not written to numbers today.One ofactivesuspendedpendingreleasingreleasedpricingobjectrequired4 properties
monthlyPricenumberMonthly price in USD.
upfrontCostnumberOne-time purchase cost in cents.
monthlyCostnumberMonthly cost in cents.
isFreeNumberbooleanWhether this is a free number.
regulatoryStatusstringrequiredRegulatory review state. Numbers that need no review are
approvedimmediately. A number bought with regulatory information is owned and billed from purchase and startspending_review; it cannot send messages or place calls until this isapproved, and itschannelsentry can be absent until then. The state is re-checked every 6 hours.One ofapprovedpending_reviewrejectednextRenewalDatestring<date-time>createdAtstring<date-time>requiredupdatedAtstring<date-time>
channelsobject[]requiredThe entries of the new number (
sms, once routed).4 properties
addressstringrequiredThe address the recipient sees: an E.164 number (
sms,voice,whatsapp), an email address (lowercase),@botname(telegram),@username(instagram), the Facebook Page id (messenger), or the literalsms_oneway(one-way SMS goes out from shared system numbers, and messages on it store this same literal asfrom).typestringrequiredA transport a message travels on.
One ofsmssms_onewaywhatsapptelegramemailinstagrammessengervoiceactivebooleanrequiredIt can send right now. A connected transport that is switched off is listed with
active: false; turn it on withPOST /v2/channels/{address}/{type}/activate.sms,sms_onewayandvoicehave no switch and are always active.v1SenderIdstringrequiredRead-only. The /v1 sender behind this entry, usable as the
Zavu-Senderheader on /v1. Entries with the samev1SenderIdare one channel group. On /v2 it is accepted asfromonly when two entries of different groups share an address (see409 ambiguous_from).
setupErrorobjectPresent only when the purchase succeeded and turning SMS on did not.
details.recommendationsays how to retry.3 properties
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
400`number_unavailable`, `regulatory_compliance_required`, `invalid_request`.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
402`insufficient_balance` or `paid_plan_required`.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
502`requirements_unavailable`; nothing charged.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring