DELETE
/
phone-number
/
{id}
curl --request DELETE \
  --url https://api.vapi.ai/phone-number/{id} \
  --header 'Authorization: Bearer <token>'
{
  "fallbackDestination": {
    "type": "number",
    "number": "<string>",
    "message": "<string>",
    "description": "<string>"
  },
  "provider": "twilio",
  "id": "<string>",
  "orgId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "assistantId": "<string>",
  "squadId": "<string>",
  "serverUrl": "<string>",
  "serverUrlSecret": "<string>",
  "number": "<string>",
  "twilioAccountSid": "<string>",
  "twilioAuthToken": "<string>"
}

Authorizations

Authorization
string
headerrequired

Retrieve your API Key from Dashboard.

Path Parameters

id
string
required

Response

200 - application/json
fallbackDestination
object

This is the fallback destination an inbound call will be transferred to if:

  1. assistantId is not set
  2. squadId is not set
  3. and, assistant-request message to the serverUrl fails

If this is not set and above conditions are met, the inbound call is hung up with an error message.

provider
enum<string>
required

This is the provider of the phone number. twilio here.

Available options:
twilio
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
required

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

updatedAt
string
required

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

name
string

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

assistantId
string

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

If neither assistantId nor squadId is set, assistant-request will be sent to your Server URL. Check ServerMessage and ServerMessageResponse for the shape of the message and response that is expected.

squadId
string

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

If neither assistantId nor squadId is set, assistant-request will be sent to your Server URL. Check ServerMessage and ServerMessageResponse for the shape of the message and response that is expected.

serverUrl
string

This is the server URL where messages will be sent for calls on this number. This includes the assistant-request message.

You can see the shape of the messages sent in ServerMessage.

This overrides the org.serverUrl. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl.

serverUrlSecret
string

This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret.

Same precedence logic as serverUrl.

number
string
required

These are the digits of the phone number for PSTN calls.

This is not set for SIP numbers. sipUri is used instead.

twilioAccountSid
string
required

This is the Twilio Account SID for the phone number.

This is for numbers not bought on Vapi.

twilioAuthToken
string
required

This is the Twilio Auth Token for the phone number.

This is for numbers not bought on Vapi.