Copy an entity to a new id
POST /Platform/entities/{entity_type}/{entity_id}/copy
Copy an entity to a new id. The copy lands in the same organization, on the same or another branch.
Fetches the source entity from from_branch and creates a fresh copy
on to_branch. A new id is auto-generated unless new_id is given.
Same-org only -- cross-org copy is not supported.
Use this command when the desired result is a second, independent
entity. For changes to an existing entity, check out a feature branch
and run edit or patch against the existing entity id on that
branch; after testing, promote it with merge-branch.
Same-branch duplication is allowed: pass the same value for
from_branch and to_branch (e.g. both main) to clone an
entity within one branch under a new id.
The source id/commit_id/slug/created_at are stripped
before re-create (the copy gets its own creation time),
so for slug-backed types the copy is routed through create and
receives a BRAND-NEW slug and public URL -- the copy is independently
resolvable and the original's URL is undisturbed.
Lineage is kept in the version DAG: the copy's first commit records
the source's commit as its parent (parent_commits), so
history shows what the copy was made from and three-way tools
(e.g. Workflow.merge_from_catalog) can load that exact base.
Path parameters
entity_type: str. Entity class name.entity_id: str. Source entity id.
Body parameters
to_branch: str. Branch to create the copy on (may equalfrom_branch).from_branch: optional str. Branch to read the source from (defaultmain).new_id: optional str. Optional explicit id for the copy (else auto-generated).sharing: optional "organization" or "private". Who can see and change the copy.organization: everyone in your organization.private: only you, until you share it. Leave it out and the copy follows its source: a copy of a record that only some people can see is private to you, and a copy of a record the whole organization can see is shared, so copying never shows a record to more people unless you ask. A private record works in the background (answering a call, a chat, a scheduled job) only through entry points that you alone control.
Returns
EntityPutResponse
entity_id: optional str or null. Id of the stored entity (the minted slug for slug-backed types).slug: optional str or null. Public slug, for slug-backed types.commit_id: optional str or null. The new commit.canonical_yaml: optional str or null. The YAML as stored, when returned.access: optional EntityAccess or null. Access after the write.ignored_changes: optional List[dict]. Requested fields that were not stored (create): path, reason.
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}/{entity_id}/copy" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'