Skip to content

Copy a file or directory

POST
/v1/sandbox/{sandboxID}/filesystem/copy

Copy a file or directory from one path to another. Set recursive to true for directories.

sandboxID
required
string

Unique sandbox identifier.

object
src_path
required

Source path.

string
dst_path
required

Destination path.

string
recursive

Copy directory contents recursively.

boolean
overwrite

Overwrite destination if it exists.

boolean

File or directory copied.

Bad request – validation error.

object
message
required

Summary message, e.g. “Invalid request”.

string
errors
required
Array<object>
object
field
required

JSON field name that failed validation (e.g. “path”, “command”).

string
error
required

Human-readable description of the validation failure.

string

Unauthorized – invalid or missing API key.

object
message
required

Human-readable error message.

string

Resource not found.

object
message
required

Human-readable error message.

string

Destination already exists.