cURL
curl --request POST \
--url https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"campaignId": "campaign_speed_to_lead_456"
}'import requests
url = "https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign"
payload = { "campaignId": "campaign_speed_to_lead_456" }
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({campaignId: 'campaign_speed_to_lead_456'})
};
fetch('https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign', 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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign",
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([
'campaignId' => 'campaign_speed_to_lead_456'
]),
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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign"
payload := strings.NewReader("{\n \"campaignId\": \"campaign_speed_to_lead_456\"\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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"campaign_speed_to_lead_456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign")
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 \"campaignId\": \"campaign_speed_to_lead_456\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"phoneNumber": {
"phoneNumber": "+14155551234",
"pretty": "+1 (415) 555-1234",
"nickname": "Lead follow-up",
"boundToAgent": true
}
}{
"success": false,
"error": "VALIDATION",
"message": "A campaignId is required."
}{
"success": false,
"error": "Unauthorized",
"message": "Authentication required."
}{
"success": false,
"error": "Forbidden",
"message": "You do not have access to phone number endpoints."
}{
"success": false,
"error": "NotFound",
"message": "Campaign \"campaign_missing\" not found or not accessible."
}{
"success": false,
"error": "CONFLICT",
"message": "This is the only number on an active campaign. Pause the campaign or add another number before removing it."
}{
"success": false,
"error": "TooManyRequests",
"message": "Too many requests, please try again later."
}{
"success": false,
"error": "InternalError",
"message": "Unexpected server error."
}Assign phone number
Assign an existing agency-owned caller ID to another campaign without removing it from current campaigns. Allowed customer role: agency_admin.
Required API key scope: phone_numbers:write.
POST
/
api
/
agent-builder
/
phone-numbers
/
{number}
/
assign
cURL
curl --request POST \
--url https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"campaignId": "campaign_speed_to_lead_456"
}'import requests
url = "https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign"
payload = { "campaignId": "campaign_speed_to_lead_456" }
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({campaignId: 'campaign_speed_to_lead_456'})
};
fetch('https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign', 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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign",
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([
'campaignId' => 'campaign_speed_to_lead_456'
]),
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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign"
payload := strings.NewReader("{\n \"campaignId\": \"campaign_speed_to_lead_456\"\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.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"campaign_speed_to_lead_456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamfollowup.ai/api/agent-builder/phone-numbers/{number}/assign")
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 \"campaignId\": \"campaign_speed_to_lead_456\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"phoneNumber": {
"phoneNumber": "+14155551234",
"pretty": "+1 (415) 555-1234",
"nickname": "Lead follow-up",
"boundToAgent": true
}
}{
"success": false,
"error": "VALIDATION",
"message": "A campaignId is required."
}{
"success": false,
"error": "Unauthorized",
"message": "Authentication required."
}{
"success": false,
"error": "Forbidden",
"message": "You do not have access to phone number endpoints."
}{
"success": false,
"error": "NotFound",
"message": "Campaign \"campaign_missing\" not found or not accessible."
}{
"success": false,
"error": "CONFLICT",
"message": "This is the only number on an active campaign. Pause the campaign or add another number before removing it."
}{
"success": false,
"error": "TooManyRequests",
"message": "Too many requests, please try again later."
}{
"success": false,
"error": "InternalError",
"message": "Unexpected server error."
}Authorizations
Send your API key as Authorization: Bearer YOUR_API_KEY.
Path Parameters
E.164 phone number. URL-encode the leading + when placing it in the path.
Pattern:
^\+\d{10,15}$Body
application/json
Destination campaign.
Destination campaign id.
Example:
"campaign_speed_to_lead_456"
⌘I
