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

createdAtstring date-time nullable

File upload timestamp

fileHashstring required

SHA-256 hash of the file

fileSizeinteger 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

mimeTypestring required

MIME type of the file

originalFilenamestring required

Original filename as uploaded by user

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

File processing status for user uploaded files

updatedAtstring date-time nullable

File last update timestamp

userIdstring uuid required

ID of the user who owns this file

Example response

{
  "createdAt": "2023-01-01T00:00:00Z",
  "fileHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "fileSize": 1048576,
  "filename": "document.pdf",
  "id": "b8c9d0e1-2345-6789-b234-678901234567",
  "metadata": {
    "height": 1080,
    "width": 1920
  },
  "mimeType": "application/pdf",
  "originalFilename": "My Important Document.pdf",
  "status": "uploaded",
  "updatedAt": "2023-01-01T00:00:00Z",
  "userId": "c9d0e1f2-3456-789a-c345-789012345678"
}

Changes

Changed in 4 of the 28 revisions of this API.6210

    • the endpoint scheme security bearerAuth AND cookieAuth was added to the API

      api-security-added

    • the endpoint scheme security cookieAuth was removed from the API

      api-security-removed

  • 861532a21ad9527See the full diff
    • removed the required property file_hash from the response with the 200 status

      response-required-property-removed

    • removed the required property file_size from the response with the 200 status

      response-required-property-removed

    • removed the required property mime_type from the response with the 200 status

      response-required-property-removed

    • removed the required property original_filename from the response with the 200 status

      response-required-property-removed

    • removed the required property user_id from the response with the 200 status

      response-required-property-removed

    • removed the optional property created_at from the response with the 200 status

      response-optional-property-removed

    • removed the optional property updated_at from the response with the 200 status

      response-optional-property-removed

    • added the optional property createdAt to the response with the 200 status

      response-optional-property-added

    • added the optional property updatedAt to the response with the 200 status

      response-optional-property-added

    • added the required property fileHash to the response with the 200 status

      response-required-property-added

    • added the required property fileSize to the response with the 200 status

      response-required-property-added

    • added the required property mimeType to the response with the 200 status

      response-required-property-added

    • added the required property originalFilename to the response with the 200 status

      response-required-property-added

    • added the required property userId to the response with the 200 status

      response-required-property-added

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 29 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog