## Complete a file upload `file.complete(strid, FileCompleteParams**kwargs) -> FileCompleteResponse` **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](/using-the-api/scopes/):** `files:create` **[Rate limit category](/using-the-api/rate-limits/):** Write ### Parameters - `id: str` Unique identifier of the file to complete. - `md5: Optional[str]` Optional MD5 hex digest of the uploaded file for checksum verification. ### Returns - `class FileCompleteResponse: …` - `id: str` Unique identifier for the file. - `completed_at: Optional[str]` When the file upload was completed. - `created_at: str` When the file upload session was created. - `expires_at: Optional[str]` When the upload session expires. Null once completed, cancelled, or expired. - `filename: str` Original filename. - `mime_type: str` MIME type of the file. - `size_bytes: int` File size in bytes. - `status: Literal["PENDING", "COMPLETED", "CANCELLED", "EXPIRED"]` Current upload status of the file. - `"PENDING"` - `"COMPLETED"` - `"CANCELLED"` - `"EXPIRED"` ### Example ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) file_complete_response = client.file.complete( id="id", ) print(file_complete_response.id) ``` #### Response ```json { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ```