Copy folders and files in the background
const url = 'https://work.optidata.cloud/api/drives/1/recursiveCopy/nodes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"from_node_ids":[665198,665199],"to_node_id":300754}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://work.optidata.cloud/api/drives/1/recursiveCopy/nodes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "from_node_ids": [ 665198, 665199 ], "to_node_id": 300754 }'Queues a recursive copy of from_node_ids into to_node_id and returns
the request record immediately — the copy itself runs in the background.
Unlike copy-to, this handles folders and their whole subtree.
Every source is checked before the job is queued: a trashed source, a source the caller cannot edit, a destination the caller cannot write to, or a folder being copied into itself, all fail up front.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Numeric id of the drive. Read it from GET /drives/config.json.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Nodes to copy.
Destination folder.
Examples
{ "from_node_ids": [ 665198, 665199 ], "to_node_id": 300754}Responses
Section titled “ Responses ”The queued copy request.
object
object
JSON-encoded array of the source ids.
Examplegenerated
{ "copyRequest": { "id": 1, "from_node_ids": "example", "to_node_id": 1, "user_id": 1, "canceled_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z" }}A source or the destination is not copyable.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Cannot copy this folder into itself"}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller lacks the permission level the operation requires.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The resource does not exist, or does not belong to the given drive.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Node] 99999999"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}