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

# Update Templates

> Updates a specific template by ID



## OpenAPI

````yaml PUT /templates/{id}
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: http://base.url.com
security:
  - apiKey: []
paths:
  /templates/{id}:
    put:
      description: Updates a specific template by ID
      operationId: updateTemplates
      requestBody:
        description: Updated details of the template
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatedEmailTemplate'
      responses:
        '200':
          description: Template updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: You do not have permission to access this resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
components:
  schemas:
    UpdatedEmailTemplate:
      type: object
      required:
        - name
        - subject
        - text
        - html
        - attachment_name
        - attachmentInBody
        - attachmentRedirectToPhished
        - is_check_clicked_link
        - is_check_submitted_data
        - is_check_file_downloaded
        - is_check_file_executed
      properties:
        name:
          type: string
          description: Name of the email template
        subject:
          type: string
          description: Subject line of the email template
        text:
          type: string
          description: Plain text version of the email content
        html:
          type: string
          description: HTML content of the email, can include MJML or standard HTML
          format: html
        attachment_name:
          type: string
          description: Name of the file to be attached
        attachmentInBody:
          type: boolean
          description: Flag to include the attachment directly in the email body
        attachmentRedirectToPhished:
          type: boolean
          description: Flag to redirect the attachment to a phishing site upon opening
        is_check_clicked_link:
          type: boolean
          description: Flag to track if links within the email have been clicked
        is_check_submitted_data:
          type: boolean
          description: Flag to track if data was submitted by the recipient
        is_check_file_downloaded:
          type: boolean
          description: Flag to track if any attached file has been downloaded
        is_check_file_executed:
          type: boolean
          description: >-
            Flag to track if any executable file attached has been run by the
            recipient
    Template:
      type: object
      required:
        - id
        - name
        - content
      properties:
        id:
          type: string
          description: Unique identifier for the template
        name:
          type: string
          description: Name of the template
        content:
          type: string
          description: HTML content of the template
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    ForbiddenError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code representing the type of error
          example: 403
        message:
          type: string
          description: A message describing the error
          example: You do not have permission to access this resource.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-phishy-api-key

````