Buy an Upload-Post phone number
purchase_phone_numberBuy a phone number for an Upload-Post profile by checking availability and price, accepting terms, and confirming the purchase; the number is billed monthly until released.
Instructions
Buy a phone number for a profile. It costs money: the monthly price, which varies by country and number type (1.5 times our carrier's monthly cost for that number, rounded up to the next whole unit, at least 3 and at most 30 (numbers that would cost more are not offered): e.g. a carrier cost of 2.40 gives 3.60, so 4 per month; 7.30 gives 10.95, so 11; in the account's billing currency, USD, EUR or GBP, the same amount in each; read the real price in phone_numbers_read search_available / countries, never assume one; no setup fee) is charged on the account's subscription at once, prorated, and then on every renewal until the number is released (annual plans pay 12 months). Usage (outbound SMS, forwarding, recording, transcription) is billed on the next invoice. Buying and the identity step take the account's API key or the owner's own session, never a profile JWT. Before calling: read phone_numbers_read config (can_purchase, terms_version, terms_url), pick the number with search_available, tell the user the price, and have them read and accept the terms at terms_url (no emergency calls, acceptable use, porting authorization, carrier data processing in the US). end_user is the person or business that will use the number, as our carrier needs it: type individual | business, first_name, last_name, business_name (business), phone (E.164), email, address { street_address, extended_address, locality, administrative_area, postal_code, country_code }. Spanish, German, French and Italian numbers need an address in that country (local numbers: in the area code's region). purchase_intent_id is your idempotency key (8-100 characters: letters, digits, _ - . :): make one up once per number you mean to buy and reuse it on every retry of that purchase; the same id never charges twice and returns the same number. Use a new id only to retry a purchase that failed. Answers: 200 status active (bought). 202 status kyc_required: nothing charged yet; the country needs identity documents: read phone_numbers_read kyc_fields, collect them from the user and call this tool again with the same arguments plus values and documents (then it is sent to POST /kyc). 202 pending_payment: paid, the order with our carrier is still being confirmed; it ends active (phone_number_activated webhook) or failed with the charge refunded, usually within about 15 minutes: check phone_numbers_read get and do not buy again (repeating the same purchase_intent_id returns the same number). 202 pending_regulatory: paid, our carrier is reviewing the identity; it turns active when approved, and a declined review is refunded (phone_number_declined webhook). Errors: 400 terms_not_accepted (send accept_terms: true and the current terms_version), phone_numbers_kyc_invalid, phone_numbers_country_not_available, phone_numbers_type_not_offered; 402 phone_numbers_paid_plan_required (relay upgrade_url) or phone_numbers_payment_failed; 403 phone_numbers_account_suspended; 404 profile_not_found; 409 purchase_velocity (one purchase every 10 minutes), phone_numbers_limit_reached (5 numbers per account by default), phone_number_unavailable (taken: search again), phone_numbers_currency_unsupported; 429 phone_numbers_rate_limited (honour Retry-After); 502 phone_numbers_carrier_error (the carrier refused the order, the charge was refunded); 503 phone_numbers_capacity. Countries in this first version: US, GB, ES, FR, DE, IT, MX, BR; types local, mobile, national (no toll-free). Team members acting on the owner's account cannot buy, send identity documents, release or read port-out details (403 phone_numbers_owner_only): only the owner or an Admin can. Paid plans only (an active subscription with at least one paid invoice; trials and the Free plan get 402 phone_numbers_paid_plan_required with an upgrade_url to relay). These numbers cannot make outbound calls and can NEVER call emergency services (112 / 911). US and Canadian numbers receive SMS but cannot send SMS yet (403 sms_registration_required); some Spanish, German and Italian numbers have no SMS at all. Not generally available yet: the API answers 403 phone_numbers_not_available until phone numbers are available for the account (phone_numbers_read config answers enabled: false). Needs the user's approval: call it first without confirmed to get a preview (nothing is sent), show the user exactly what will go out, and repeat the call with confirmed: true only after they approve.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"profile_username": "<profile_username>",
"country": "<country>",
"number_type": "<number_type>",
"purchase_intent_id": "<purchase_intent_id>",
"end_user": "<end_user>",
"accept_terms": "<accept_terms>",
"terms_version": "<terms_version>"
},
"name": "purchase_phone_number"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | No | Identity step only (after 202 kyc_required): { requirement_id: value } for the text and date requirements of kyc_fields. | |
| country | Yes | ISO country code, e.g. 'ES', 'GB', 'US'. | |
| end_user | Yes | Who will use the number, as the carrier requires it. | |
| area_code | No | Without phone_number: take the first available number in this area code. | |
| confirmed | No | Set to true only after the user has seen the preview this tool returns without it and approved it. Without it nothing is sent. | |
| documents | No | Identity step only (after 202 kyc_required): { requirement_id: { filename, content_base64 | path } } for the file requirements of kyc_fields (ID or passport, company certificate, proof of address under 3 months…). | |
| number_type | Yes | local (default), mobile or national. No toll-free numbers. | |
| accept_terms | Yes | true, only after the user has read and accepted the terms at `terms_url` (phone_numbers_read config). | |
| phone_number | No | A number from phone_numbers_read search_available, in E.164. Omit to take the first available one. | |
| terms_version | Yes | The `terms_version` from phone_numbers_read config. | |
| profile_username | Yes | Upload-Post profile the number belongs to (from list_users). | |
| purchase_intent_id | Yes | Idempotency key for this purchase (8-100 characters: letters, digits, _ - . :). Reuse it on retries; a new one buys another number. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No |