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

# Create a copy of an existing campaign



## OpenAPI

````yaml /openapi.json post /campaigns/{id}/copy
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /campaigns/{id}/copy:
    post:
      tags:
        - Campaigns
      summary: Create a copy of an existing campaign
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the campaign
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
      responses:
        '200':
          description: The copied `Campaign` object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
components:
  schemas:
    Campaign:
      type: object
      properties:
        id:
          type: string
          description: The ID of the campaign
        created_at:
          type: string
          description: The time when the campaign was created in ISO 8601 format
        updated_at:
          type: string
          description: The time when the campaign was last updated in ISO 8601 format
        business:
          type: string
          nullable: true
          description: The ID of the business
        name:
          type: string
          description: The name of the campaign
        enrolled_customers:
          type: array
          items:
            type: string
          description: The customers enrolled in the campaign
        enrolled_customer_ids:
          type: array
          items:
            type: string
          description: The IDs of the customers enrolled in the campaign
        segment:
          type: string
          nullable: true
          description: The segment attached to the campaign
        steps:
          type: array
          items:
            anyOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - email
                    description: The step type. Always "email" for this step
                  custom_step_id:
                    type: string
                    description: >-
                      Optional. The ID of the custom step to use in this step.
                      The type of the custom step must be "email" as well
                  email_template_id:
                    type: string
                    description: The ID of the email template to use in this step
                required:
                  - type
                  - email_template_id
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - email
                    description: The step type. Always "email" for this step
                  custom_step_id:
                    type: string
                    description: >-
                      Optional. The ID of the custom step to use in this step.
                      The type of the custom step must be "email" as well
                  subject:
                    type: string
                    description: The subject of the email template to use at this step
                  body:
                    type: string
                    description: The body of the email template to use at this step
                required:
                  - type
                  - subject
                  - body
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - sms
                    description: The step type. Always "sms" for this step
                  custom_step_id:
                    type: string
                    description: >-
                      Optional. The ID of the custom step to use in this step.
                      The type of the custom step must be "sms" as well
                  sms_template_id:
                    type: string
                    description: The ID of the SMS template to use in this step
                required:
                  - type
                  - sms_template_id
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - sms
                    description: The step type. Always "sms" for this step
                  custom_step_id:
                    type: string
                    description: >-
                      Optional. The ID of the custom step to use in this step.
                      The type of the custom step must be "sms" as well
                  message:
                    type: string
                    description: The message to send in this step
                required:
                  - type
                  - message
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - wait
                    description: The step type. Always "wait" for this step
                  duration:
                    type: integer
                    description: The number of seconds to wait
                required:
                  - type
                  - duration
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - if
                    description: The step type. Always "if" for this step
                  filter:
                    type: string
                    description: The filter to use in this step
                required:
                  - type
                  - filter
          description: The steps of the campaign
        email_address:
          type: string
          nullable: true
          description: >-
            The email address used to send emails in the campaign. Will be the
            ID of an email-like object
        phone_number:
          type: string
          nullable: true
          description: >-
            The phone number used to send SMS messages in the campaign. Will be
            the ID of a phone number-like object
        status:
          type: string
          enum:
            - draft
            - scheduled
            - started
            - stopped
            - finished
          description: The status of the campaign.
        scheduled_at:
          type: string
          nullable: true
          description: The time when the campaign is scheduled to start in ISO 8601 format
        scheduled_end_at:
          type: string
          nullable: true
          description: The time when the campaign is scheduled to end in ISO 8601 format
        statistics:
          type: object
          properties:
            total_customers_enrolled:
              type: integer
              description: The number of customers enrolled in the campaign or trigger
            total_customers_started:
              type: integer
              description: The number of customers who have started receiving messages
            total_customers_finished:
              type: integer
              description: >-
                The number of customers who have finished receiving all the
                messages
            emails:
              type: object
              properties:
                sent:
                  type: integer
                  description: The number of emails sent
                delivered:
                  type: integer
                  description: The number of emails delivered
                opened:
                  type: integer
                  description: The number of emails opened
                soft_bounced:
                  type: integer
                  description: The number of emails that soft bounced
                hard_bounced:
                  type: integer
                  description: The number of emails that hard bounced
                spam_reported:
                  type: integer
                  description: The number of emails reported as spam
                clicked:
                  type: integer
                  nullable: true
                  description: The number of emails clicked (null if tracking not enabled)
              required:
                - sent
                - delivered
                - opened
                - soft_bounced
                - hard_bounced
                - spam_reported
                - clicked
              description: >-
                Email statistics including sent, delivered, opened, bounced, and
                clicked counts
            custom_steps:
              type: array
              items:
                type: object
                properties:
                  custom_step:
                    type: string
                    description: The ID of the custom step
                  sent:
                    type: integer
                    description: The number of times this custom step was sent
                required:
                  - custom_step
                  - sent
              description: Statistics for custom steps
            executions:
              type: object
              properties:
                total:
                  type: integer
                  description: Total number of executions
                pending:
                  type: integer
                  description: Number of pending executions
                started:
                  type: integer
                  description: Number of started executions
                finished:
                  type: integer
                  description: Number of finished executions
                errored:
                  type: integer
                  description: Number of errored executions
              required:
                - total
                - pending
                - started
                - finished
                - errored
              description: Execution statistics
            sms:
              type: object
              properties:
                sms_sent_count:
                  type: integer
                  description: The number of SMS messages sent
                sms_sent_segments_count:
                  type: integer
                  description: The number of SMS messages segments
                mms_sent_count:
                  type: integer
                  description: The number of MMS messages sent
                mms_sent_segments_count:
                  type: integer
                  description: The number of MMS messages segments
              required:
                - sms_sent_count
                - sms_sent_segments_count
                - mms_sent_count
                - mms_sent_segments_count
              description: SMS statistics
          required:
            - emails
            - custom_steps
            - executions
            - sms
          description: >-
            The statistics of the campaign. Includes information about customers
            enrolled, email statistics, and custom step statistics
        consumed_message_segments:
          type: object
          properties:
            sms:
              type: integer
              description: The number of SMS segments
            mms:
              type: integer
              description: The number of MMS segments
            email:
              type: integer
              description: The number of email segments
          required:
            - sms
            - mms
            - email
          description: The number of message segments actually used by the campaign
        estimated_message_segments:
          type: object
          properties:
            sms:
              type: integer
              description: The number of SMS segments
            mms:
              type: integer
              description: The number of MMS segments
            email:
              type: integer
              description: The number of email segments
          required:
            - sms
            - mms
            - email
          description: The number of message segments estimated to be used by the campaign
        attributed_revenue:
          type: string
          nullable: true
          description: The revenue attributed to the campaign
        metadata:
          type: object
          additionalProperties: true
          description: Arbitrary metadata associated with this campaign
      required:
        - id
        - created_at
        - updated_at
        - business
        - name
        - segment
        - steps
        - email_address
        - phone_number
        - status
        - scheduled_at
        - scheduled_end_at
        - statistics
        - consumed_message_segments
        - attributed_revenue
        - metadata
      title: The Campaign object
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````