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

# Update a dynamic template

> Update an existing Handlebars template



## OpenAPI

````yaml openapi1 PATCH /dynamic_templates/{id}
openapi: 3.0.0
info:
  title: Paubox Email API
  description: >
    Public documentation for Paubox's Transactional Email API


    ## Authentication


    **IMPORTANT**: This API uses a custom authentication format that requires
    the "Token token=" prefix.


    All requests must include the Authorization header in this exact format:

    ```

    Authorization: Token token=YOUR_API_KEY

    ```


    **Note for Code Generation Tools**: Auto-generated code from this
    specification may need to be modified to include the "Token token=" prefix,
    as most generators expect standard Bearer token format.
  version: 1.0.0
servers:
  - url: https://api.paubox.net/v1/{api_username}
    description: Paubox Email API
    variables:
      api_username:
        description: Your Paubox Email API endpoint username
        default: YOUR_API_USERNAME
security:
  - PauboxToken: []
tags:
  - name: Messages
    description: Send individual or bulk transactional email
  - name: Dynamic Templates
    description: Manage and use dynamic Handlebars templates for email content
paths:
  /dynamic_templates/{id}:
    patch:
      tags:
        - Dynamic Templates
      summary: Update a dynamic template
      description: Update an existing Handlebars template
      operationId: updateDynamicTemplate
      parameters:
        - name: id
          in: path
          description: Template ID to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/dynamic_templates_id_body'
        required: true
      responses:
        '200':
          description: Template updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicTemplateResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - PauboxToken: []
components:
  schemas:
    dynamic_templates_id_body:
      type: object
      properties:
        data[name]:
          type: string
          description: Updated name for the template
          example: updated_welcome_template
        data[body]:
          type: string
          description: Updated Handlebars template file (.hbs)
          format: binary
    DynamicTemplateResponse:
      type: object
      properties:
        id:
          type: string
          description: Template ID
          example: template_123
        name:
          type: string
          description: Template name
          example: welcome_template
        body:
          type: string
          description: Template content (Handlebars)
          example: Hello {{name}}, welcome to our service!
        created_at:
          type: string
          description: Template creation timestamp
          format: date-time
        updated_at:
          type: string
          description: Template last update timestamp
          format: date-time
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponse_errors'
    ErrorResponse_errors:
      type: object
      properties:
        code:
          type: integer
        title:
          type: string
        details:
          type: string
  securitySchemes:
    PauboxToken:
      type: http
      scheme: bearer
      description: >
        Paubox API uses Bearer token authentication in the Authorization header.


        Format: `Authorization: Bearer YOUR_API_KEY_HERE`


        Example: `Authorization: Bearer
        9e5b092b632445b8f570c62ae54f30fda1044305`


        The legacy format `Authorization: Token token=YOUR_API_KEY_HERE` is also
        supported.

````