Clone agent

POST/v2/agents/{agentId}/clone

Create a draft copy of an existing agent, with its instructions, settings and optionally its sources, under a new name.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Creates a new agent that starts as a copy of an existing one. Call it to spin up a variant for another brand or language, or to experiment with new instructions without touching the live agent.

Request

POST /v2/agents/{agentId}/clone

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent to copy, starting with agt_.

Body fields:

Name Type Required Description
name string No Name of the copy. Defaults to the original name followed by (copy).
includeSources boolean No Copy the sources of the original too. Defaults to true.

The copy gets a new id, the status draft and the same type, model, instructions, language and settings as the original. The original is not changed. Procedures and actions are copied along with the configuration.

Copied sources are trained again for the new agent. Follow their progress with List sources.

Example request

curl -X POST https://api.askocto.co/v2/agents/agt_8f3k2m/clone \
  -H "Authorization: Bearer $OCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Store support (Dutch)", "includeSources": true }'
const response = await fetch("https://api.askocto.co/v2/agents/agt_8f3k2m/clone", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OCTO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ name: "Store support (Dutch)", includeSources: true }),
})

const copy = await response.json()
console.log(copy.id, copy.status)

Example response

A successful call returns 201 Created with the new agent.

{
  "id": "agt_5r8c3v",
  "name": "Store support (Dutch)",
  "type": "support",
  "status": "draft",
  "model": "octo-balanced",
  "instructions": "Answer questions about orders, shipping and returns.",
  "language": "en",
  "createdAt": "2026-03-21T09:00:00Z",
  "updatedAt": "2026-03-21T09:00:00Z",
  "settings": {
    "visibility": "public",
    "rateLimit": {
      "enabled": true,
      "message": "You are sending messages quickly. Please wait a moment."
    },
    "initialMessages": ["Hi, how can I help?"],
    "suggestedMessages": ["Where is my order?"]
  }
}

Response fields

The response is an agent object, see the Agents overview. Change the copy with Update agent, for example to set language to the new language, and publish it in the dashboard under Settings > Versions when it is ready.

Errors

Status Code When
400 invalid_request name is empty or includeSources is not a boolean.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found No agent has this ID in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Something unclear or missing? Tell us and we will fix the page.