Skip to main content
POST
/
phone-number
/
buy
Buy Phone Number
curl --request POST \
  --url https://api.vapi.ai/phone-number/buy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "areaCode": "<string>",
  "name": "<string>",
  "assistantId": "<string>"
}
'
{
  "id": "<string>",
  "orgId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "stripeSubscriptionId": "<string>",
  "stripeSubscriptionStatus": "<string>",
  "stripeSubscriptionCurrentPeriodStart": "2023-11-07T05:31:56Z",
  "number": "<string>",
  "twilioAccountSid": "<string>",
  "twilioAuthToken": "<string>",
  "name": "<string>",
  "assistantId": "<string>"
}

Authorizations

Authorization
string
header
required

Retrieve your key from Dashboard.

Body

application/json
areaCode
string
required

This is the area code of the phone number to purchase.

Required string length: 3
name
string

This is the name of the phone number. This is just for your own reference.

Maximum length: 40
assistantId
string

This is the assistant that will be used for incoming calls to this phone number.

If this is not set, then the phone number will not handle incoming calls.

Response

201 - application/json
id
string
required

This is the unique identifier for the phone number.

orgId
string
required

This is the unique identifier for the org that this phone number belongs to.

createdAt
string<date-time>
required

This is the ISO 8601 date-time string of when the phone number was created.

updatedAt
string<date-time>
required

This is the ISO 8601 date-time string of when the phone number was last updated.

number
string
required

These are the digits of the phone number.

stripeSubscriptionId
string

This is the subscription for the phone number.

stripeSubscriptionStatus
string

This is the subscription's status.

stripeSubscriptionCurrentPeriodStart
string<date-time>

This is the subscription's current period start.

twilioAccountSid
string

This is the Twilio Account SID for the phone number.

This is for numbers not bought on Vapi.

twilioAuthToken
string

This is the Twilio Auth Token for the phone number.

This is for numbers not bought on Vapi.

name
string

This is the name of the phone number. This is just for your own reference.

Maximum length: 40
assistantId
string

This is the assistant that will be used for incoming calls to this phone number.

If this is not set, then the phone number will not handle incoming calls.