Skip to content

Upload one chunk of a replacement

POST
/drives/{drive}/nodes/{node}/chunk/contents/{content}/upload
curl --request POST \
--url https://work.optidata.cloud/api/drives/1/nodes/300754/chunk/contents/613488/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form chunkData=example \
--form chunkNumber=1 \
--form chunkHash=example \
--form asBase64=true \
--form name=example

Sends a single chunk into the content version opened by POST /drives/{drive}/nodes/{node}/chunk/prepare. Requires permission to update the node’s content.

drive
required
integer format: int64

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

node
required
integer format: int64

Numeric id of the node (file or folder).

content
required
integer format: int64

Numeric id of a stored content version of the file. Version ids come from the node history or from the chunked-update prepare step.

One chunk of a replacement of an existing file’s content.

object
chunkData
required

The chunk itself — raw bytes as a multipart part, or base64 when asBase64 is set.

string
chunkNumber
required

Position of this chunk, counting from 1.

integer
>= 1
chunkHash

SHA-256 of the chunk, for verification on arrival.

string | null
asBase64

Set when chunkData is base64 encoded.

boolean | null
name

Original file name, kept for diagnostics.

string | null

The chunk was stored.

Media typeapplication/json
object
key
additional properties
any
Examplegenerated
{}

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 caller lacks the permission level the operation requires.

Media typeapplication/json

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

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

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."
}