Comments

Upload attachment

Changed on

Uploads a file's bytes and returns a draft comment attachment. Pass the returned attachment ID in the comment's attachment IDs when creating or editing a comment. For large files, use the multipart upload operations instead.

put/rooms/{roomId}/attachments/{attachmentId}/upload/{name}

Request

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

Path parameters

roomIdstring required

ID of the room

Example:my-room-id
attachmentIdstring required

ID for the attachment

Example:at_abc123456789012345678
namestring required

Name of the file

Example:screenshot.png

Query parameters

userIdstring required

ID of the user uploading the attachment

Example:alice
fileSizeinteger

Expected file size in bytes

Example:12345

Response

Success. Returns the uploaded draft attachment.

type'attachment' required
idstring required
mimeTypestring required
namestring required
sizeinteger required

Example response

{
  "type": "attachment",
  "id": "at_abc123",
  "mimeType": "image/png",
  "name": "screenshot.png",
  "size": 12345
}

Changes