Messaging
List SMS Numbers
Retrieve all phone numbers configured for SMS, along with their configuration and conversation counts. Pass ?channel=whatsapp or ?channel=imessage to return WhatsApp or iMessage configurations instead of SMS.
GET
/
v1
/
sms
/
numbers
List SMS Numbers
curl --request GET \
--url https://api.bland.ai/v1/sms/numbers \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v1/sms/numbers"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v1/sms/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.bland.ai/v1/sms/numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/sms/numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bland.ai/v1/sms/numbers")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sms/numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"phone_number": "+14155552671",
"sms_config": {
"webhook": "https://example.com/sms-webhook",
"request_data": { "ref": "campaign_123" },
"time_out": 15,
"timeout_message": "This conversation has ended due to inactivity.",
"warning_time": 10,
"warning_message": "Are you still there?",
"messaging_service_sid": "MG1234567890abcdef",
"objective": "Provide quick support to customers.",
"tools": ["lookup", "escalate"],
"temperature": 0.7,
"pathway_id": "abc123",
"pathway_version": "latest",
"start_node_id": "entry-node",
"restart_after_end_call": true,
"timezone": "America/New_York",
"citation_schema_ids": ["b0477cba-1c97-4105-8ac9-46cb8eae5cf1"],
"disposition_ids": ["d1234567-abcd-1234-efgh-123456789012"],
"summary_prompt": "Summarize the key points and outcome of this conversation."
},
"conversation_count": 34
}
],
"errors": null
}
Enterprise Feature - SMS is only available on Enterprise plans. Contact your Bland representative for access.
Headers
Response
When the agent sends a response, we’ll send the message details in a POST request to the URL you specify here, along with chat history.
Request data fields are available to the AI agent during the call when referenced in the associated pathway or task.
The ID of the linked conversational pathway (if any). On a number attached to a V2 agent, replies run the agent whatever this field holds. It’s usually an ID that Bland manages for the agent, but a pathway you set before the attach stays here. This response doesn’t name the agent. Use Get Agent Number Binding to see an agent’s numbers.
When
true, a new conversation is automatically started if the user texts after the current conversation has ended. When false, subsequent messages are stored in the ended conversation without triggering a new reply.IDs of citation schemas configured for this number. Citations are extracted when conversations end. See Citations.
IDs of outcomes configured for this number. Outcomes are evaluated when conversations end. See Outcomes.
{
"data": [
{
"phone_number": "+14155552671",
"sms_config": {
"webhook": "https://example.com/sms-webhook",
"request_data": { "ref": "campaign_123" },
"time_out": 15,
"timeout_message": "This conversation has ended due to inactivity.",
"warning_time": 10,
"warning_message": "Are you still there?",
"messaging_service_sid": "MG1234567890abcdef",
"objective": "Provide quick support to customers.",
"tools": ["lookup", "escalate"],
"temperature": 0.7,
"pathway_id": "abc123",
"pathway_version": "latest",
"start_node_id": "entry-node",
"restart_after_end_call": true,
"timezone": "America/New_York",
"citation_schema_ids": ["b0477cba-1c97-4105-8ac9-46cb8eae5cf1"],
"disposition_ids": ["d1234567-abcd-1234-efgh-123456789012"],
"summary_prompt": "Summarize the key points and outcome of this conversation."
},
"conversation_count": 34
}
],
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
List SMS Numbers
curl --request GET \
--url https://api.bland.ai/v1/sms/numbers \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v1/sms/numbers"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v1/sms/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.bland.ai/v1/sms/numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/sms/numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bland.ai/v1/sms/numbers")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sms/numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"phone_number": "+14155552671",
"sms_config": {
"webhook": "https://example.com/sms-webhook",
"request_data": { "ref": "campaign_123" },
"time_out": 15,
"timeout_message": "This conversation has ended due to inactivity.",
"warning_time": 10,
"warning_message": "Are you still there?",
"messaging_service_sid": "MG1234567890abcdef",
"objective": "Provide quick support to customers.",
"tools": ["lookup", "escalate"],
"temperature": 0.7,
"pathway_id": "abc123",
"pathway_version": "latest",
"start_node_id": "entry-node",
"restart_after_end_call": true,
"timezone": "America/New_York",
"citation_schema_ids": ["b0477cba-1c97-4105-8ac9-46cb8eae5cf1"],
"disposition_ids": ["d1234567-abcd-1234-efgh-123456789012"],
"summary_prompt": "Summarize the key points and outcome of this conversation."
},
"conversation_count": 34
}
],
"errors": null
}