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

# Update an email template



## OpenAPI

````yaml /openapi.json post /email_templates/{id}
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /email_templates/{id}:
    post:
      tags:
        - Email templates
      summary: Update an email template
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the email template
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the email template
                subject:
                  type: string
                  description: >-
                    The subject of the email template. Variables are supported
                    via `{{ variableName }}`
                body:
                  type: string
                  description: >-
                    The plaintext version of the body of the email template.
                    Variables are supported via `{{ variableName }}`
                template_html:
                  type: string
                  description: >-
                    The HTML representation of the email template. Mutually
                    exclusive with plain text email templates.
                template_json:
                  type: object
                  additionalProperties: true
                  description: >-
                    The JSON representation of the email template. This will
                    override the `name`, `subject`, and `body` properties
                new_template_json:
                  type: object
                  additionalProperties: true
                  description: >-
                    The JSON representing the rich text email template. Mutually
                    exclusive with plain text email templates
                new_template_html:
                  type: string
                  description: >-
                    The HTML representation of the rich text email template.
                    Mutually exclusive with plain text email templates
                attachments:
                  type: array
                  items:
                    anyOf:
                      - type: string
                      - type: object
                        properties:
                          content:
                            type: string
                            description: >-
                              The content of the attachment as a data url, e.g.
                              'data:image/png;base64,abcd1234'
                          name:
                            type: string
                            description: The intended name of the attachment
                        required:
                          - content
                          - name
                  description: >-
                    An array of existing attachment IDs or new attachments that
                    will always be sent with this template
                kind:
                  type: string
                  enum:
                    - unlayer
                    - editor
                    - old_editor
                    - html
                  description: The kind of the email template
                metadata:
                  type: object
                  additionalProperties: true
                  description: The metadata for the email template
      responses:
        '200':
          description: The updated `EmailTemplate` object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailTemplate'
components:
  schemas:
    EmailTemplate:
      type: object
      properties:
        id:
          type: string
          description: The ID of the email template
        name:
          type: string
          description: The name of the email template
        subject:
          type: string
          description: >-
            The subject of the email template. Variables are supported via `{{
            variableName }}`
        body:
          type: string
          nullable: true
          description: >-
            (Deprecated) The body of the email template. Always `null` since
            there are no plaintext emails
        kind:
          type: string
          enum:
            - html
            - unlayer
            - old_editor
            - editor
          description: The kind of the email template
        template_html:
          type: string
          nullable: true
          description: The HTML representation of the rich text email. May be null
        template_json:
          nullable: true
          description: The JSON representing the rich text email template. May be null
        new_template_json:
          nullable: true
          description: The new unlayer JSON template. May be null
        new_template_html:
          type: string
          nullable: true
          description: The new unlayer HTML template. May be null
        attachments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The ID of the attachment
              name:
                type: string
                description: The name of the attachment
            required:
              - id
              - name
          description: An array of attachments associated with the email template
        metadata:
          type: object
          additionalProperties: true
          description: Arbitrary metadata associated with this email template
        created_at:
          type: string
          description: The time when the email template was created in ISO 8601 format
        enabled_at:
          type: string
          nullable: true
          description: The time when the email template was enabled in ISO 8601 format
      required:
        - id
        - name
        - subject
        - body
        - kind
        - template_html
        - template_json
        - new_template_json
        - new_template_html
        - attachments
        - metadata
        - created_at
      title: The Email Template object
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````