Agents
Duplicate agent to another organization
Duplicates a SINGLE_PROMPT agent's live active version into a target organization (can also be the same organization). Copies all versioned configuration but strips organization-specific resources: knowledge base tools are removed, default variable values are blanked, and a new avatar is generated. The duplicate starts with a published V1 as its active version.
400 is returned when:
- The source agent is archived ("Cannot duplicate an archived agent")
- The agent has no activeVersionId ("This agent has no active version and cannot be duplicated")
- The active version exists but is not published/active ("This agent has no active published version and cannot be duplicated")
- The agent is not SINGLE_PROMPT workflow type
post/agent/{id}/duplicate
Path parameters
idstring required
The ID of the source agent to duplicate
Request body
Example request
{
"targetOrganizationId": "60d0fe4f5311236168a109ca"
}Response
Agent duplicated successfully
Example response
{
"status": true,
"data": {
"_id": "60d0fe4f5311236168a109cb"
}
}