Comments

Edit comment metadata

Changed on

This endpoint edits the metadata of a comment. The metadata is a JSON object that can be used to store any information you want about the comment, in string, number, or boolean form. Set a property to null to remove it. Corresponds to liveblocks.editCommentMetadata.

metadata supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.

post/rooms/{roomId}/threads/{threadId}/comments/{commentId}/metadata

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/rooms/{roomId}/threads/{threadId}/comments/{commentId}/metadata
  • Auth: none declared

Path parameters

roomIdstring required

ID of the room

Example:my-room-id
threadIdstring required

ID of the thread

Example:th_abc123
commentIdstring required

ID of the comment

Example:cm_abc123

Request body

metadataobject required
userIdstring required
updatedAtstring date-time

Example request

{
  "metadata": {
    "tag": "important"
  },
  "userId": "alice",
  "updatedAt": "2023-07-13T14:32:50.697Z"
}

Response

Success. Returns the updated metadata.

CommentMetadata required

Custom metadata attached to a comment. Supports maximum 50 entries. Key length has a limit of 40 characters maximum. Value length has a limit of 4000 characters maximum for strings.

Example response

{
  "tag": "important",
  "spam": false
}

Changes

    • breaking

      request body became required

    • info

      api operation id post-rooms-roomId-threads-threadId-comments-commentId-metadata removed and replaced with edit-comment-metadata

    • info

      added 'propertyNames' constraint to the response body for the status

    • warning

      removed the optional property from the response with the status