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

# Update template

> Update an existing template



## OpenAPI

````yaml https://vortexpdf.com/openapi patch /api/v1/templates/{id}
openapi: 3.0.0
info:
  title: Vortex PDF
  version: '1.0'
servers:
  - url: https://vortexpdf.com
    variables: {}
security: []
tags: []
paths:
  /api/v1/templates/{id}:
    patch:
      tags:
        - Templates
      summary: Update template
      description: Update an existing template
      operationId: VortexWeb.API.V1.TemplateController.update
      parameters:
        - description: Template ID
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/template_update_request'
        description: Template params
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template_response'
          description: Template response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth_error_response'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth_error_response'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
          description: Not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonErrorResponse'
          description: Unprocessable Entity
      callbacks: {}
      security:
        - authorization: []
components:
  schemas:
    template_update_request:
      description: PATCH body for updating a template
      properties:
        template:
          example:
            content: <h1>Invoice</h1><p>This is a sample invoice template</p>
            name: Invoice Template
            preview_context:
              amount: 1000
              customer: Acme Inc.
          properties:
            content:
              description: The HTML content of the template
              type: string
            name:
              description: The name of the template
              minLength: 1
              type: string
            preview_context:
              description: JSON context for template preview
              type: object
          type: object
      required:
        - template
      title: template_update_request
      type: object
    template_response:
      description: Response schema for a single template
      properties:
        data:
          $ref: '#/components/schemas/template'
      required:
        - data
      title: template_response
      type: object
    auth_error_response:
      description: Response when authentication or authorization fails
      example:
        error: unauthorized
        message: Authentication required to access this resource
      properties:
        error:
          description: Error message describing the authentication or authorization failure
          enum:
            - unauthorized
            - forbidden
            - invalid_token
            - expired_token
            - insufficient_permissions
          type: string
        message:
          description: A more detailed message explaining the error
          type: string
      required:
        - error
      title: auth_error_response
      type: object
    error_response:
      description: Response when an error occurs
      properties:
        error:
          properties:
            message:
              description: Error message
              type: string
          required:
            - message
          type: object
      required:
        - error
      title: error_response
      type: object
    JsonErrorResponse:
      properties:
        errors:
          items:
            properties:
              detail:
                example: null value where string expected
                type: string
              source:
                properties:
                  pointer:
                    example: /data/attributes/petName
                    type: string
                required:
                  - pointer
                type: object
              title:
                example: Invalid value
                type: string
            required:
              - title
              - source
              - detail
            type: object
          type: array
      required:
        - errors
      title: JsonErrorResponse
      type: object
    template:
      description: A template object
      example:
        content: <h1>Invoice</h1><p>This is a sample invoice template</p>
        id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        inserted_at: '2020-01-01T00:00:00Z'
        name: Invoice Template
        preview_context:
          amount: 1000
          customer: Acme Inc.
        updated_at: '2020-01-01T00:00:00Z'
      properties:
        content:
          description: The HTML content of the template
          type: string
        id:
          description: Template ID
          format: uuid
          type: string
        inserted_at:
          description: Creation timestamp
          format: date-time
          type: string
        name:
          description: The name of the template
          type: string
        preview_context:
          description: JSON context for template preview
          type: object
        updated_at:
          description: Update timestamp
          format: date-time
          type: string
      required:
        - id
        - name
        - content
        - inserted_at
        - updated_at
      title: template
      type: object
  securitySchemes:
    authorization:
      description: Manage your API keys at https://vortexpdf.com/api-keys
      scheme: bearer
      type: http

````