Yjs

Get Yjs document

Changed on

This endpoint returns a JSON representation of the room’s Yjs document. Corresponds to liveblocks.getYjsDocument.

get/rooms/{roomId}/ydoc

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/rooms/{roomId}/ydoc
  • Auth: none declared

Path parameters

roomIdstring required

ID of the room

Example:my-room-id

Query parameters

formattingboolean

If present, YText will return formatting.

keystring

Returns only a single key’s value, e.g. doc.get(key).toJSON().

Example:root
type'ymap' | 'ytext' | 'yxmltext' | 'yxmlfragment' | 'yarray'

Used with key to override the inferred type, i.e. "ymap" will return doc.get(key, Y.Map).

Example:ymap

Response

Success. Returns the room’s Yjs document as JSON.

GetYjsDocumentResponse required

Example response

{
  "someYText": "Contents of YText"
}

Changes