Clone an agent
Copies the selected draft, staging, or production version into the mutable draft of a new agent in the same team. Copies the prompt or workflow, models, voice, behavior, and after-call configuration. Shared resources retain their IDs. The new agent starts without deployments, phone assignments, call history, or version history. Its first promotion creates version 1. Requires agents:create and agents:read. Pathway clones require the pathways entitlement.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
id*stringSource agent UUID.
uuidIdempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255If-Match?stringOptional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.
application/json- body
name*stringDisplay name for the copy.
1 <= length <= 200slug*stringUnique routing identifier for the copy.
^[a-z0-9_]+$2 <= length <= 48source*stringVersion to copy. The request fails if the selected version is unavailable.
"draft""staging""production"The new agent.
application/json- response
id*stringuuidslug*stringname*stringmode*"prompt""prompt"draft_version_id*stringuuidrevision*integerInitial aggregate revision. Supply the response ETag rather than constructing one from this number.
int641 <= valueupdated_at*stringdate-timecurl -X POST 'https://api.kejue.co/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/clone' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "Billing_clone", "slug": "billing_clone", "source": "production"}'{ "id": "44444444-4444-4444-8444-444444444444", "slug": "billing_clone", "name": "Billing_clone", "mode": "prompt", "draft_version_id": "55555555-5555-4555-8555-555555555555", "revision": 1, "updated_at": "2026-11-12T09:00:00Z"}