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

# Clone Agent

> Copy an agent into a new unpublished agent in the same workspace, with the
source's draft configuration.



## OpenAPI

````yaml post /v1/agent/agents/{agent_id}/clone
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/agents/{agent_id}/clone:
    post:
      tags:
        - Agents
      summary: Clone Agent
      description: >-
        Copy an agent into a new draft agent in the same workspace. The body is

        optional: `name` (1 to 120 characters, like Create Agent) names the
        copy;

        other fields are rejected with 422. Without a name the copy is named

        `<name> copy`, with the source name cut to 115 characters so the name
        stays

        within 120 and still ends in ` copy`; if that would be identical to the

        source's own name, the copy is named `<name> copy 2` (cut the same way).

        The copy keeps the source's

        description. It takes the source's draft configuration (including

        secrets, tools, integration connections and the data retention setting)

        and any workspace knowledge sources. It starts unpublished: publish it

        before creating sessions with it. Public access, allowed origins and

        session overrides start at their defaults.


        Not copied: the version history, agent-private knowledge sources, phone

        numbers and tests. An archived source agent is a 404. Rename the copy
        with

        `PATCH /v1/agent/agents/{agent_id}`.
      parameters:
        - in: path
          name: agent_id
          description: ''
          required: true
          schema:
            title: Agent Id
            type: string
          deprecated: false
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                  description: >-
                    Name of the copy. Omitted, the copy is named `<source name>
                    copy`.
      responses:
        '201':
          description: Document created, URL follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  agent_id:
                    title: Agent Id
                    type: string
                  workspace_id:
                    title: Workspace Id
                    type: string
                  name:
                    title: Name
                    type: string
                  description:
                    default: ''
                    title: Description
                    type: string
                  status:
                    enum:
                      - active
                      - archived
                    title: Status
                    type: string
                  publication_state:
                    description: >-
                      `live` once at least one version is published; `draft`
                      agents cannot take sessions yet.
                    enum:
                      - live
                      - draft
                    title: Publication State
                    type: string
                  public_enabled:
                    default: false
                    title: Public Enabled
                    type: boolean
                  allowed_origins:
                    items:
                      type: string
                    title: Allowed Origins
                    type: array
                  restrict_origins:
                    default: false
                    description: >-
                      Whether public access is limited to `allowed_origins`.
                      When false, any origin can start a public session.
                    title: Restrict Origins
                    type: boolean
                  overrides_allowed:
                    items:
                      enum:
                        - first_message
                        - system_prompt
                        - voice_id
                        - language
                        - asr.model
                        - llm.fallback
                      type: string
                    title: Overrides Allowed
                    type: array
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                required:
                  - agent_id
                  - workspace_id
                  - name
                  - status
                  - publication_state
                  - created_at
                  - updated_at
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: bash
          label: Clone Agent
          source: |-
            curl --request POST \
              --url https://api.fish.audio/v1/agent/agents/<agent-id>/clone \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{"name": "Aria (Spanish)"}'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.