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>"
}
'
{
  "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 (must include + prefix, no spaces, e.g., +1234567890)

agentId
string

Optional agent ID to assign the number to immediately

Response

Successful response

phoneNumber
string
required

The purchased phone number

phoneNumberSid
string
required

The Twilio SID for the phone number

message
string
required

Response message