v1

latestOpenAPI 3.0.0Apache License 2.02026-07-17141040.5 KB
files

Replace file

Replace an existing file with new content while preserving the file ID. The operation follows these steps:

  1. The isUploaded flag is set to false to mark the file as being updated
  2. The file content is replaced in the storage backend
  3. File metadata is updated (size, mime-type, isUploaded, etc.)

Each step is atomic, but if a step fails, previous steps will not be automatically rolled back.

put/files/{id}

Path parameters

idstring required

Unique identifier of the file to replace

Response

File successfully replaced

idstring required

Unique identifier for the file.

namestring required

Name of the file including extension.

sizeinteger required

Size of the file in bytes.

bucketIdstring required

ID of the bucket containing the file.

etagstring required

Entity tag for cache validation.

createdAtstring date-time required

Timestamp when the file was created.

updatedAtstring date-time required

Timestamp when the file was last updated.

isUploadedboolean required

Whether the file has been successfully uploaded.

mimeTypestring required

MIME type of the file.

uploadedByUserIdstring

ID of the user who uploaded the file.

metadataobject

Custom metadata associated with the file.

Example response

{
  "id": "d5e76ceb-77a2-4153-b7da-1f7c115b2ff2",
  "name": "profile-picture.jpg",
  "size": 245678,
  "bucketId": "users-bucket",
  "etag": "\"a1b2c3d4e5f6\"",
  "createdAt": "2023-01-15T12:34:56Z",
  "updatedAt": "2023-01-16T09:45:32Z",
  "isUploaded": true,
  "mimeType": "image/jpeg",
  "uploadedByUserId": "abc123def456",
  "metadata": {
    "alt": "Profile picture",
    "category": "avatar"
  }
}