Buy / Add Phone Number
curl --request POST \
--url https://api.rapidcall.ai/api/phone-numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"e164": "<string>",
"label": "<string>",
"provider": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>"
}
'import requests
url = "https://api.rapidcall.ai/api/phone-numbers"
payload = {
"e164": "<string>",
"label": "<string>",
"provider": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
e164: '<string>',
label: '<string>',
provider: '<string>',
sipTerminationUri: '<string>',
sipUsername: '<string>',
sipPassword: '<string>',
sipOutboundTransport: '<string>'
})
};
fetch('https://api.rapidcall.ai/api/phone-numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rapidcall.ai/api/phone-numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'e164' => '<string>',
'label' => '<string>',
'provider' => '<string>',
'sipTerminationUri' => '<string>',
'sipUsername' => '<string>',
'sipPassword' => '<string>',
'sipOutboundTransport' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rapidcall.ai/api/phone-numbers"
payload := strings.NewReader("{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rapidcall.ai/api/phone-numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidcall.ai/api/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPhone Numbers
Buy / Add Phone Number
Purchase a new phone number or connect an existing SIP number
POST
/
api
/
phone-numbers
Buy / Add Phone Number
curl --request POST \
--url https://api.rapidcall.ai/api/phone-numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"e164": "<string>",
"label": "<string>",
"provider": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>"
}
'import requests
url = "https://api.rapidcall.ai/api/phone-numbers"
payload = {
"e164": "<string>",
"label": "<string>",
"provider": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
e164: '<string>',
label: '<string>',
provider: '<string>',
sipTerminationUri: '<string>',
sipUsername: '<string>',
sipPassword: '<string>',
sipOutboundTransport: '<string>'
})
};
fetch('https://api.rapidcall.ai/api/phone-numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rapidcall.ai/api/phone-numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'e164' => '<string>',
'label' => '<string>',
'provider' => '<string>',
'sipTerminationUri' => '<string>',
'sipUsername' => '<string>',
'sipPassword' => '<string>',
'sipOutboundTransport' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rapidcall.ai/api/phone-numbers"
payload := strings.NewReader("{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rapidcall.ai/api/phone-numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidcall.ai/api/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"e164\": \"<string>\",\n \"label\": \"<string>\",\n \"provider\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodystring
required
Phone number in E.164 format (e.g.,
"+14151234567").string
Display name for the phone number.
string
"twilio" or "sip" (auto-detected from fields if not specified).string
SIP trunk termination URI. Required for SIP provider numbers.
string
SIP authentication username.
string
SIP authentication password.
string
SIP transport protocol:
"tcp", "udp", or "tls" (default: "tls").Search Available Numbers
First, search for available Twilio numbers:curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.rapidcall.ai/api/workspaces/ws_123/twilio/available-numbers?country=US&area_code=415"
Response
{
"numbers": [
{
"phoneNumber": "+14151234567",
"friendlyName": "(415) 123-4567",
"locality": "San Francisco",
"region": "CA",
"isoCountry": "US",
"capabilities": { "voice": true, "SMS": true, "MMS": true }
}
]
}
Buy a Number (Twilio)
Numbers are purchased through the workspace Twilio endpoint:curl -X POST https://api.rapidcall.ai/api/workspaces/ws_123/twilio/buy-number \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+14151234567"
}'
Connect Existing SIP Number
Add a number you already own via SIP:curl -X POST https://api.rapidcall.ai/api/phone-numbers \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"e164": "+14151234567",
"label": "Office Line",
"provider": "sip",
"sipTerminationUri": "sip:trunk.your-provider.com",
"sipUsername": "user123",
"sipPassword": "pass456",
"sipOutboundTransport": "tls"
}'
Response
{
"phoneNumber": {
"id": "pn_new123",
"workspaceId": "ws_xyz",
"e164": "+14151234567",
"label": "Office Line",
"provider": "sip",
"status": "unconfigured",
"inboundAgentId": null,
"outboundAgentId": null,
"source": "connected",
"createdAt": "2025-01-15T14:00:00Z",
"updatedAt": "2025-01-15T14:00:00Z"
}
}
A payment method is required before purchasing or connecting phone numbers.
