Actions31
Phone Number → Buy
AI-generatedSummary
Buy phone numbers by sending provisioning or import options in JSON format to the Vapi API, supporting various providers including Twilio, Telnyx, Vonage, and BYO.
Inputs
- Buy Fields (JSON) (required) — Phone number provisioning/import options as a JSON object. This supports provider-specific fields for Vapi-native, Twilio, Telnyx, Vonage, and BYO phone number providers.
Output shape
a list of phone number objects or a single phone number object, depending on the API response
The node sends a POST request to the /phone-number endpoint with the JSON body from the Buy Fields input. The response is returned as JSON and pushed to the output. Errors or invalid JSON in the input will cause the node to fail unless 'Continue On Fail' is enabled.
Examples
Example 1: Buying a phone number using Twilio with a specific area code
Set the 'Buy Fields (JSON)' parameter to include provider as 'twilio' and areaCode as desired, e.g., {"provider":"twilio","areaCode":"415"}