Skip to main content
POST
/
utils
/
buy-twilio-number
Buy a Twilio number
curl --request POST \
  --url https://eu-gcp-api.vg-stuff.com/v3/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",
  "capabilities": ["voice", "sms"]
}
Use /utils/twilio/available-numbers first to discover purchasable numbers.
Requires an available phone-number slot on your plan. The endpoint will return a INTERNAL_SERVER_ERROR with a friendly upgrade message if you’ve exceeded your slot quota.

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