Skip to content

Complete a file upload

$ lightfield file complete
POST/v1/files/{id}/complete

Finalizes an upload after the file bytes have been uploaded.

If an optional md5 hex digest is provided, the server validates the checksum before marking the file as completed.

Required scope: files:create

Rate limit category: Write

ParametersExpand Collapse
--id: string

Unique identifier of the file to complete.

--md5: optional string

Optional MD5 hex digest of the uploaded file for checksum verification.

ReturnsExpand Collapse
file_complete_response: object { id, completedAt, createdAt, 5 more }
id: string

Unique identifier for the file.

completedAt: string

When the file upload was completed.

createdAt: string

When the file upload session was created.

expiresAt: string

When the upload session expires. Null once completed, cancelled, or expired.

filename: string

Original filename.

mimeType: string

MIME type of the file.

sizeBytes: number

File size in bytes.

status: "PENDING" or "COMPLETED" or "CANCELLED" or "EXPIRED"

Current upload status of the file.

"PENDING"
"COMPLETED"
"CANCELLED"
"EXPIRED"

Complete a file upload

lightfield file complete \
  --api-key 'My API Key' \
  --id id
{
  "id": "id",
  "completedAt": "completedAt",
  "createdAt": "createdAt",
  "expiresAt": "expiresAt",
  "filename": "filename",
  "mimeType": "mimeType",
  "sizeBytes": -9007199254740991,
  "status": "PENDING"
}
Returns Examples
{
  "id": "id",
  "completedAt": "completedAt",
  "createdAt": "createdAt",
  "expiresAt": "expiresAt",
  "filename": "filename",
  "mimeType": "mimeType",
  "sizeBytes": -9007199254740991,
  "status": "PENDING"
}