curl -X POST https://api.magpipe.ai/functions/v1/search-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"area_code": "604",
"country": "CA",
"limit": 5
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
area_code: '604',
country: 'CA',
limit: 5
}),
}
);
const { numbers } = await response.json();
console.log('Available numbers:', numbers);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'area_code': '604',
'country': 'CA',
'limit': 5
}
)
data = response.json()
for num in data['numbers']:
print(f"{num['phone_number']} - {num['locality']}")
{
"numbers": [
{
"phone_number": "+16045551234",
"friendly_name": "(604) 555-1234",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
},
{
"phone_number": "+16045555678",
"friendly_name": "(604) 555-5678",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
}
]
}
Phone Numbers
Search Available Numbers
Search for available phone numbers to provision
POST
/
search-phone-numbers
curl -X POST https://api.magpipe.ai/functions/v1/search-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"area_code": "604",
"country": "CA",
"limit": 5
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
area_code: '604',
country: 'CA',
limit: 5
}),
}
);
const { numbers } = await response.json();
console.log('Available numbers:', numbers);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'area_code': '604',
'country': 'CA',
'limit': 5
}
)
data = response.json()
for num in data['numbers']:
print(f"{num['phone_number']} - {num['locality']}")
{
"numbers": [
{
"phone_number": "+16045551234",
"friendly_name": "(604) 555-1234",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
},
{
"phone_number": "+16045555678",
"friendly_name": "(604) 555-5678",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
}
]
}
Search for available phone numbers to add to your account. Filter by area code, country, number type, and pattern matching.
Returns up to 75 numbers per search (3 pages of 25 in the UI).
Request Body
Send one ofareaCode, state, city, or query. If none provided with just numberType, returns default US numbers.
2-letter US state or Canadian province code. Auto-detects Canadian provinces.Example:
CA, NY, BC, ONCity name. Supports 40+ major US and Canadian cities.Example:
vancouver, san francisco, new yorkResponse
Number Object
curl -X POST https://api.magpipe.ai/functions/v1/search-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"area_code": "604",
"country": "CA",
"limit": 5
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
area_code: '604',
country: 'CA',
limit: 5
}),
}
);
const { numbers } = await response.json();
console.log('Available numbers:', numbers);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/search-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'area_code': '604',
'country': 'CA',
'limit': 5
}
)
data = response.json()
for num in data['numbers']:
print(f"{num['phone_number']} - {num['locality']}")
{
"numbers": [
{
"phone_number": "+16045551234",
"friendly_name": "(604) 555-1234",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
},
{
"phone_number": "+16045555678",
"friendly_name": "(604) 555-5678",
"locality": "Vancouver",
"region": "BC",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"monthly_cost": 2.00
}
]
}