agents
channels.twilio.numbers
agents.test
conversations
data_sources
events
incidents
insights
insights.folders
insights.workflows
insights.tools
custom_messages
prompts
session_labels
sessions.transcript
sessions.full-summary
sessions.latency
session_debug
channels.targets
directory
dashboards
outbound.batches
- GETList Outbound Communication Batches
- POSTCreate Outbound Communication Batch
- GETGet Outbound Communication Batch
- PUTUpdate Outbound Communication Batch
- DELDelete Outbound Communication Batch
- POSTUpload Outbound Communication Batch
- GETFetch Outbound Communication Batch Results
- POSTCreate Outbound Communication Request
- POSTDelete Requests By List Of Reference Ids
outbound.campaigns
language_groups
custom_messages
Create Custom Message
Create a new custom message
POST
/
api
/
v1
/
custom_messages
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.custom_messages.create(request={
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"label": "Customer service",
"rules": [
{
"description": "Closed on New Year's Day",
"time_range_start": "09:00",
"time_range_end": "17:00",
"date_": "2025-01-01",
"days_of_week": [
syllable_sdk.DayOfWeek.MO,
syllable_sdk.DayOfWeek.TU,
syllable_sdk.DayOfWeek.WE,
syllable_sdk.DayOfWeek.TH,
syllable_sdk.DayOfWeek.FR,
],
"invert": False,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
},
{
"description": "Closed on New Year's Day",
"time_range_start": "09:00",
"time_range_end": "17:00",
"date_": "2025-01-01",
"days_of_week": [
syllable_sdk.DayOfWeek.MO,
syllable_sdk.DayOfWeek.TU,
syllable_sdk.DayOfWeek.WE,
syllable_sdk.DayOfWeek.TH,
syllable_sdk.DayOfWeek.FR,
],
"invert": False,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
},
],
})
# Handle response
print(res)
{
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"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"
}
],
"id": 1,
"updated_at": "2024-01-01T00:00:00Z",
"agent_count": 1,
"last_updated_by": "user@email.com",
"type": "greeting"
}
Authorizations
Body
application/json
Request model to create a custom message.
Response
200
application/json
Successful Response
Response model for custom message operations. A custom message is a pre-configured message delivered by an agent as a greeting at the beginning of a conversation. Multiple agents can use the same custom mesasage. A custom message has one or more rules defined, which allow for different messages to be dynamically selected and delivered at runtime based on the current time and either date or day of the week. For more information, see Console docs.
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.custom_messages.create(request={
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"label": "Customer service",
"rules": [
{
"description": "Closed on New Year's Day",
"time_range_start": "09:00",
"time_range_end": "17:00",
"date_": "2025-01-01",
"days_of_week": [
syllable_sdk.DayOfWeek.MO,
syllable_sdk.DayOfWeek.TU,
syllable_sdk.DayOfWeek.WE,
syllable_sdk.DayOfWeek.TH,
syllable_sdk.DayOfWeek.FR,
],
"invert": False,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
},
{
"description": "Closed on New Year's Day",
"time_range_start": "09:00",
"time_range_end": "17:00",
"date_": "2025-01-01",
"days_of_week": [
syllable_sdk.DayOfWeek.MO,
syllable_sdk.DayOfWeek.TU,
syllable_sdk.DayOfWeek.WE,
syllable_sdk.DayOfWeek.TH,
syllable_sdk.DayOfWeek.FR,
],
"invert": False,
"text": "Hello, thank you for calling. Sorry, we're closed today.",
},
],
})
# Handle response
print(res)
{
"name": "Customer service greeting",
"text": "Hello and thank you for calling customer service. How can I help you today?",
"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"
}
],
"id": 1,
"updated_at": "2024-01-01T00:00:00Z",
"agent_count": 1,
"last_updated_by": "user@email.com",
"type": "greeting"
}