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

# Copy Campaign Template to a Project

> Copies a campaign template to another project.

The resources, like validation rules or products, will not be copied to the destination project yet. When the template is used to create a new campaign or add a new promotion tier, the resources will be created in the destination project.

> 📘 Campaign Templates – Documentation
>
>Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.



## OpenAPI

````yaml /openapi/management.json post /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy
openapi: 3.0.1
info:
  title: Voucherify API - Management
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterProjectId'
        in: path
        name: projectId
        description: Provide the unique identifier of the project.
        required: true
      - schema:
          $ref: '#/components/schemas/ParameterCampaignTemplateId'
        in: path
        name: campaignTemplateId
        description: Provide the unique identifier of the campaign template.
        required: true
    post:
      tags:
        - Management
      summary: Copy Campaign Template to a Project
      description: >-
        Copies a campaign template to another project.


        The resources, like validation rules or products, will not be copied to
        the destination project yet. When the template is used to create a new
        campaign or add a new promotion tier, the resources will be created in
        the destination project.


        > 📘 Campaign Templates – Documentation

        >

        >Read the [Campaign Templates documentation](/build/campaign-templates)
        to learn more about this feature.
      operationId: management-copy-campaign-template
      parameters: []
      requestBody:
        description: >-
          Determines the details about the template in the destination project
          as well as the destination project itself.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ManagementProjectsTemplatesCampaignsCopyCreateRequestBody
        required: true
      responses:
        '200':
          description: Returns the details about the copied campaign template.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ManagementProjectsTemplatesCampaignsCopyCreateResponseBody
              examples:
                Example:
                  value:
                    id: camp_tpl_0f7e3ac98f04d00ab9
                    name: Item_Discount_Campaign_Template
                    description: To be reused in the future
                    campaign_type: DISCOUNT_COUPONS
                    created_at: '2024-10-09T15:52:45.414Z'
                    object: campaign_template
        '401':
          description: Returns an error if an invalid token was provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Unauthorized:
                  value:
                    code: 401
                    message: Unauthorized
                    key: unauthorized
        '402':
          description: >-
            Returns an error if the current plan does not include the Management
            API feature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorPaymentRequired'
              examples:
                Example:
                  value:
                    code: 402
                    message: Payment required
                    details: >-
                      Your current plan does not include a feature required to
                      perform this operation.
                    key: missing_required_feature
        '404':
          description: Returns an error when a resource could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Resource not found:
                  value:
                    code: 404
                    message: Resource not found
                    details: Cannot find project with id proj_5itvDU7
        '409':
          description: >-
            Returns an error if a campaign template with the same name already
            exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Duplicate:
                  value:
                    code: 409
                    message: Duplicated resource found
                    details: >-
                      Duplicated campaign_template exists with name Template
                      copy
      security:
        - X-Management-Id: []
          X-Management-Token: []
components:
  schemas:
    ParameterProjectId:
      type: string
      example: proj_TrlkLiH4
    ParameterCampaignTemplateId:
      type: string
      example: camp_tpl_zLtn2H9fgcG3NwO7t4PAfHcq
    ManagementProjectsTemplatesCampaignsCopyCreateRequestBody:
      type: object
      title: Management Templates Campaign Copy Template Request Body
      description: >-
        Response body schema for **POST**
        `/management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy`.
      allOf:
        - $ref: '#/components/schemas/TemplatesCampaignsNameDescription'
        - type: object
          properties:
            destination_project_id:
              type: string
              description: >-
                Unique identifier of the project to which the campaign template
                will be copied.
      required:
        - name
        - destination_project_id
    ManagementProjectsTemplatesCampaignsCopyCreateResponseBody:
      type: object
      title: Management Templates Campaign Template Copy Response Body
      description: >-
        Response body schema for **POST**
        `/management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy`.
      allOf:
        - $ref: '#/components/schemas/CampaignTemplateBase'
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
    ErrorPaymentRequired:
      title: Payment Required Error
      type: object
      description: 'Error: Payment required - the current plan does not include the feature.'
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
      required:
        - code
        - message
        - details
        - key
    TemplatesCampaignsNameDescription:
      type: object
      title: Update Campaign Template Request
      description: Request body for updating a campaign template.
      properties:
        name:
          type: string
          description: User-defined name of the campaign template. It must be unique.
        description:
          type: string
          nullable: true
          description: User-defined description of the campaign template.
    CampaignTemplateBase:
      type: object
      title: Campaign Template Base
      description: Stores details about a campaign template.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of the campaign template. It is assigned by
            Voucherify.
          example: camp_tpl_eR9NsNJ5gqJRN2TG3fqCvbVl
        name:
          type: string
          description: User-defined name of the campaign template.
        description:
          type: string
          description: User-defined description of the campaign template.
        campaign_type:
          type: string
          description: >-
            Type of the campaign used to create the campaign template. Templates
            created from a promotion tier are converted to `DISCOUNT_COUPONS`.
          enum:
            - DISCOUNT_COUPONS
            - GIFT_VOUCHERS
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the campaign template
            was created. The value is shown in the ISO 8601 format.
          example: '2024-07-16T09:05:53.175Z'
        object:
          type: string
          description: The type of the object represented by JSON.
          enum:
            - campaign_template
      required:
        - id
        - name
        - campaign_type
        - created_at
        - object
  securitySchemes:
    X-Management-Id:
      type: apiKey
      name: X-Management-Id
      in: header
    X-Management-Token:
      type: apiKey
      name: X-Management-Token
      in: header

````