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

# Copy a gallery template

> Copies a gallery or shared template into a workspace and returns where the copy lives. Needs the owner, admin or member role in that workspace; guests get 403 "Sign in to copy a template". Reuse `requestKey` on retries so a repeated request doesn't make a second copy.




## OpenAPI

````yaml /openapi/automations.yaml post /resource-templates/{templateId}/copy
openapi: 3.1.0
info:
  title: Connie Automations API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for automations. They authenticate with
    your signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Workflows
    description: List, create, read, update and delete workflows.
  - name: Runs
    description: >-
      Start, retry and stop workflow runs, switch a workflow Live, and read run
      counts.
  - name: Triggers
    description: A workflow's triggers and its schedule settings.
  - name: Templates
    description: The template gallery and copying a template into a workspace.
  - name: Agents
    description: Agents on the Agents page.
paths:
  /resource-templates/{templateId}/copy:
    post:
      tags:
        - Templates
      summary: Copy a gallery template
      description: >
        Copies a gallery or shared template into a workspace and returns where
        the copy lives. Needs the owner, admin or member role in that workspace;
        guests get 403 "Sign in to copy a template". Reuse `requestKey` on
        retries so a repeated request doesn't make a second copy.
      operationId: copyGalleryTemplate
      parameters:
        - $ref: '#/components/parameters/templateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workspaceId
                - requestKey
                - revision
              properties:
                workspaceId:
                  type: string
                  format: uuid
                  description: The workspace to copy into.
                requestKey:
                  type: string
                  minLength: 1
                  maxLength: 200
                revision:
                  type: integer
                  description: >-
                    The `revision` you previewed. If the template changed since,
                    you get 409 `TEMPLATE_REVISION_CONFLICT`.
                name:
                  type: string
                  maxLength: 160
                token:
                  type: string
                  description: >-
                    The share-link token, for a template that isn't in the
                    gallery.
                targetObjectId:
                  type: string
                  format: uuid
                  description: Records templates only. Copy into this existing object.
                columnMapping:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Records templates only. Maps template columns to existing
                    columns or `new`.
      responses:
        '201':
          description: The copy.
          content:
            application/json:
              schema:
                type: object
                properties:
                  resourceId:
                    type: string
                    format: uuid
                  name:
                    type: string
                  replayed:
                    type: boolean
                  url:
                    type: string
                    description: App path of the copy.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    templateId:
      name: templateId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: The request is invalid (code `VALIDATION_ERROR`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Not signed in (`UNAUTHORIZED`), or the session cookie has expired
        (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        You aren't a member of the workspace, or don't have the access this
        needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found, or not visible to you.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The resource changed since you read it, or the request conflicts with
        its current state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Too many requests (`RATE_LIMIT_EXCEEDED`). Wait for the `Retry-After`
        header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Machine-readable code, when there is one.
        details:
          description: Extra detail, for example the invalid fields.
      required:
        - error
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.