Add Blacklist Phone Number
curl --request POST \
--url https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"comment": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}"
payload = {
"name": "<string>",
"comment": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', comment: '<string>'})
};
fetch('https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}', 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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}",
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([
'name' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"phone_number": "<string>",
"reason": "<string>",
"level": "<string>",
"name": "<string>",
"comment": "<string>"
}{
"phone_number": "<string>",
"reason": "<string>",
"level": "<string>",
"name": "<string>",
"comment": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Blacklists
Add Blacklist Phone Number
201 when the number is added, 200 when it was already there.
POST
/
api
/
v1
/
blacklists
/
{blacklist_id}
/
phone-numbers
/
{phone_number}
Add Blacklist Phone Number
curl --request POST \
--url https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"comment": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}"
payload = {
"name": "<string>",
"comment": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', comment: '<string>'})
};
fetch('https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}', 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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}",
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([
'name' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/blacklists/{blacklist_id}/phone-numbers/{phone_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"phone_number": "<string>",
"reason": "<string>",
"level": "<string>",
"name": "<string>",
"comment": "<string>"
}{
"phone_number": "<string>",
"reason": "<string>",
"level": "<string>",
"name": "<string>",
"comment": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
The blacklist to add to.
The number to add, E.164. Compared to the list exactly as written, so send it in the same form you read back from GET.
Body
application/json
Why the number is on the list. This is what the platform acts on: inbound-fallback reasons route the caller to a person, the rest stop us contacting them.
Available options:
HUMAN_ONLY, UNPROCESSABLE_BY_PHONE, WRONG_PHONE_NUMBER, IVR_LOOP, SERVICE_NOT_AVAILABLE, DISCONNECTED, INPUT_DATA_ISSUE, NOT_FOUND, MEMBER_CONSENT_REQUIRED, NOT_ALL_DATA_POINTS_RETRIEVED, DNC_REQUESTED, NOT_INTERESTED_RIGHT_NOW, WRONG_USER, MANAGER_REQUESTED, PROVIDER_NO_LONGER_AT_LOCATION, DATA_ISSUE, TRANSFER_HANG_UP, SMS_OPT_OUT, TWILIO_OPT_OUT, INBOUND_HUMAN_REQUESTED, INBOUND_PRIORITY_CALLER Optional label shown beside the number.
Optional free text. Worth saying where the number came from, since whoever reads the list next will not know.
Severity. Ignored for inbound-fallback reasons, which are always stored critical_risk so the nightly cleanup cannot expire them. Omit it to keep what the number already has, or high_risk if it is new.
Available options:
low_risk, high_risk, critical_risk