Skip to main content
POST
/
utils
/
buy-twilio-number
Buy a Twilio number
curl --request POST \
  --url https://eu-cloudflare.vg-stuff.com/utils/buy-twilio-number \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "number": "<string>",
  "agentId": "<string>",
  "capabilities": [
    "voice",
    "sms"
  ]
}
'
{
  "phoneNumber": "<string>",
  "phoneNumberSid": "<string>",
  "message": "<string>"
}

Example Request

{
  "number": "+14155551234",
  "agentId": "your-agent-id"
}
The phone number must include the + prefix and country code, with no spaces or special characters.
Leave agentId empty to purchase the number without assigning it to an agent immediately.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
number
string
required

The phone number to buy with the plus & without spaces, example: +1234567890

agentId
string

The agent id to assign the number to, could be empty if you want to assign an agent later.

capabilities
enum<string>[]
Available options:
sms,
voice

Response

Successful response

phoneNumber
string
required
phoneNumberSid
string
required
message
string
required