> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syllable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Custom Message

> Update a custom message



## OpenAPI

````yaml https://spec.speakeasy.com/syllable/syllable/syllable-sdk-oas-with-code-samples put /api/v1/custom_messages/
openapi: 3.1.0
info:
  title: SyllableSDK
  description: >

    # Syllable Platform SDK


    Syllable SDK gives you the power of awesome AI agentry. 🚀


    ## Overview


    The Syllable SDK provides a comprehensive set of tools and APIs to integrate
    powerful AI

    capabilities into your communication applications. Whether you're building
    phone agents, chatbots,

    virtual assistants, or any other AI-driven solutions, Syllable SDK has got
    you covered.


    ## Features


    - **Agent Configuration**: Create and manage agents that can interact with
    users across various 

    channels.

    - **Channel Management**: Configure channels like SMS, web chat, and more to
    connect agents with 

    users.

    - **Custom Messages**: Set up custom messages that agents can deliver as
    greetings or responses.

    - **Conversations**: Track and manage conversations between users and
    agents, including session 

    management.

    - **Tools and Workflows**: Leverage tools and workflows to enhance agent
    capabilities, such as data 

    processing and API calls.

    - **Data Sources**: Integrate data sources to provide agents with additional
    context and 

    information.

    - **Insights and Analytics**: Analyze conversations and sessions to gain
    insights into user 

    interactions.

    - **Permissions and Security**: Manage permissions to control access to
    various features and 

    functionalities.

    - **Language Support**: Define language groups to enable multilingual
    support for agents.

    - **Outbound Campaigns**: Create and manage outbound communication campaigns
    to reach users 

    effectively.

    - **Session Labels**: Label sessions with evaluations of quality and
    descriptions of issues 

    encountered.

    - **Incident Management**: Track and manage incidents related to agent
    interactions.
  version: 0.0.3
servers:
  - url: https://api.syllable.cloud
    description: API server
