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_PROMPTworkflow type
Authentication
AuthorizationBearer
API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.
Path parameters
id
The ID of the source agent to duplicate
Request
This endpoint expects an object.
targetOrganizationId
24-character hex id of the target organization. The authenticated user must be a member of this organization.
Response
Agent duplicated successfully
status
data
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error