---
title: "Clone Agent"
method: POST
path: "/core/agents/{id}/clone"
tags: ["Agents"]
---

# Clone Agent

`POST /core/agents/{id}/clone`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/core/agents/{id}/clone`
- Auth: HTTP bearer

Clone an agent's configuration into a brand-new agent.

Copies only the configuration JSON (plus the instruction-builder inputs
that produced it) from one version of the source agent — by default its
latest version, or ``request.version`` when given — into version 1 of a
new agent named ``request.name``. The clone starts unpublished and
undeployed: phone numbers, widgets, SIP endpoints, inbound routing and
conversations all stay with the source, since those bindings are
one-agent-only. Demo plumbing (``is_demo`` and the demo/creation
metadata) is dropped too — the clone is a regular agent.

A failed config copy rolls the new agent back; see ``_roll_back_clone``
for why a shell must not survive.

## Path parameters

- `id` string, required

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- AgentCloneRequest: Schema for API requests to clone an existing agent.
  - `name` string, required
  - `version` integer, nullable

## Response `200`

Successful Response

- Agent: Agent entity representing an agent configuration.
  - `id` string, required
  - `organization_id` string, required
  - `name` string, required
  - `description` string, required
  - `active` boolean, required
  - `is_demo` boolean, required
  - `metadata` object, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, nullable
  - `modified_by` string, nullable
  - `labels` object
  - `feedback_form` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
