Skip to content

These endpoints duplicate an existing container into a different project or server, and synchronize a previously-copied container with its source. Both operations run asynchronously; the new or target container transitions to running once the background job finishes.

Use copy to provision a working duplicate of a base container, and sync to pull incremental updates from the original after the copy exists.

POST /api/v1/containers/{id}/copy

Creates an asynchronous copy of an existing container. The new container starts automatically on success.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the source container to copy
FieldTypeRequiredDescription
target_project_idstringYesID of the project where the copy will be created
target_server_idstringNoID of the server where the copy will be created (defaults to source server)
namestringNoName for the copied container (auto-generated if not provided)
ssh_public_keystringNoSSH public key for the copied container (must be unique, not inherited from source)
source_snapshotstringNoSpecific snapshot to copy from (copies latest state if not provided)
copy_firewall_rulesbooleanNoWhether to copy firewall rules (ACL) from source container to target container. Default: false
copy_network_rulesbooleanNoWhether to copy network rules/settings from source container to target container. Default: false
Terminal window
curl -X POST "https://api.hoody.icu/api/v1/containers/507f1f77bcf86cd799439011/copy" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"target_project_id": "507f1f77bcf86cd799439033",
"target_server_id": "507f1f77bcf86cd799439044",
"name": "web-app-staging",
"copy_firewall_rules": true,
"copy_network_rules": true
}'

POST /api/v1/containers/{id}/sync

Performs an incremental sync from the source container to this container. Only works for containers that were created via the copy operation. The sync runs asynchronously.

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the container to sync (must have been created via copy)

This endpoint takes no request body.

Terminal window
curl -X POST "https://api.hoody.icu/api/v1/containers/507f1f77bcf86cd799439099/sync" \
-H "Authorization: Bearer <token>"