Copy Resources
Copy a subgraph of resources within the current project.
Selects all resources reachable from the given root IDs via dependency edges, then creates a copy of each. Copies are created in DRAFT state with a COPY event dispatched to the provider for actual duplication.
Dependency rewiring (enabled by default) ensures that dependencies between copied resources point to their copies instead of originals. Dependencies on resources outside the copied subgraph remain unchanged.
Same-project copy is the only supported mode. Every root id must already encode the URL project, and every traversed node must live inside the same project; cross-project copy is rejected at the engine layer and is not a planned feature.
Returns: CopyResponse with per-resource results and summary counts.
Raises: InvalidResourceIdentityError: If any root resource_id is malformed or belongs to a different project than the URL. ProjectMismatchError: If the engine discovers a traversed resource that escapes the URL project.
Documentation Index
Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
Use this file to discover all available pages before exploring further.
Path Parameters
Body
Request body for the subgraph copy operation.
Attributes: resource_ids: SurrealDB resource IDs to copy (roots of the subgraph). tags: Tags to apply to all copied resources. rewire_dependencies: If True, rewrite dependencies between copied resources to point to their copies instead of the originals. depth: Maximum traversal depth from roots. None means unlimited. strategy: Default copy strategy for resources that do not specify one.
1x >= 0Strategy for how a resource should be copied.
Attributes: STATELESS: Config-only copy. The resource is duplicated by creating a new instance with the same (or modified) configuration. No data migration. STATEFUL: Data-bearing copy. The resource needs to clone underlying data (e.g., database contents, vector indices) and may produce patches for ongoing synchronization.
stateless, stateful Response
Successful Response
Response body for the subgraph copy operation.
Attributes: copied: List of per-resource copy results. total: Total resources in the selected subgraph. succeeded: Number of resources successfully copied. failed: Number of resources that failed to copy.