Skip to main content
POST
https://api.trillet.ai
/
v1
/
api
/
twilio
/
purchase-number
Purchase Phone Number
curl --request POST \
  --url https://api.trillet.ai/v1/api/twilio/purchase-number \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '
{
  "country": "<string>",
  "type": "<string>",
  "phoneNumber": "<string>",
  "addressSid": "<string>",
  "coupon": "<string>"
}
'
{
  "success": true,
  "phoneNumber": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "phoneNumber": "+14155551234",
    "country": "US",
    "type": "local",
    "status": "active",
    "workspaceId": "664a1b2c3d4e5f6a7b8c9d0e"
  }
}

Headers

x-api-key
string
required
API key used for authenticating requests to the API.
x-workspace-id
string
required
Workspace identifier for the API.

Request Body

country
string
required
Country code for the phone number (e.g., “US”, “CA”).
type
string
required
Type of phone number. Options: “local”, “tollFree”, “mobile”.
phoneNumber
string
required
The specific phone number to purchase in E.164 format.
addressSid
string
Address SID for regulatory compliance (required for some countries).
coupon
string
Coupon code for a discount.

Response Fields

success
boolean
Whether the purchase was successful.
phoneNumber
object
The purchased phone number details.
_id
string
Unique identifier for the phone number record.
phoneNumber
string
The purchased phone number in E.164 format.
country
string
Country code.
type
string
Phone number type.
{
  "success": true,
  "phoneNumber": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "phoneNumber": "+14155551234",
    "country": "US",
    "type": "local",
    "status": "active",
    "workspaceId": "664a1b2c3d4e5f6a7b8c9d0e"
  }
}