Phone numbers
Purchase a phone number
Changed onPurchase a new phone number for the account. You can specify an exact phone number, search criteria, or let the system select a random number.
When phone_number is provided, all other search parameters are ignored.
post/accounts/{account_id}/phone_numbers
Request
- Base URLhttps://api.surge.app
- URLhttps://api.surge.app/accounts/{account_id}/phone_numbers
- AuthHTTP bearer
Path parameters
account_idstring required
The account for which the phone number should be created.
Example:acct_01j9a43avnfqzbjfch6pygv1td
Request body
Example request
{
"description": "Purchase any available local number",
"summary": "Random local number",
"value": {
"type": "local"
}
}Response
Purchased phone number
Example response
{
"campaign": {
"attachment_status": "attached",
"id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2"
},
"campaign_id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2",
"id": "pn_01jsjwe4d9fx3tpymgtg958d9w",
"metadata": {
"location": "Downtown store"
},
"name": "(801) 555-1234",
"number": "+18015551234",
"type": "local"
}Changes
- info
added the new optional request property
- info
added the required property
to the response with the status
- info
- info
added the new optional request property
- info