Skip to content

Open an import

POST
/drives/{drive}/imports
curl --request POST \
--url https://work.optidata.cloud/api/drives/1/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "origin_path": "D:\\Archive\\2025", "destination_node_id": 300754, "total_folders_count": 59, "total_files_count": 82, "total_byte_size": 20481923, "status": "waiting_start" }'

Registers a new import with the totals it expects to transfer. The destination folder must exist. Report progress afterwards with PATCH /drives/{drive}/imports/{import}.

drive
required
integer format: int64

Numeric id of the drive. Read it from GET /drives/config.json.

Media typeapplication/json
object
origin_path
required

Path of the tree on the source system.

string
destination_node_id
required
integer format: int64
total_folders_count
required
integer
total_files_count
required
integer
total_byte_size
required
integer format: int64
status
required
string
Allowed values: waiting_start running finished
Examples
Exampleopen
{
"origin_path": "D:\\Archive\\2025",
"destination_node_id": 300754,
"total_folders_count": 59,
"total_files_count": 82,
"total_byte_size": 20481923,
"status": "waiting_start"
}

The created import.

Media typeapplication/json

Progress bookkeeping for a bulk import of an external file tree.

object
id
integer format: int64
drive_id
integer format: int64
destination_node_id
integer format: int64
origin_path

Path of the imported tree on the source system.

string
status
string
Allowed values: waiting_start running finished
total_folders_count
integer
total_files_count
integer
total_byte_size
integer format: int64
sent_folders_count
integer | null
sent_files_count
integer | null
sent_byte_size
integer | null format: int64
last_processing
string | null format: date-time
uuid
string
cuid
string
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"origin_path": "D:\\Archive\\2025",
"status": "waiting_start"
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The resource does not exist, or does not belong to the given drive.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Node] 99999999"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}