Messaging
Update SMS Configuration
Update the SMS configuration for a phone number owned by the authenticated user.
POST
/
v1
/
sms
/
number
/
update
Update SMS Configuration
curl --request POST \
--url https://api.bland.ai/v1/sms/number/update \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"webhook": "<string>",
"request_data": [
{}
],
"time_out": 123,
"timeout_action": "<string>",
"timeout_message": "<string>",
"warning_time": 123,
"warning_message": "<string>",
"messaging_service_sid": "<string>",
"objective": "<string>",
"tools": [
{}
],
"temperature": 123,
"pathway_id": "<string>",
"pathway_version": "<string>",
"start_node_id": "<string>",
"restart_after_end_call": true,
"timezone": "<string>",
"summary_prompt": "<string>",
"disposition_ids": [
"<string>"
],
"citation_schema_ids": [
"<string>"
]
}
'import requests
url = "https://api.bland.ai/v1/sms/number/update"
payload = {
"phone_number": "<string>",
"webhook": "<string>",
"request_data": [{}],
"time_out": 123,
"timeout_action": "<string>",
"timeout_message": "<string>",
"warning_time": 123,
"warning_message": "<string>",
"messaging_service_sid": "<string>",
"objective": "<string>",
"tools": [{}],
"temperature": 123,
"pathway_id": "<string>",
"pathway_version": "<string>",
"start_node_id": "<string>",
"restart_after_end_call": True,
"timezone": "<string>",
"summary_prompt": "<string>",
"disposition_ids": ["<string>"],
"citation_schema_ids": ["<string>"]
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
webhook: '<string>',
request_data: [{}],
time_out: 123,
timeout_action: '<string>',
timeout_message: '<string>',
warning_time: 123,
warning_message: '<string>',
messaging_service_sid: '<string>',
objective: '<string>',
tools: [{}],
temperature: 123,
pathway_id: '<string>',
pathway_version: '<string>',
start_node_id: '<string>',
restart_after_end_call: true,
timezone: '<string>',
summary_prompt: '<string>',
disposition_ids: ['<string>'],
citation_schema_ids: ['<string>']
})
};
fetch('https://api.bland.ai/v1/sms/number/update', 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/number/update",
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' => '<string>',
'webhook' => '<string>',
'request_data' => [
[
]
],
'time_out' => 123,
'timeout_action' => '<string>',
'timeout_message' => '<string>',
'warning_time' => 123,
'warning_message' => '<string>',
'messaging_service_sid' => '<string>',
'objective' => '<string>',
'tools' => [
[
]
],
'temperature' => 123,
'pathway_id' => '<string>',
'pathway_version' => '<string>',
'start_node_id' => '<string>',
'restart_after_end_call' => true,
'timezone' => '<string>',
'summary_prompt' => '<string>',
'disposition_ids' => [
'<string>'
],
'citation_schema_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/sms/number/update"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/sms/number/update")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sms/number/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "SMS config updated for number +15550001111",
"sms_config": {
"webhook": null,
"request_data": [],
"time_out": null,
"timeout_action": null,
"timeout_message": null,
"warning_time": null,
"warning_message": null,
"messaging_service_sid": null,
"objective": "Chat with the user",
"tools": [],
"temperature": 0,
"pathway_id": null,
"pathway_version": null,
"start_node_id": null,
"restart_after_end_call": true,
"timezone": null,
"summary_prompt": null,
"disposition_ids": null,
"citation_schema_ids": null
}
},
"errors": null
}
Updating a number’s messaging settings requires an Enterprise plan or an Agent Phone Plan.
This endpoint doesn’t attach a number to a V2 agent. It has no
agent_id parameter and drops one without an error. To run an agent on the number, use Attach Numbers to Agent.On a number attached to an agent or a persona, replies don’t use objective, tools, temperature, pathway_id, pathway_version, or start_node_id. webhook, the timeout fields, and summary_prompt still apply. disposition_ids and citation_schema_ids don’t run on a conversation that runs an agent. The agent’s Dispositions run instead.Headers
Body Parameters
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.
Maximum time to wait for a user response, in seconds, before the timeout flow fires. Default is no timeout. Can be overridden per-conversation via
/v1/sms/send or /v1/sms/create.What to do when the timeout fires. Allowed values depend on your configuration (e.g.
"send_sms" to send timeout_message).Message sent when the timeout fires. Can be overridden per-conversation via
/v1/sms/send or /v1/sms/create.Seconds to wait before sending the warning message. Must be less than
time_out, otherwise the update is rejected. Can be overridden per-conversation via /v1/sms/send or /v1/sms/create.Message sent at
warning_time. Can be overridden per-conversation via /v1/sms/send or /v1/sms/create.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.Custom prompt used to generate a conversation summary when the conversation ends. When set, an AI-generated summary is included in the status webhook and stored on the conversation.
An array of outcome IDs to run when conversations end on this number. See Outcomes.
An array of citation schema IDs to extract when conversations end on this number. See Citations.
Response
{
"data": {
"message": "SMS config updated for number +15550001111",
"sms_config": {
"webhook": null,
"request_data": [],
"time_out": null,
"timeout_action": null,
"timeout_message": null,
"warning_time": null,
"warning_message": null,
"messaging_service_sid": null,
"objective": "Chat with the user",
"tools": [],
"temperature": 0,
"pathway_id": null,
"pathway_version": null,
"start_node_id": null,
"restart_after_end_call": true,
"timezone": null,
"summary_prompt": null,
"disposition_ids": null,
"citation_schema_ids": null
}
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Update SMS Configuration
curl --request POST \
--url https://api.bland.ai/v1/sms/number/update \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"webhook": "<string>",
"request_data": [
{}
],
"time_out": 123,
"timeout_action": "<string>",
"timeout_message": "<string>",
"warning_time": 123,
"warning_message": "<string>",
"messaging_service_sid": "<string>",
"objective": "<string>",
"tools": [
{}
],
"temperature": 123,
"pathway_id": "<string>",
"pathway_version": "<string>",
"start_node_id": "<string>",
"restart_after_end_call": true,
"timezone": "<string>",
"summary_prompt": "<string>",
"disposition_ids": [
"<string>"
],
"citation_schema_ids": [
"<string>"
]
}
'import requests
url = "https://api.bland.ai/v1/sms/number/update"
payload = {
"phone_number": "<string>",
"webhook": "<string>",
"request_data": [{}],
"time_out": 123,
"timeout_action": "<string>",
"timeout_message": "<string>",
"warning_time": 123,
"warning_message": "<string>",
"messaging_service_sid": "<string>",
"objective": "<string>",
"tools": [{}],
"temperature": 123,
"pathway_id": "<string>",
"pathway_version": "<string>",
"start_node_id": "<string>",
"restart_after_end_call": True,
"timezone": "<string>",
"summary_prompt": "<string>",
"disposition_ids": ["<string>"],
"citation_schema_ids": ["<string>"]
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
webhook: '<string>',
request_data: [{}],
time_out: 123,
timeout_action: '<string>',
timeout_message: '<string>',
warning_time: 123,
warning_message: '<string>',
messaging_service_sid: '<string>',
objective: '<string>',
tools: [{}],
temperature: 123,
pathway_id: '<string>',
pathway_version: '<string>',
start_node_id: '<string>',
restart_after_end_call: true,
timezone: '<string>',
summary_prompt: '<string>',
disposition_ids: ['<string>'],
citation_schema_ids: ['<string>']
})
};
fetch('https://api.bland.ai/v1/sms/number/update', 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/number/update",
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' => '<string>',
'webhook' => '<string>',
'request_data' => [
[
]
],
'time_out' => 123,
'timeout_action' => '<string>',
'timeout_message' => '<string>',
'warning_time' => 123,
'warning_message' => '<string>',
'messaging_service_sid' => '<string>',
'objective' => '<string>',
'tools' => [
[
]
],
'temperature' => 123,
'pathway_id' => '<string>',
'pathway_version' => '<string>',
'start_node_id' => '<string>',
'restart_after_end_call' => true,
'timezone' => '<string>',
'summary_prompt' => '<string>',
'disposition_ids' => [
'<string>'
],
'citation_schema_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/sms/number/update"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/sms/number/update")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sms/number/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"webhook\": \"<string>\",\n \"request_data\": [\n {}\n ],\n \"time_out\": 123,\n \"timeout_action\": \"<string>\",\n \"timeout_message\": \"<string>\",\n \"warning_time\": 123,\n \"warning_message\": \"<string>\",\n \"messaging_service_sid\": \"<string>\",\n \"objective\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"temperature\": 123,\n \"pathway_id\": \"<string>\",\n \"pathway_version\": \"<string>\",\n \"start_node_id\": \"<string>\",\n \"restart_after_end_call\": true,\n \"timezone\": \"<string>\",\n \"summary_prompt\": \"<string>\",\n \"disposition_ids\": [\n \"<string>\"\n ],\n \"citation_schema_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "SMS config updated for number +15550001111",
"sms_config": {
"webhook": null,
"request_data": [],
"time_out": null,
"timeout_action": null,
"timeout_message": null,
"warning_time": null,
"warning_message": null,
"messaging_service_sid": null,
"objective": "Chat with the user",
"tools": [],
"temperature": 0,
"pathway_id": null,
"pathway_version": null,
"start_node_id": null,
"restart_after_end_call": true,
"timezone": null,
"summary_prompt": null,
"disposition_ids": null,
"citation_schema_ids": null
}
},
"errors": null
}