import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.customMessages.getById({
customMessageId: 909433,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.custom_messages.get_by_id(custom_message_id=909433)
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}', 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.syllable.cloud/api/v1/custom_messages/{custom_message_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Syllable-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"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Syllable-API-Key", "<api-key>")
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.syllable.cloud/api/v1/custom_messages/{custom_message_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Syllable-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"repeat_after_language_change": true,
"id": 1,
"updated_at": "2024-01-01T00:00:00Z",
"last_updated_by": "user@email.com",
"type": "greeting",
"preamble": "If this is an emergency, please hang up and call 911.",
"subject": "Your appointment reminder",
"label": "Customer service",
"rules": [
{
"date": "2025-01-01",
"description": "Closed on New Year's Day",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
"time_range_end": "17:00",
"time_range_start": "09:00"
},
{
"days_of_week": [
"sa",
"su"
],
"description": "Closed on weekends",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed on weekends.",
"time_range_end": "17:00",
"time_range_start": "09:00"
}
],
"agent_count": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Custom Message By Id
Get the custom message by its ID
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.customMessages.getById({
customMessageId: 909433,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.custom_messages.get_by_id(custom_message_id=909433)
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}', 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.syllable.cloud/api/v1/custom_messages/{custom_message_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Syllable-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"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Syllable-API-Key", "<api-key>")
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.syllable.cloud/api/v1/custom_messages/{custom_message_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/custom_messages/{custom_message_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Syllable-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"repeat_after_language_change": true,
"id": 1,
"updated_at": "2024-01-01T00:00:00Z",
"last_updated_by": "user@email.com",
"type": "greeting",
"preamble": "If this is an emergency, please hang up and call 911.",
"subject": "Your appointment reminder",
"label": "Customer service",
"rules": [
{
"date": "2025-01-01",
"description": "Closed on New Year's Day",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
"time_range_end": "17:00",
"time_range_start": "09:00"
},
{
"days_of_week": [
"sa",
"su"
],
"description": "Closed on weekends",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed on weekends.",
"time_range_end": "17:00",
"time_range_start": "09:00"
}
],
"agent_count": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Response
Successful Response
Response model for custom message operations. A custom message is a pre-configured message delivered by an agent (e.g. as a greeting at the beginning of a conversation, or as an email template with subject and body). Multiple agents can use the same custom message. Greeting-type messages may have rules for time-based variants; email templates have a subject and body only. For more information, see Console docs.
The name of the custom message
"Customer service greeting"
The default message that the agent will deliver if no rules are set or no rules match the current timestamp. For email_template, this is the body.
"Hello and thank you for calling customer service. How can I help you today?"
If true, if the caller changes language using the language menu in the custom message, the message will be repeated in the new language (not including the language menu).
The ID of the custom message
1
Timestamp of the most recent update to the custom message
"2024-01-01T00:00:00Z"
The email address of the user who most recently updated the custom message
"user@email.com"
Type of the custom message: greeting (voice) or email_template.
greeting, email_template "greeting"
An optional preamble that will be delivered before the main message, regardless of whether the current time and date match a rule or the system uses the default message. Cannot contain the "{{ language.mode }}" tag. In the case of a voice conversation, the user will not be able to interrupt the preamble. Can be used for e.g. legal disclaimers that the user must always see/hear.
"If this is an emergency, please hang up and call 911."
Email subject. Required for email_template (in type_config); ignored otherwise.
"Your appointment reminder"
The label of the custom message
"Customer service"
Rules for time-specific message variants
Show child attributes
Show child attributes
[
{
"date": "2025-01-01",
"description": "Closed on New Year's Day",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
"time_range_end": "17:00",
"time_range_start": "09:00"
},
{
"days_of_week": ["sa", "su"],
"description": "Closed on weekends",
"invert": false,
"text": "Hello, thank you for calling. Sorry, we're closed on weekends.",
"time_range_end": "17:00",
"time_range_start": "09:00"
}
]
The number of agents using the custom message
1

