• DocsDocs
  • PricingPricing
Sign in
Get started
Sign in
Get started
    • Products
      • Sync
        Sync

        The sync engine for the agentic web

      • Comments
        Comments

        Contextual commenting

      • Notifications
        Notifications

        Smart alerts for your app

    • Platform
      • Realtime infrastructure

        Multiplayer sync for people and AI

      • SDKs & integrations

        Client libraries and framework adapters

      • Security & compliance

        SOC 2, HIPAA, GDPR

    • Agentic users

      Build agentic experiences

    • AI activity feed

      Surface AI activity in your app

    • Canvas

      Build collaborative canvases

    • Chat

      Create realtime chat experiences

    • Code editor

      Build collaborative coding experiences

    • Comments

      Add contextual discussion

    • Custom app

      Start with flexible building blocks

    • Forms

      Collect input together

    • Flowchart

      Diagram together

    • Inbox

      Keep users informed

    • Presence

      Show who is online

    • Slideshow

      Present together

    • Spreadsheet

      Collaborate on data

    • Text editor

      Edit documents together

    • Industries
      • Human resources

        Collaboration for HR & talent tools

      • Security & compliance

        Collaborative reviews for audits & evidence

      • Sales & marketing tools

        Engaging features that help sellers sell

      • Healthcare

        HIPAA-ready collaboration for care teams

      • Creative tools

        Multiplayer canvases for people & AI

      • Legal

        Secure drafting for firms & clients

      • AEC

        Collaboration for design & construction

      • Education

        Interactive realtime learning experiences

    • Users
      • Enterprise

        Realtime collaboration without a rewrite

      • Innovation

        Validate and ship multiplayer bets fast

      • Startups

        Build multiplayer products from day one

      • Individual builders

        Prototype multiplayer apps in minutes

    • Tools
      • Examples

        Gallery of open source examples

      • Showcase

        Gallery of collaborative experiences

      • Next.js Starter Kit

        Kickstart your Next.js collaborative app

      • DevTools

        Browser extension

      • Tutorial

        Step-by-step interactive tutorial

    • Company
      • Blog

        The latest from Liveblocks

      • Customers

        The teams Liveblocks empowers

      • Changelog

        Weekly product updates

      • About

        The story and team behind Liveblocks

  • Docs
  • Pricing
  • Products
    • Sync
    • Comments
    • Notifications
    Platform
    • Realtime Infrastructure
    • SDKs & integrations
    • Security & compliance
    Solutions
    • Human resources
    • Security & compliance
    • Sales & marketing tools
    • Healthcare
    • Creative tools
    • Legal
    • AEC
    • Education
    • Enterprise
    • Innovation
    • Startups
    • Individual builders
  • Use cases
    • Agentic users
    • AI activity feed
    • Canvas
    • Chat
    • Code editor
    • Comments
    • Custom app
    • Forms
    • Flowchart
    • Inbox
    • Presence
    • Slideshow
    • Spreadsheet
    • Text editor
    Technologies
    • Next.js
    • React
    • JavaScript
    • Redux
    • Zustand
    • Yjs
    • Tiptap
    • BlockNote
    • SuperDoc
    • Slate
    • Lexical
    • Quill
    • Monaco
    • CodeMirror
  • Resources
    • Documentation
    • Examples
    • Showcase
    • DevTools
    • React components
    • Next.js Starter Kit
    • Tutorial
    • Guides
    • Release notes
    Company
    • Pricing
    • Blog
    • Customers
    • Changelog
    • About
    • Contact us
    • Careers
    • Terms of service
    • Privacy policy
    • DPA
    • Security
    • Trust center
    • Subprocessors
  • HomepageSystem status
    • Github
    • Discord
    • X
    • LinkedIn
    • YouTube
    © 2026 Liveblocks Inc.
Blog/Updates

Extend the capabilities of Yjs using our REST API and webhooks

Today, we'll dive into the different ways Liveblocks enables developers to extend Yjs, allowing you to integrate your document data seamlessly into existing systems with our REST API and webhooks.

