Skip to main content
POST
/
api
/
agents
/
{agentId}
/
duplicate
curl -X POST "https://api.zudu.ai/api/agents/agent_123/duplicate" \
  -H "X-API-KEY: sk_Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234Yz" \
  -H "X-API-SECRET: s3cr3t_Xyz789Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234" \
  -d '{
    "agent_name": "Customer Support Agent Copy"
  }'
{
  "message": "Agent duplicated successfully",
  "status": "success",
  "error": null,
  "data": {
    "agent_id": "agent_abc123def456...",
    "agent_name": "Customer Support Agent Copy",
    "organization_id": "org_1234567890",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
Duplicate an existing agent with a new name. All agent configuration, tools, and settings are copied to the new agent.
curl -X POST "https://api.zudu.ai/api/agents/agent_123/duplicate" \
  -H "X-API-KEY: sk_Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234Yz" \
  -H "X-API-SECRET: s3cr3t_Xyz789Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234" \
  -d '{
    "agent_name": "Customer Support Agent Copy"
  }'
{
  "message": "Agent duplicated successfully",
  "status": "success",
  "error": null,
  "data": {
    "agent_id": "agent_abc123def456...",
    "agent_name": "Customer Support Agent Copy",
    "organization_id": "org_1234567890",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }

Path Parameters

agentId
string
required
The ID of the agent to duplicate (format: agent_...)Example: agent_1234567890abcdef

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Request Body

agent_name
string
required
The name for the duplicated agent
  • Maximum length: 50 characters
  • Cannot be empty or whitespace only
  • Will be trimmed automatically
Example: "Customer Support Agent Copy"

Response Fields

agent_id
string
The unique identifier for the newly created agent
agent_name
string
The name of the duplicated agent
organization_id
string
The organization ID the agent belongs to
created_at
string
ISO 8601 timestamp when the agent was created

Error Responses

error
string
Bad Request - Invalid agent name or validation error
{
  "message": "Validation error",
  "status": "error",
  "error": "Agent name cannot be empty"
}
error
string
Unauthorized - Missing or invalid API key/secret
error
string
Not Found - Agent does not exist
{
  "message": "Agent not found",
  "status": "error",
  "error": "Agent with ID 'agent_123' does not exist in organization 'org_1234567890'"
}

Notes

  • The duplicated agent will have a new unique agent_id
  • All agent configuration, tools, webhooks, and settings are copied
  • The new agent is immediately available for use
  • Agent name must be unique within your organization