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

# Duplicate template

> Creates a copy of the Google Doc template associated with an automation. The new template is saved to your Google Drive.



## OpenAPI

````yaml /openapi.json post /duplicateGoogleDocTemplate
openapi: 3.1.0
info:
  title: DocsAutomator API
  version: '2.0'
  description: >-
    REST API for programmatic document generation, automation management, and
    e-signature workflows.
  contact:
    name: DocsAutomator Support
    email: support@docsautomator.co
    url: https://docsautomator.co
servers:
  - url: https://api.docsautomator.co
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Documents
    description: Create documents and manage async jobs
  - name: Automations
    description: CRUD operations for automations
  - name: Templates
    description: Template placeholders and duplication
  - name: E-Signatures
    description: Manage signing sessions, links, and audit trails
  - name: Email
    description: Test email delivery
paths:
  /duplicateGoogleDocTemplate:
    post:
      tags:
        - Templates
      summary: Duplicate template
      description: >-
        Creates a copy of the Google Doc template associated with an automation.
        The new template is saved to your Google Drive.
      operationId: duplicateTemplate
      parameters:
        - name: automationId
          in: query
          required: true
          schema:
            type: string
          description: The automation ID.
        - name: newTemplateName
          in: query
          required: false
          schema:
            type: string
          description: >-
            Custom name for the duplicated template. Defaults to the automation
            title.
      responses:
        '200':
          description: Template duplicated
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Google Doc template duplicated successfully
                  newTemplateId:
                    type: string
                    description: Google Doc ID of the new template.
                  url:
                    type: string
                    format: uri
                    description: URL to edit the new template.
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Missing required parameter
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not found
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from your workspace settings. Pass as `Authorization: Bearer
        <key>` or `X-API-Key: <key>`. Find it at
        [app.docsautomator.co/settings/workspace/api](https://app.docsautomator.co/settings/workspace/api).

````