Storage

Upload Storage file

Changed on

Uploads a file's bytes to a room and returns the metadata needed to create a LiveFile. For large files, use the multipart upload operations instead. Repeating the request with the same file ID, name, and file size returns the existing upload.

put/rooms/{roomId}/storage/files/{fileId}/upload/{name}

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/rooms/{roomId}/storage/files/{fileId}/upload/{name}
  • Auth: none declared

Path parameters

roomIdstring required

ID of the room

Example:my-room-id
fileIdstring required

ID for the Storage file

Example:fl_abc123456789012345678
namestring required

Name of the file

Example:photo.png

Query parameters

fileSizeinteger

Expected file size in bytes.

Example:12345

Response

Success. Returns the uploaded file metadata.

idstring required

ID of the uploaded Storage file

namestring required

Original file name

sizeinteger required

File size in bytes

mimeTypestring required

File MIME type

Example response

{
  "id": "fl_abc123456789012345678",
  "name": "photo.png",
  "size": 12345,
  "mimeType": "image/png"
}

Changes