Skip to main content
POST
/
resources
/
copy
Copy Resources
curl --request POST \
  --url https://api.example.com/resources/copy \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource_ids": [
    "<string>"
  ],
  "tags": [],
  "rewire_dependencies": true,
  "depth": 1,
  "strategy": "stateless"
}
'
{
  "copied": [
    {
      "source_id": "<string>",
      "copied_resource": {
        "provider": "<string>",
        "resource": "<string>",
        "name": "<string>",
        "id": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "updated_at": "2023-11-07T05:31:56Z",
        "config": {},
        "resolved_config": {},
        "dependencies": [],
        "owner_references": [],
        "outputs": {},
        "error": "<string>",
        "lifecycle_state": "draft",
        "health": "healthy",
        "health_message": "<string>",
        "pending_event_id": "<string>",
        "pending_event_type": "<string>",
        "provisioned": false,
        "reconcile_count": 0,
        "version": 0,
        "tags": [
          "<string>"
        ],
        "provider_version": "<string>"
      },
      "error": "<string>"
    }
  ],
  "total": 123,
  "succeeded": 123,
  "failed": 123
}

Body

application/json

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.

resource_ids
string[]
required
Minimum array length: 1
tags
string[]
rewire_dependencies
boolean
default:true
depth
integer | null
Required range: x >= 0
strategy
enum<string>
default:stateless

Strategy 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.

Available options:
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.

copied
CopyResourceResult · object[]
required
total
integer
required
succeeded
integer
required
failed
integer
required