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

# Duplicate flow

> Create a copy of an existing flow with a new name.



## OpenAPI

````yaml /openapi.json post /v1/senders/{senderId}/agent/flows/{flowId}/duplicate
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/senders/{senderId}/agent/flows/{flowId}/duplicate:
    post:
      tags:
        - Agent Flows
      summary: Duplicate flow
      description: Create a copy of an existing flow with a new name.
      operationId: duplicateAgentFlow
      parameters:
        - $ref: '#/components/parameters/SenderIdParam'
        - $ref: '#/components/parameters/FlowIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlowDuplicateRequest'
            example:
              newName: Lead Capture (Copy)
      responses:
        '201':
          description: Flow duplicated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Flow not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    SenderIdParam:
      name: senderId
      in: path
      required: true
      schema:
        type: string
    FlowIdParam:
      name: flowId
      in: path
      required: true
      schema:
        type: string
  schemas:
    FlowDuplicateRequest:
      type: object
      required:
        - newName
      properties:
        newName:
          type: string
          maxLength: 100
    FlowResponse:
      type: object
      required:
        - flow
      properties:
        flow:
          $ref: '#/components/schemas/AgentFlow'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    AgentFlow:
      type: object
      required:
        - id
        - agentId
        - name
        - trigger
        - steps
        - enabled
        - priority
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        agentId:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        trigger:
          $ref: '#/components/schemas/FlowTrigger'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/FlowStep'
        enabled:
          type: boolean
        priority:
          type: integer
          description: Priority when multiple flows match (higher = more priority).
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FlowTrigger:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/FlowTriggerType'
        keywords:
          type: array
          items:
            type: string
          description: Keywords that trigger the flow (for keyword type).
        intent:
          type: string
          description: Intent that triggers the flow (for intent type).
    FlowStep:
      type: object
      required:
        - id
        - type
        - config
      properties:
        id:
          type: string
          description: Unique step identifier.
        type:
          $ref: '#/components/schemas/FlowStepType'
        config:
          type: object
          description: Step configuration (varies by type).
          additionalProperties: true
        nextStepId:
          type: string
          description: ID of the next step to execute.
          nullable: true
    FlowTriggerType:
      type: string
      description: Type of trigger for a flow.
      enum:
        - keyword
        - intent
        - always
        - manual
    FlowStepType:
      type: string
      description: Type of flow step.
      enum:
        - message
        - collect
        - condition
        - tool
        - llm
        - transfer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````