v48

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-275867561.6 MB
agents

Clone an agent

Creates a new agent that mirrors the source agent's behaviour but is owned by the calling identity. Creation is atomic — the clone is either fully created or no state is persisted.

What is copied from the source:

  • description
  • runtime (model configuration)
  • backend (backend type + sandbox configuration)
  • system_prompt, tools, subagents, skills
  • any leftover files outside the typed fields above (e.g. docs/README.md attached via the escape files field)

What the caller can override (sent in the request body):

  • name — defaults to "<source name> (Copy)"
  • permissions — defaults to the source's identity with visibility=user and tenant_access_level=read. When supplied the object fully replaces the default; PATCH-style merging does not apply.

What is always reset for the clone (you cannot override these):

  • agent ID, agent version, owner, timestamps
  • stamped user context (user_email, user_name, user_timezone — taken from the calling identity + the X-User-Timezone header)

What is never copied (start fresh on the clone):

  • extras (caller-defined metadata bag, e.g. icon customisations, template IDs)
  • caller-defined configurable bag entries
  • sharing state, tokens, triggers, and schedules

Cloning a built-in system template returns 422.

post/v1/fleet/agents/{agent_id}/clone

Path parameters

agent_idstring uuid required

Source agent ID

Query parameters

include_filesboolean

Echo the new agent's file tree in the response

Request body

namestring

Example request

{
  "name": "Researcher (Copy)"
}

Response

Created

access_level'READ' | 'RUN' | 'WRITE'
created_atstring date-time
descriptionstring
extrasobject
filesobject

Raw file map. Returned only when include_files=true.

idstring uuid
instructionsstring

Deprecated: use system_prompt. Echoed alongside system_prompt with the same value for backwards compatibility.

is_ownerboolean
namestring
owner_idstring uuid
revisionstring
system_promptstring

Agent system prompt parsed from AGENTS.md.

updated_atstring date-time

Example response

{
  "backend": {
    "sandbox": {
      "delete_after_stop_seconds": 1200,
      "idle_ttl_seconds": 600,
      "snapshot_id": "550e8400-e29b-41d4-a716-446655440000"
    },
    "type": "thread_scoped_sandbox"
  },
  "runtime": {
    "model": {
      "model_id": "claude-sonnet-4-6"
    }
  },
  "skills": [
    {
      "description": "Summarise text into a paragraph.",
      "instructions": "# Summarize\n\nGiven a text, produce a one-paragraph summary.",
      "name": "summarize",
      "type": "inline"
    }
  ],
  "subagents": [
    {
      "description": "Researches a topic and summarises findings.",
      "instructions": "You are a research assistant. Use the available tools to gather information.",
      "model_id": "claude-sonnet-4-6",
      "name": "researcher",
      "tools": {
        "tools": [
          {
            "display_name": "read_url_content",
            "mcp_server_name": "Fleet",
            "mcp_server_url": "https://tools.example.com",
            "name": "read_url_content"
          }
        ]
      }
    }
  ],
  "tools": {
    "tools": [
      {
        "display_name": "read_url_content",
        "mcp_server_name": "Fleet",
        "mcp_server_url": "https://tools.example.com",
        "name": "read_url_content"
      }
    ]
  }
}