Files

Update file metadata and properties

Errors

Returns an error if validation fails, file not found, or database operations fail.

put/api/files/{file_id}

Path parameters

file_idstring uuid required

UUID of the file to update metadata for

Request body

filenamestring nullable

New filename (optional)

metadataValue

Flexible JSON value that can be an object, array, string, number, boolean, or null

status'uploaded' | 'processing' | 'processed' | 'failed' | 'deleted'

File processing status for user uploaded files

Example request

{
  "filename": "renamed_document.pdf",
  "metadata": {
    "processed_at": "2023-01-01T12:00:00Z"
  },
  "status": "processed"
}

Response

File metadata updated successfully

created_atstring date-time nullable

File upload timestamp

file_hashstring required

SHA-256 hash of the file

file_sizeinteger required

Size of the file in bytes

filenamestring required

Current filename

idstring uuid required

File's unique identifier

metadataValue

Flexible JSON value that can be an object, array, string, number, boolean, or null

mime_typestring required

MIME type of the file

original_filenamestring required

Original filename as uploaded by user

status'uploaded' | 'processing' | 'processed' | 'failed' | 'deleted' required

File processing status for user uploaded files

updated_atstring date-time nullable

File last update timestamp

user_idstring uuid required

ID of the user who owns this file

Example response

{
  "created_at": "2023-01-01T00:00:00Z",
  "file_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "file_size": 1048576,
  "filename": "document.pdf",
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "metadata": {
    "height": 1080,
    "width": 1920
  },
  "mime_type": "application/pdf",
  "original_filename": "My Important Document.pdf",
  "status": "uploaded",
  "updated_at": "2023-01-01T00:00:00Z",
  "user_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}

Changes