Buy phone number through the API
# support
k
Hello everyone, I want to buy a phone number in Vapi using the API, is this possible ? Thank you
v
message has been deleted
@Karim Hello! Yes, it is absolutely possible to buy a phone number using the VAPI. To assist you with that, I'll need a few details such as the area code you're interested in, the name you'd like to associate with the number, the assistant ID, and your server URL. Once you provide these details, I can help you make the API call to purchase a phone number.
You can continue this conversation by mentioning me in the message.
k
I want a 416 for example
the name can be just test
@User
@Vapi Could you please provide me with an example that will have the number 451 and label test, the assistantId and Server URL can be blank, Thank you
v
@Karim Certainly! Below is an example of how you might structure your API call to purchase a phone number with the area code 451 and label it "test". Please note that you will need to fill in the
assistantId
and
serverUrl
with your actual values when you make the request.
Copy code
json
POST /phone_numbers/purchase
Host: api.vapi.com
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "areaCode": "451",
  "label": "test",
  "assistantId": "YOUR_ASSISTANT_ID",
  "serverUrl": "YOUR_SERVER_URL"
}
Make sure to replace
YOUR_API_TOKEN
,
YOUR_ASSISTANT_ID
, and
YOUR_SERVER_URL
with your actual API token, assistant ID, and server URL respectively. If you need further assistance or have any other questions, feel free to ask!
s
Hey @Karim it's not possible to purchase nunbers using API.
8 Views