Skip to main content
POST
/
v2
/
crdt
/
get
Get CRDT Data
curl --request POST \
  --url https://api.velt.dev/v2/crdt/get \
  --header 'Content-Type: application/json' \
  --header 'x-velt-api-key: <x-velt-api-key>' \
  --header 'x-velt-auth-token: <x-velt-auth-token>' \
  --data '
{
  "data": {
    "organizationId": "<string>",
    "documentId": "<string>",
    "editorId": "<string>"
  }
}
'
{
  "result": {
    "status": "success",
    "message": "CRDT data retrieved successfully.",
    "data": [
      {
        "data": "Hello, collaborative world!",
        "id": "my-collab-note",
        "lastUpdate": "2025-01-20T10:30:00.000Z",
        "lastUpdatedBy": "user-123",
        "sessionId": "session-abc-456"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.velt.dev/llms.txt

Use this file to discover all available pages before exploring further.

Use this API to retrieve CRDT editor data from the backend. Use it with the Multiplayer Editing (Yjs) feature.

Endpoint

POST https://api.velt.dev/v2/crdt/get

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body Parameters

data
object
required

Example Request

{
  "data": {
    "organizationId": "YOUR_ORGANIZATION_ID",
    "documentId": "YOUR_DOCUMENT_ID",
    "editorId": "my-collab-note"
  }
}

Response

Success Response

The response contains an array of CRDT data objects. Each object includes the editor data and metadata.
{
  "result": {
    "status": "success",
    "message": "CRDT data retrieved successfully.",
    "data": [
      {
        "data": "Hello, collaborative world!",
        "id": "my-collab-note",
        "lastUpdate": "2025-01-20T10:30:00.000Z",
        "lastUpdatedBy": "user-123",
        "sessionId": "session-abc-456"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
datatext | map | array | xmlThe CRDT editor data. Type depends on the store type configured in the frontend.
idstringStore identifier (editorId)
lastUpdatestringISO timestamp of last update
lastUpdatedBystringUser ID who made the last update
sessionIdstring | nullSession ID or null

Error Response

{
  "error": {
    "message": "Organization ID is required",
    "status": "INVALID_ARGUMENT"
  }
}
{
  "result": {
    "status": "success",
    "message": "CRDT data retrieved successfully.",
    "data": [
      {
        "data": "Hello, collaborative world!",
        "id": "my-collab-note",
        "lastUpdate": "2025-01-20T10:30:00.000Z",
        "lastUpdatedBy": "user-123",
        "sessionId": "session-abc-456"
      }
    ]
  }
}