Agents

Duplicate agent to another organization

Changed on

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

Request

  • Base URL
    https://api.smallest.ai/atoms/v1
  • URL
    https://api.smallest.ai/atoms/v1/agent/{id}/duplicate
  • Auth
    HTTP bearer

Path parameters

idstring required

The ID of the source agent to duplicate

Request body

targetOrganizationIdstring required

MongoDB ObjectId of the target organization. Must be a 24-character hex string. The authenticated user must be a member of this organization.

Example request

{
  "targetOrganizationId": "60d0fe4f5311236168a109ca"
}

Response

Agent duplicated successfully

statusboolean

Example response

{
  "status": true,
  "data": {
    "_id": "60d0fe4f5311236168a109cb"
  }
}

Changes

    • breaking

      added the pattern ^[a-fA-F0-9]{24}$ to the request property

    • warning

      removed the optional property from the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added