curl --request POST \
--url https://api.optimaldial.com/api/v1/spam/numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+15551234567",
"verification_method": "call"
}
'import requests
url = "https://api.optimaldial.com/api/v1/spam/numbers"
payload = {
"phone_number": "+15551234567",
"verification_method": "call"
}
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({phone_number: '+15551234567', verification_method: 'call'})
};
fetch('https://api.optimaldial.com/api/v1/spam/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.optimaldial.com/api/v1/spam/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([
'phone_number' => '+15551234567',
'verification_method' => 'call'
]),
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.optimaldial.com/api/v1/spam/numbers"
payload := strings.NewReader("{\n \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\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.optimaldial.com/api/v1/spam/numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.optimaldial.com/api/v1/spam/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 \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\n}"
response = http.request(request)
puts response.read_body{
"number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+15551234567",
"verified": true,
"same_carrier_warning": true,
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"carrier_statuses": [
{
"carrier": "<string>",
"status": "pending",
"screenshot_available": true,
"spam_detected": true,
"spam_label": "<string>",
"test_run_id": "<string>",
"captured_at": "2023-11-07T05:31:56Z"
}
],
"carrier": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"verification": {
"required": true,
"sent": true,
"method": "call",
"instructions": "<string>",
"error": "<string>"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "rate_limit_exceeded",
"scope": "per_key",
"limit": 123,
"retry_after_seconds": 123
}
}Add a monitored number
Registers a phone number for carrier spam monitoring and
automatically initiates verification. OptimalDial places a
verification call (or SMS) to the number; the recipient reads back the
code, which you then submit to the /verify endpoint. Verification is
required for the monitoring service to function — it lets OptimalDial
place test calls from the number — it is not an ownership or
security gate.
verification_method defaults to call. Choose sms only for
SMS-capable numbers; landlines reject SMS and return 400.
curl --request POST \
--url https://api.optimaldial.com/api/v1/spam/numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+15551234567",
"verification_method": "call"
}
'import requests
url = "https://api.optimaldial.com/api/v1/spam/numbers"
payload = {
"phone_number": "+15551234567",
"verification_method": "call"
}
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({phone_number: '+15551234567', verification_method: 'call'})
};
fetch('https://api.optimaldial.com/api/v1/spam/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.optimaldial.com/api/v1/spam/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([
'phone_number' => '+15551234567',
'verification_method' => 'call'
]),
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.optimaldial.com/api/v1/spam/numbers"
payload := strings.NewReader("{\n \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\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.optimaldial.com/api/v1/spam/numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.optimaldial.com/api/v1/spam/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 \"phone_number\": \"+15551234567\",\n \"verification_method\": \"call\"\n}"
response = http.request(request)
puts response.read_body{
"number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+15551234567",
"verified": true,
"same_carrier_warning": true,
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"carrier_statuses": [
{
"carrier": "<string>",
"status": "pending",
"screenshot_available": true,
"spam_detected": true,
"spam_label": "<string>",
"test_run_id": "<string>",
"captured_at": "2023-11-07T05:31:56Z"
}
],
"carrier": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"verification": {
"required": true,
"sent": true,
"method": "call",
"instructions": "<string>",
"error": "<string>"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "rate_limit_exceeded",
"scope": "per_key",
"limit": 123,
"retry_after_seconds": 123
}
}Authorizations
OptimalDial API key, prefixed od_live_, sent as Authorization: Bearer ....
Mint keys in the in-app developer panel; they are scoped to a single organization.
Body
Any common format. Normalized to E.164. Must be US or Canadian.
"+15551234567"
How to deliver the verification code. call (default) works for any
number; sms is only valid for SMS-capable numbers and returns 400
on a landline.
call, sms