curl --request POST \
--url https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phone_number": "+1234567890",
"webhook": "https://your-webhook-url.com/sms-callback",
"agent_name": "John Doe",
"request_data": [
{
"key": "value",
"customer_id": "12345"
}
],
"time_out": 300,
"messaging_service_sid": "MG1234567890abcdef1234567890abcdef",
"objective": "You are a helpful customer service agent. Your goal is to assist customers with their inquiries.",
"tools": [
{
"name": "search",
"description": "Search for information"
}
],
"temperature": 0.7,
"pathway_id": "path_1234567890abcdef",
"pathway_version": "v1.0.0",
"start_node_id": "node_1234567890abcdef",
"webhook_trigger_on": "final_disposition",
"follow_up_config": {
"enable_follow_ups": true,
"enable_smart_follow_ups": true,
"repeat_final_follow_up": false,
"follow_up_schedule": [
{
"time": 5,
"unit": "minutes",
"repeat_forever": false
}
],
"extra_follow_up_prompt": "Please respond to continue our conversation"
}
}
'import requests
url = "https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration"
payload = {
"phone_number": "+1234567890",
"webhook": "https://your-webhook-url.com/sms-callback",
"agent_name": "John Doe",
"request_data": [
{
"key": "value",
"customer_id": "12345"
}
],
"time_out": 300,
"messaging_service_sid": "MG1234567890abcdef1234567890abcdef",
"objective": "You are a helpful customer service agent. Your goal is to assist customers with their inquiries.",
"tools": [
{
"name": "search",
"description": "Search for information"
}
],
"temperature": 0.7,
"pathway_id": "path_1234567890abcdef",
"pathway_version": "v1.0.0",
"start_node_id": "node_1234567890abcdef",
"webhook_trigger_on": "final_disposition",
"follow_up_config": {
"enable_follow_ups": True,
"enable_smart_follow_ups": True,
"repeat_final_follow_up": False,
"follow_up_schedule": [
{
"time": 5,
"unit": "minutes",
"repeat_forever": False
}
],
"extra_follow_up_prompt": "Please respond to continue our conversation"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '+1234567890',
webhook: 'https://your-webhook-url.com/sms-callback',
agent_name: 'John Doe',
request_data: [{key: 'value', customer_id: '12345'}],
time_out: 300,
messaging_service_sid: 'MG1234567890abcdef1234567890abcdef',
objective: 'You are a helpful customer service agent. Your goal is to assist customers with their inquiries.',
tools: [{name: 'search', description: 'Search for information'}],
temperature: 0.7,
pathway_id: 'path_1234567890abcdef',
pathway_version: 'v1.0.0',
start_node_id: 'node_1234567890abcdef',
webhook_trigger_on: 'final_disposition',
follow_up_config: {
enable_follow_ups: true,
enable_smart_follow_ups: true,
repeat_final_follow_up: false,
follow_up_schedule: [{time: 5, unit: 'minutes', repeat_forever: false}],
extra_follow_up_prompt: 'Please respond to continue our conversation'
}
})
};
fetch('https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration', 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.cleartalk.ai/cleartalk-sms/update-sms-configuration",
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' => '+1234567890',
'webhook' => 'https://your-webhook-url.com/sms-callback',
'agent_name' => 'John Doe',
'request_data' => [
[
'key' => 'value',
'customer_id' => '12345'
]
],
'time_out' => 300,
'messaging_service_sid' => 'MG1234567890abcdef1234567890abcdef',
'objective' => 'You are a helpful customer service agent. Your goal is to assist customers with their inquiries.',
'tools' => [
[
'name' => 'search',
'description' => 'Search for information'
]
],
'temperature' => 0.7,
'pathway_id' => 'path_1234567890abcdef',
'pathway_version' => 'v1.0.0',
'start_node_id' => 'node_1234567890abcdef',
'webhook_trigger_on' => 'final_disposition',
'follow_up_config' => [
'enable_follow_ups' => true,
'enable_smart_follow_ups' => true,
'repeat_final_follow_up' => false,
'follow_up_schedule' => [
[
'time' => 5,
'unit' => 'minutes',
'repeat_forever' => false
]
],
'extra_follow_up_prompt' => 'Please respond to continue our conversation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.cleartalk.ai/cleartalk-sms/update-sms-configuration"
payload := strings.NewReader("{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.cleartalk.ai/cleartalk-sms/update-sms-configuration")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}"
response = http.request(request)
puts response.read_bodyUpdate SMS configuration
curl --request POST \
--url https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phone_number": "+1234567890",
"webhook": "https://your-webhook-url.com/sms-callback",
"agent_name": "John Doe",
"request_data": [
{
"key": "value",
"customer_id": "12345"
}
],
"time_out": 300,
"messaging_service_sid": "MG1234567890abcdef1234567890abcdef",
"objective": "You are a helpful customer service agent. Your goal is to assist customers with their inquiries.",
"tools": [
{
"name": "search",
"description": "Search for information"
}
],
"temperature": 0.7,
"pathway_id": "path_1234567890abcdef",
"pathway_version": "v1.0.0",
"start_node_id": "node_1234567890abcdef",
"webhook_trigger_on": "final_disposition",
"follow_up_config": {
"enable_follow_ups": true,
"enable_smart_follow_ups": true,
"repeat_final_follow_up": false,
"follow_up_schedule": [
{
"time": 5,
"unit": "minutes",
"repeat_forever": false
}
],
"extra_follow_up_prompt": "Please respond to continue our conversation"
}
}
'import requests
url = "https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration"
payload = {
"phone_number": "+1234567890",
"webhook": "https://your-webhook-url.com/sms-callback",
"agent_name": "John Doe",
"request_data": [
{
"key": "value",
"customer_id": "12345"
}
],
"time_out": 300,
"messaging_service_sid": "MG1234567890abcdef1234567890abcdef",
"objective": "You are a helpful customer service agent. Your goal is to assist customers with their inquiries.",
"tools": [
{
"name": "search",
"description": "Search for information"
}
],
"temperature": 0.7,
"pathway_id": "path_1234567890abcdef",
"pathway_version": "v1.0.0",
"start_node_id": "node_1234567890abcdef",
"webhook_trigger_on": "final_disposition",
"follow_up_config": {
"enable_follow_ups": True,
"enable_smart_follow_ups": True,
"repeat_final_follow_up": False,
"follow_up_schedule": [
{
"time": 5,
"unit": "minutes",
"repeat_forever": False
}
],
"extra_follow_up_prompt": "Please respond to continue our conversation"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '+1234567890',
webhook: 'https://your-webhook-url.com/sms-callback',
agent_name: 'John Doe',
request_data: [{key: 'value', customer_id: '12345'}],
time_out: 300,
messaging_service_sid: 'MG1234567890abcdef1234567890abcdef',
objective: 'You are a helpful customer service agent. Your goal is to assist customers with their inquiries.',
tools: [{name: 'search', description: 'Search for information'}],
temperature: 0.7,
pathway_id: 'path_1234567890abcdef',
pathway_version: 'v1.0.0',
start_node_id: 'node_1234567890abcdef',
webhook_trigger_on: 'final_disposition',
follow_up_config: {
enable_follow_ups: true,
enable_smart_follow_ups: true,
repeat_final_follow_up: false,
follow_up_schedule: [{time: 5, unit: 'minutes', repeat_forever: false}],
extra_follow_up_prompt: 'Please respond to continue our conversation'
}
})
};
fetch('https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration', 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.cleartalk.ai/cleartalk-sms/update-sms-configuration",
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' => '+1234567890',
'webhook' => 'https://your-webhook-url.com/sms-callback',
'agent_name' => 'John Doe',
'request_data' => [
[
'key' => 'value',
'customer_id' => '12345'
]
],
'time_out' => 300,
'messaging_service_sid' => 'MG1234567890abcdef1234567890abcdef',
'objective' => 'You are a helpful customer service agent. Your goal is to assist customers with their inquiries.',
'tools' => [
[
'name' => 'search',
'description' => 'Search for information'
]
],
'temperature' => 0.7,
'pathway_id' => 'path_1234567890abcdef',
'pathway_version' => 'v1.0.0',
'start_node_id' => 'node_1234567890abcdef',
'webhook_trigger_on' => 'final_disposition',
'follow_up_config' => [
'enable_follow_ups' => true,
'enable_smart_follow_ups' => true,
'repeat_final_follow_up' => false,
'follow_up_schedule' => [
[
'time' => 5,
'unit' => 'minutes',
'repeat_forever' => false
]
],
'extra_follow_up_prompt' => 'Please respond to continue our conversation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.cleartalk.ai/cleartalk-sms/update-sms-configuration"
payload := strings.NewReader("{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.cleartalk.ai/cleartalk-sms/update-sms-configuration")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/cleartalk-sms/update-sms-configuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"+1234567890\",\n \"webhook\": \"https://your-webhook-url.com/sms-callback\",\n \"agent_name\": \"John Doe\",\n \"request_data\": [\n {\n \"key\": \"value\",\n \"customer_id\": \"12345\"\n }\n ],\n \"time_out\": 300,\n \"messaging_service_sid\": \"MG1234567890abcdef1234567890abcdef\",\n \"objective\": \"You are a helpful customer service agent. Your goal is to assist customers with their inquiries.\",\n \"tools\": [\n {\n \"name\": \"search\",\n \"description\": \"Search for information\"\n }\n ],\n \"temperature\": 0.7,\n \"pathway_id\": \"path_1234567890abcdef\",\n \"pathway_version\": \"v1.0.0\",\n \"start_node_id\": \"node_1234567890abcdef\",\n \"webhook_trigger_on\": \"final_disposition\",\n \"follow_up_config\": {\n \"enable_follow_ups\": true,\n \"enable_smart_follow_ups\": true,\n \"repeat_final_follow_up\": false,\n \"follow_up_schedule\": [\n {\n \"time\": 5,\n \"unit\": \"minutes\",\n \"repeat_forever\": false\n }\n ],\n \"extra_follow_up_prompt\": \"Please respond to continue our conversation\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API Key for authentication
Body
The E.164 formatted phone number to update (must belong to the authenticated user)
"+1234567890"
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
"https://your-webhook-url.com/sms-callback"
The name of the agent
"John Doe"
Request data fields are available to the AI agent during the call when referenced in the associated pathway or task
[{ "key": "value", "customer_id": "12345" }]
Maximum time to wait for a response (in seconds). Follow-up times must be less than this value.
300
Twilio Messaging Service SID, if set
"MG1234567890abcdef1234567890abcdef"
Assistant system prompt or conversational goal
"You are a helpful customer service agent. Your goal is to assist customers with their inquiries."
List of tools available to the assistant
[
{
"name": "search",
"description": "Search for information"
}
]
The model's temperature setting, controlling creativity
0.7
The ID of the linked conversational pathway (if any)
"path_1234567890abcdef"
The specific version of the pathway to use
"v1.0.0"
Entry point node ID for the pathway
"node_1234567890abcdef"
When to trigger the webhook: on each message or only on final disposition
each_message, final_disposition "final_disposition"
Follow-up configuration for the SMS agent
Show child attributes
Show child attributes
{
"enable_follow_ups": true,
"enable_smart_follow_ups": true,
"repeat_final_follow_up": false,
"follow_up_schedule": [
{
"time": 5,
"unit": "minutes",
"repeat_forever": false
}
],
"extra_follow_up_prompt": "Please respond to continue our conversation"
}