Picture of Chris Nicholas
Chris Nicholas on September 7th, 2023
Extend the capabilities of Yjs using our REST API and webhooks
September 7th, 2023·3 min read
  • Picture of Chris NicholasChris Nicholas
Share article
How to guides

Ready to get started?

Join thousands of companies using Liveblocks to build multiplayer experiences for people and agents.

Get started for free

Related blog posts

  • Introducing Liveblocks Sync: the sync engine for the agentic web

    Introducing Liveblocks Sync: the sync engine for the agentic web

    Picture of Chris Nicholas
    September 1st
    Updates
  • LiveText: a new data type for collaborative text editing

    LiveText: a new data type for collaborative text editing

    Picture of Chris Nicholas
    September 1st
    Updates
  • What's new in Liveblocks: July 2026

    What's new in Liveblocks: July 2026

    Picture of Chris Nicholas
    August 4th
    Updates

In recent years, Yjs has grown to be the preferred way for developers to build collaborative rich text editors owing to its powerful features such as multiplayer undo/redo, lazy loading subdocuments, and offline support.

If you’ve already built collaborative experiences with Yjs, then you’ve probably discovered that integrating it with other parts of your system can be challenging. Because every update gets stored, Yjs documents can be hard to index, parse, and tend to grow quickly in size over time.

Today, we’ll dive into the different ways Liveblocks enables developers to extend Yjs capabilities in order to integrate Yjs data seamlessly into an exising system.

Update and retrieve documents with the REST API

Liveblocks provides access to a REST API, and with the launch of Liveblocks Yjs we’ve included some new endpoints specifically for Yjs.

Get Yjs documents

With the Get Yjs Document API you can retrieve Yjs document data for any given room.

const roomId = "my-room-name";fetch(`https://api.liveblocks.io/v2/rooms/${roomId}/ydoc`);

The result of the query will be in JSON form—though note that the exact schema will be different for each editor.

{  "my-y-text": "Content of my yText field"}

We also have an API for getting a Yjs document as a binary update.

Update Yjs documents

It’s possible to update a Yjs document by REST API, using the Send a Binary Yjs Update API. Here’s a code snippet, showing how it works.

// Create a Yjs documentconst yDoc = new Y.Doc();
// Create your data structures and make your updateconst yText = yDoc.getText("my-y-text");yText.insert(0, "Hello world");
// Encode the document state as an update messageconst yUpdate = Y.encodeStateAsUpdate(yDoc);
const roomId = "my-room-name";await fetch(`https://api.liveblocks.io/v2/rooms/${roomId}/ydoc`, { method: "PUT", body: yUpdate,});

If you’re interested in using this, make sure to read our full guide on the topic:

  • Modifying Yjs document data with the REST API

Use Yjs triggered webhook events

We’ve added new Yjs-triggered events to our Webhooks enabling you to automatically perform custom actions in your back end, such as sending notifications or saving your data to a database. This can all be implemented this by listening to the YDocUpdatedEvent, which runs whenever a Yjs document is modified.

Yjs webhook events sent to your backend.

Yjs webhook events - YDocUpdatedEvent

Our previous webhooks continue to work with Yjs too, for example you can respond to rooms being created and deleted, or users entering and leaving rooms.

Synchronizing Yjs document data to databases

When our webhooks and REST API are combined, it makes it easy to synchronize your Yjs document with a database. Here are some detailed guides on how to synchronize your Yjs document data to various databases:

  • Synchronize Yjs with PlanetScale MySQL
  • Synchronize Yjs with Vercel Postgres
  • Synchronize Yjs with Supabase Postgres

This is just one possibility, out platform enables many use cases. For example:

  • Parsing document data to notify users mentioned in a document.
  • Recording a version history of your documents.
  • Indexing your documents for a search form.

For the first time, this is now achievable with ease.

The most advanced platform for Yjs

Liveblocks is already the most advanced platform for Yjs, yet we have plans to extend Yjs even further, and we’re busy working on them right now—make sure to check back soon. We’re excited to see what you build with Liveblocks Yjs.