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

# Clone agent

> Copies an agent into a fresh draft (records the source in `template_agent_id`). Scope `sessions:write`.



## OpenAPI

````yaml /api-reference/openapi.json post /agent/{agent_id}/clone
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /agent/{agent_id}/clone:
    post:
      tags:
        - Agents
      summary: Clone agent
      description: >-
        Copies an agent into a fresh draft (records the source in
        `template_agent_id`). Scope `sessions:write`.
      operationId: clone_agent_ca_api_v0_agent__agent_id__clone_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: Optional id for the clone; auto-generated if omitted.
                name:
                  type: string
                  description: Optional name; defaults to the source name with a suffix.
            example:
              name: Sales Agent v2
      responses:
        '201':
          description: Cloned draft agent
          content:
            application/json:
              example:
                id: agent_01CLONE
                name: Sales Agent v2
                channel: voice
                status: draft
                template_agent_id: agent_sales_hi
                published_at: null
                created_at: '2026-05-22T12:00:00Z'
                updated_at: '2026-05-22T12:00:00Z'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````