> ## 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 trigger



## OpenAPI

````yaml /openapi.json post /triggers/{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:
  /triggers/{id}/copy:
    post:
      tags:
        - Triggers
      summary: Create a copy of an existing trigger
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the trigger
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
      responses:
        '200':
          description: The copied `Trigger` object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trigger'
components:
  schemas:
    Trigger:
      type: object
      properties:
        id:
          type: string
          description: The ID of the trigger
        created_at:
          type: string
          description: The time when the trigger was created in ISO 8601 format
        updated_at:
          type: string
          description: The time when the trigger was last updated in ISO 8601 format
        name:
          type: string
          description: The name of the trigger
        project_defined_event:
          type: string
          nullable: true
          description: The ID of the project-defined event that triggers the trigger
        internal_event_definition:
          type: object
          properties:
            type:
              type: string
              enum:
                - customer_created
                - customer_joined_segment
                - customer_birthday
              description: >-
                The type of internal event definition. Must be
                'customer_created', 'customer_joined_segment', or
                'customer_birthday'
            segment:
              type: string
              nullable: true
              description: >-
                The ID of the segment that the customer joined. Can only be
                provided with 'customer_joined_segment'
          required:
            - type
          nullable: true
          description: The internal event definition that triggers the trigger
        trigger:
          type: string
          nullable: true
          description: Deprecated. Will always be null
        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 trigger
        status:
          type: string
          enum:
            - draft
            - active
            - inactive
          description: The status of the trigger. One of "draft", "active", or "inactive"
        filter:
          type: string
          nullable: true
          description: An additional filter that determines if the trigger should be run
        email_address:
          type: string
          nullable: true
          description: >-
            The ID of the email address or project email address associated with
            the trigger. Will be used to send emails as part of this trigger
        phone_number:
          type: string
          nullable: true
          description: >-
            The ID of the phone number or project phone number associated with
            the trigger. Will be used to send SMS messages as part of this
            trigger
        attributed_revenue:
          anyOf:
            - type: number
            - type: string
          nullable: true
          description: The revenue attributed to the trigger
        metadata:
          type: object
          additionalProperties: true
          description: Arbitrary metadata associated with this trigger
        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 trigger. Includes information about customers
            enrolled, email statistics, and custom step statistics
      required:
        - id
        - created_at
        - updated_at
        - name
        - project_defined_event
        - internal_event_definition
        - steps
        - status
        - filter
        - email_address
        - phone_number
        - attributed_revenue
        - metadata
        - statistics
      title: The Trigger object
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````