security: []
tags:
  - name: agents
    description: >-
      Operations related to agent configuration. When a user interacts with
      the           Syllable system, they do so by communicating with an
      agent.           An agent is linked to a prompt, a custom message, and one
      or more channel targets to           define its behavior and capabilities.
      For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Agents).
  - name: agents.test
    description: >-
      Operations for testing agents with live text.           These endpoints
      allow sending messages to an agent and receiving its responses.
  - name: channels
    description: >-
      Operations related to channel configuration.           A channel is an
      organization-level point of communication, like a phone number or a
      web           chat. A channel can be associated with an agent by creating
      a channel target linking           them.
  - name: channels.twilio
    description: Operations related to Twilio channel configuration.
  - name: channels.twilio.numbers
    description: >-
      Operations related to setting up phone numbers in Twilio for use
      in           channels.
  - name: channels.targets
    description: >-
      Operations related to channel target configuration. A channel
      target           links a channel to an agent, allowing users to
      communicate with the agent through that           channel. For more
      information, see           [Console
      docs](https://docs.syllable.ai/Resources/Channels).
  - name: conversations
    description: >-
      Operations related to conversations.           A conversation is a record
      of messages between a user and an agent, and is composed of           one
      or more sessions.
  - name: custom_messages
    description: >-
      Operations related to custom message configuration.           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](https://docs.syllable.ai/Resources/Messages).
  - name: dashboards
    description: >-
      Operations related to dashboards. Currently the API/SDK           only
      supports fetching basic information about dashboards.
  - name: data_sources
    description: >-
      Operations related to data sources. A data source is a blob of text
      that           can be made available to an agent's general info tools to
      provide more context to the           agent when generating its responses.
      For more information, see           [Console
      docs](https://docs.syllable.ai/Resources/DataSources).
  - name: directory
    description: Operations related to directory
  - name: events
    description: >-
      Operations related to events. An event represents a specific
      occurrence           during a session. Currently the API/SDK only supports
      fetching logged events.
  - name: incidents
    description: Operations related to incidents.
  - name: insights
    description: >-
      Operations related to insights results. An insight is a tool that
      processes          conversation data to extract information and generate
      reports.
  - name: insights.folders
    description: >-
      Operations related to insights upload folders. An insight folder is
      used          to upload call recordings for insight workflow analysis.
  - name: insights.tools
    description: >-
      Operations related to insights tool configurationss. An insight is a
      tool           that processes conversation data to extract information and
      generate reports.
  - name: insights.workflows
    description: >-
      Operations related to insights workflows. An workflow is series of
      tool           invocations that processes conversation data to extract
      information and generate           reports.
  - name: language_groups
    description: >-
      Operations related to language groups. A language group is a          
      collection of language, voice, and DTMF configuration that can be linked
      to an agent to           define the languages and voices it supports. For
      more information, see           [Console
      docs](https://docs.syllable.ai/Resources/LanguageGroups).
  - name: organizations
    description: Operations related to organizations.
  - name: outbound.campaigns
    description: Operations related to outbound message campaigns
  - name: outbound.batches
    description: Operations related to outbound campaign batches
  - name: permissions
    description: >-
      Operations related to permissions. A permission is a specific          
      capability or access level granted to a user within the Syllable
      system.           Permissions are used to control access to various
      features and functionalities.
  - name: prompts
    description: >-
      Operations related to prompts. A prompt defines the behavior of
      an           agent by delivering instructions to the LLM about how the
      agent should behave.           A prompt can be linked to one or more
      agents. A prompt can also be linked to tools to           allow an agent
      using the prompt to use them. For more information, see           [Console
      docs](https://docs.syllable.ai/Resources/Prompts).
  - name: roles
    description: >-
      Operations related to roles. A role is a collection of
      permissions           that can be assigned to users to control their
      access to various features within the           Syllable system.
  - name: services
    description: >-
      Operations related to service configuration. A service is a collection
      of           tools. You can specify an authentication method and values on
      a service, and any linked           tools will use that auth information
      to generate headers for HTTP calls.
  - name: sessions
    description: >-
      Operations related to sessions. A session is a building block of
      a           conversation. For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Sessions).
  - name: session_labels
    description: >-
      Operations related to labeling sessions with evaluations of quality
      and           descriptions of issues the user encountered or other
      details. For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Sessions).
  - name: tools
    description: >-
      Operations related to tool configuration. A tool is a function that
      an           agent can call to perform actions like accessing databases,
      making API calls, or           processing data. For an agent to have
      access to a tool, the prompt associated with that           agent should
      be linked to the tool and include instructions to use it. For
      more           information, see [Console
      docs](https://docs.syllable.ai/Resources/Tools).
paths:
  /api/v1/custom_messages/:
    put:
      tags:
        - custom_messages
      summary: Update Custom Message
      description: Update a custom message
      operationId: custom_messages_update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomMessageUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { SyllableSDK } from "syllable-sdk";

            const syllableSDK = new SyllableSDK({
              apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
            });

            async function run() {
              const result = await syllableSDK.customMessages.update({
                name: "Customer service greeting",
                preamble: "If this is an emergency, please hang up and call 911.",
                text: "Hello and thank you for calling customer service. How can I help you today?",
                subject: "Your appointment reminder",
                label: "Customer service",
                rules: [
                  {
                    description: "Closed on New Year's Day",
                    timeRangeStart: "09:00",
                    timeRangeEnd: "17:00",
                    date: "2025-01-01",
                    invert: false,
                    text: "Hello, thank you for calling. Sorry, we're closed today.",
                  },
                  {
                    description: "Closed on weekends",
                    timeRangeStart: "09:00",
                    timeRangeEnd: "17:00",
                    daysOfWeek: [
                      "sa",
                      "su",
                    ],
                    invert: false,
                    text: "Hello, thank you for calling. Sorry, we're closed on weekends.",
                  },
                ],
                id: 1,
              });

              console.log(result);
            }

            run();
        - lang: python
          label: Python (SDK)
          source: |-
            import os
            from syllable_sdk import SyllableSDK, models


            with SyllableSDK(
                api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
            ) as ss_client:

                res = ss_client.custom_messages.update(request={
                    "name": "Customer service greeting",
                    "preamble": "If this is an emergency, please hang up and call 911.",
                    "text": "Hello and thank you for calling customer service. How can I help you today?",
                    "subject": "Your appointment reminder",
                    "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",
                            "invert": False,
                            "text": "Hello, thank you for calling. Sorry, we're closed today.",
                        },
                        {
                            "description": "Closed on weekends",
                            "time_range_start": "09:00",
                            "time_range_end": "17:00",
                            "days_of_week": [
                                models.DayOfWeek.SA,
                                models.DayOfWeek.SU,
                            ],
                            "invert": False,
                            "text": "Hello, thank you for calling. Sorry, we're closed on weekends.",
                        },
                    ],
                    "id": 1,
                })

                # Handle response
                print(res)
components:
  schemas:
    CustomMessageUpdateRequest:
      properties:
        name:
          type: string
          title: Name
          description: The name of the custom message
          examples:
            - Customer service greeting
        type:
          $ref: '#/components/schemas/CustomMessageType'
          description: 'Type of the custom message: greeting (voice) or email_template.'
          default: greeting
          examples:
            - greeting
        preamble:
          anyOf:
            - type: string
            - type: 'null'
          title: Preamble
          description: >-
            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.
          examples:
            - If this is an emergency, please hang up and call 911.
        text:
          type: string
          title: Text
          description: >-
            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.
          examples:
            - >-
              Hello and thank you for calling customer service. How can I help
              you today?
        subject:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject
          description: >-
            Email subject. Required for email_template (in type_config); ignored
            otherwise.
          examples:
            - Your appointment reminder
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: The label of the custom message
          examples:
            - Customer service
        repeat_after_language_change:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Repeat After Language Change
          description: >-
            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). If omitted or null on create,
            false is stored. If omitted or null on update, existing value will
            not be changed.
        rules:
          items:
            $ref: '#/components/schemas/CustomMessageRule'
          type: array
          title: Rules
          description: Rules for time-specific message variants
          default: []
          examples:
            - - 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:
          type: integer
          title: Id
          description: The ID of the custom message
          examples:
            - 1
      type: object
      required:
        - name
        - text
        - id
      title: CustomMessageUpdateRequest
      description: Request model to update an existing custom message.
    CustomMessageResponse:
      properties:
        name:
          type: string
          title: Name
          description: The name of the custom message
          examples:
            - Customer service greeting
        type:
          $ref: '#/components/schemas/CustomMessageType'
          description: 'Type of the custom message: greeting (voice) or email_template.'
          default: greeting
          examples:
            - greeting
        preamble:
          anyOf:
            - type: string
            - type: 'null'
          title: Preamble
          description: >-
            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.
          examples:
            - If this is an emergency, please hang up and call 911.
        text:
          type: string
          title: Text
          description: >-
            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.
          examples:
            - >-
              Hello and thank you for calling customer service. How can I help
              you today?
        subject:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject
          description: >-
            Email subject. Required for email_template (in type_config); ignored
            otherwise.
          examples:
            - Your appointment reminder
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: The label of the custom message
          examples:
            - Customer service
        repeat_after_language_change:
          type: boolean
          title: Repeat After Language Change
          description: >-
            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).
        rules:
          items:
            $ref: '#/components/schemas/CustomMessageRule'
          type: array
          title: Rules
          description: Rules for time-specific message variants
          default: []
          examples:
            - - 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:
          type: integer
          title: Id
          description: The ID of the custom message
          examples:
            - 1
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp of the most recent update to the custom message
          examples:
            - '2024-01-01T00:00:00Z'
        agent_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Count
          description: The number of agents using the custom message
          examples:
            - 1
        last_updated_by:
          type: string
          title: Last Updated By
          description: >-
            The email address of the user who most recently updated the custom
            message
          examples:
            - user@email.com
      type: object
      required:
        - name
        - text
        - repeat_after_language_change
        - id
        - updated_at
        - last_updated_by
      title: CustomMessageResponse
      description: >-
        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](https://docs.syllable.ai/Resources/Messages).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomMessageType:
      type: string
      enum:
        - greeting
        - email_template
      title: CustomMessageType
      description: >-
        Type of custom message. Greeting is for voice; email_template is for
        email (subject + body).
    CustomMessageRule:
      properties:
        description:
          type: string
          title: Description
          description: The description of the rule
          examples:
            - Closed on New Year's Day
        time_range_start:
          anyOf:
            - type: string
              pattern: ^([01]\d|2[0-3]):[0-5]\d$
            - type: 'null'
          title: Time Range Start
          description: >-
            The start of the time range for the rule in 24-hour format hh:mm
            (should be null for "all day" cases)
          examples:
            - '09:00'
        time_range_end:
          anyOf:
            - type: string
              pattern: ^([01]\d|2[0-3]):[0-5]\d$
            - type: 'null'
          title: Time Range End
          description: >-
            The end of the time range for the rule in 24-hour format hh:mm
            (should be null for "all day" cases)
          examples:
            - '17:00'
        date:
          anyOf:
            - type: string
              pattern: \b(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])\b
            - type: 'null'
          title: Date
          description: The date for the rule in YYYY-MM-DD format
          examples:
            - '2025-01-01'
        days_of_week:
          anyOf:
            - items:
                $ref: '#/components/schemas/DayOfWeek'
              type: array
            - type: 'null'
          title: Days Of Week
          description: The days of the week for the rule
          examples:
            - - mo
              - tu
              - we
              - th
              - fr
        invert:
          type: boolean
          title: Invert
          description: Whether the rule logic should be inverted (i.e. "not")
          examples:
            - false
        text:
          type: string
          title: Text
          description: Message text associated with the rule
          examples:
            - Hello, thank you for calling. Sorry, we're closed today.
      type: object
      required:
        - description
        - invert
        - text
      title: CustomMessageRule
      description: >-
        A rule used to determine whether a custom message should present a
        variant message based on

        the current timestamp.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DayOfWeek:
      type: string
      enum:
        - mo
        - tu
        - we
        - th
        - fr
        - sa
        - su
      title: DayOfWeek
      description: Available options for day of the week for use in message rules.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Syllable-API-Key

````