Update Email Templates via API

The CRM provides an API endpoint that allows you to update existing email templates and their associated settings programmatically. This enables developers and integration partners to manage template content, subject lines, sender details, and preview text without manual intervention in the CRM interface.

Endpoint Overview

Use the PATCH /emails/builder/:templateId endpoint to modify an existing email template. This single call can update the template's design content, email settings, or both simultaneously. Note that this endpoint only updates the template itself; it does not automatically update any campaigns or workflows that may be using the template.

Benefits of API Updates

Updating templates via API offers several advantages for teams managing multiple templates or integrated systems:

  • Update both content and settings in one API call
  • Maintain consistency across templates and locations
  • Reduce manual editing effort
  • Use a simplified payload structure for content updates
  • Automatically handle plain text generation
  • Maintain backward compatibility with existing integrations

Supported Email Settings

You can update the following email settings through the API endpoint. All fields are optional—only include the fields you wish to change.

  • subject: The email subject line that appears in recipient inboxes
  • fromName: The display name of the sender
  • fromEmail: The sender's email address (must be in valid email format)
  • previewText: Short text preview shown by many email clients alongside the subject

Simplified Content Payload

The API uses a streamlined structure for updating template content. Instead of separate fields for HTML content, drag-and-drop content, and plain text status, you now use two main fields:

  • editorType: Specifies the editor type (e.g., "html")
  • editorContent: Contains the actual template content

The system automatically determines whether plain text is needed based on the content you provide, eliminating the need to manually set a plain text flag.

Updating Content and Settings Together

You can combine content and settings updates in a single API request. This is useful when you need to modify both the template design and how it appears to recipients.

Example request body:

  • editorType: "html"
  • editorContent: "<html><body><p>Updated email content</p></body></html>"
  • subject: "New Subject Line"
  • fromName: "Company Name"
  • fromEmail: "noreply@example.com"
  • previewText: "Brief preview text"

Important Considerations

When using this API endpoint, keep these points in mind:

  • The fromEmail field must contain a valid email format
  • Template updates do not automatically affect already-sent or scheduled campaigns
  • Workflow emails using the template may not update unless specifically designed to do so
  • Refer to the official API documentation for complete endpoint details, parameters, and response information