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

# Update message template

> Updates a message template’s name, description, purpose, or email content.



## OpenAPI

````yaml /openapi.yaml patch /v1/message-templates/{id}
openapi: 3.1.0
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
security:
  - organizationApiKey: []
  - oauthAccessToken: []
tags:
  - name: Auth
  - name: Management
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
  - name: Messaging
paths:
  /v1/message-templates/{id}:
    patch:
      tags:
        - Messaging
      summary: Update message template
      description: >-
        Updates a message template’s name, description, purpose, or email
        content.
      operationId: message_templates_update
      parameters:
        - schema:
            type: string
            description: Identifier of the message template.
          required: true
          description: Identifier of the message template.
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMessageTemplateArgs'
      responses:
        '200':
          description: Message template updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageTemplatePayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '404':
          description: Message template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    UpdateMessageTemplateArgs:
      type: object
      properties:
        input:
          type: object
          properties:
            id:
              type: string
            data:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 191
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 1024
                purpose:
                  type:
                    - string
                    - 'null'
                  enum:
                    - PAYMENT_REMINDER_NEAR_DUE
                    - PAYMENT_REMINDER_DUE
                    - PAYMENT_REMINDER_NEAR_OVERDUE
                    - DECLINED_PAYMENT
                    - PAYMENT_RECEIPT
                    - CARD_EXPIRY_NOTICE
                    - WHATSAPP_OPT_IN
                    - LOGIN_VERIFICATION_CODE
                    - MESSAGE_PREVIEW_NOTIFICATION
                    - PENDING_INVOICES_REMINDER
                    - null
                emailTemplate:
                  type: object
                  properties:
                    subject:
                      type: string
                      minLength: 1
                      maxLength: 512
                    body:
                      type: string
                      minLength: 1
                    linkText:
                      type:
                        - string
                        - 'null'
                      maxLength: 255
              additionalProperties: false
          required:
            - id
            - data
      required:
        - input
      description: Request body for updating a message template.
    MessageTemplatePayload:
      type: object
      properties:
        messageTemplate:
          $ref: '#/components/schemas/MessageTemplate'
      required:
        - messageTemplate
      description: The created or updated message template.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    MessageTemplate:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the message template.
          example: msgt_1234567890abcdefghij
        createdAt:
          type: string
          format: date-time
          description: When the template was created.
        updatedAt:
          type: string
          format: date-time
          description: When the template was last updated.
        organizationId:
          type: string
          description: Organization that owns the template.
        name:
          type: string
          description: Name of the template.
          example: Recordatorio de pago
        description:
          type:
            - string
            - 'null'
          description: Optional description of the template.
        channel:
          type: string
          enum:
            - EMAIL
            - SMS
            - WHATSAPP
          description: Channel the template is sent through.
        purpose:
          type:
            - string
            - 'null'
          enum:
            - PAYMENT_REMINDER_NEAR_DUE
            - PAYMENT_REMINDER_DUE
            - PAYMENT_REMINDER_NEAR_OVERDUE
            - DECLINED_PAYMENT
            - PAYMENT_RECEIPT
            - CARD_EXPIRY_NOTICE
            - WHATSAPP_OPT_IN
            - LOGIN_VERIFICATION_CODE
            - MESSAGE_PREVIEW_NOTIFICATION
            - PENDING_INVOICES_REMINDER
            - null
          description: Automatic message this template is the default for, if any.
        emailTemplate:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: Unique identifier of the configuration.
            createdAt:
              type: string
              format: date-time
              description: When the configuration was created.
            updatedAt:
              type: string
              format: date-time
              description: When the configuration was last updated.
            organizationId:
              type: string
              description: Organization that owns the configuration.
            messageTemplateId:
              type: string
              description: Message template this configuration belongs to.
            subject:
              type: string
              description: Email subject. May contain variable placeholders.
            body:
              type: string
              description: Email body. May contain variable placeholders.
            linkText:
              type:
                - string
                - 'null'
              description: Payment link text. May contain variable placeholders.
          required:
            - id
            - createdAt
            - updatedAt
            - organizationId
            - messageTemplateId
            - subject
            - body
            - linkText
          description: Subject, body, and link text of an EMAIL template.
        smsTemplate:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: Unique identifier of the configuration.
            createdAt:
              type: string
              format: date-time
              description: When the configuration was created.
            updatedAt:
              type: string
              format: date-time
              description: When the configuration was last updated.
            organizationId:
              type: string
              description: Organization that owns the configuration.
            messageTemplateId:
              type: string
              description: Message template this configuration belongs to.
            body:
              type: string
              description: SMS body. May contain variable placeholders.
          required:
            - id
            - createdAt
            - updatedAt
            - organizationId
            - messageTemplateId
            - body
          description: Body of an SMS template.
        whatsappTemplate:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: Unique identifier of the configuration.
            createdAt:
              type: string
              format: date-time
              description: When the configuration was created.
            updatedAt:
              type: string
              format: date-time
              description: When the configuration was last updated.
            organizationId:
              type: string
              description: Organization that owns the configuration.
            messageTemplateId:
              type:
                - string
                - 'null'
              description: Message template this configuration belongs to.
            whatsappTemplateId:
              type:
                - string
                - 'null'
              description: WhatsApp template whose components contain the message content.
            variableMappings:
              type: array
              items:
                $ref: '#/components/schemas/WhatsappTemplateConfigVariableMapping'
              description: Values assigned to the WhatsApp template parameters.
          required:
            - id
            - createdAt
            - updatedAt
            - organizationId
            - messageTemplateId
            - whatsappTemplateId
            - variableMappings
          description: WhatsApp template and parameter values of a WHATSAPP template.
      required:
        - id
        - createdAt
        - updatedAt
        - organizationId
        - name
        - description
        - channel
        - purpose
        - emailTemplate
        - smsTemplate
        - whatsappTemplate
      description: An email or WhatsApp message template used by reminders and workflows.
    WhatsappTemplateConfigVariableMapping:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the configuration.
        createdAt:
          type: string
          format: date-time
          description: When the configuration was created.
        updatedAt:
          type: string
          format: date-time
          description: When the configuration was last updated.
        organizationId:
          type: string
          description: Organization that owns the configuration.
        whatsappTemplateConfigId:
          type: string
          description: WhatsApp configuration this mapping belongs to.
        component:
          type: string
          enum:
            - HEADER
            - BODY
          description: WhatsApp component containing the parameter.
        paramName:
          type: string
          description: WhatsApp template parameter name.
          example: customer_name
        variableName:
          type: string
          description: >-
            Literal text, or a runtime expression such as
            {{organizacion.nombre}}.
      required:
        - id
        - createdAt
        - updatedAt
        - organizationId
        - whatsappTemplateConfigId
        - component
        - paramName
        - variableName
      description: Value assigned to a WhatsApp template parameter.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'
    oauthAccessToken:
      type: http
      scheme: bearer
      bearerFormat: OAuth 2.1
      description: 'OAuth access token using `Authorization: Bearer qoa_at_...`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.