> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get CRDT Data

Use this API to retrieve CRDT editor data from the backend. Use it with the [Multiplayer Editing (Yjs)](https://velt.dev/docs/realtime-collaboration/crdt/setup/core.md) 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*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body Parameters

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID where the document belongs

**documentId** `string` *required*

Document ID containing the CRDT editor data

**editorId** `string`

Optional unique identifier for the specific CRDT editor instance. If omitted, returns all CRDT data for the document.

## Example Request

```JSON theme={null}
{
  "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.

```JSON theme={null}
{
  "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

| Field | Type | Description |
| - | - | - |
| `data` | `text` \| `map` \| `array` \| `xml` | The CRDT editor data. Type depends on the store type configured in the frontend. |
| `id` | `string` | Store identifier (editorId) |
| `lastUpdate` | `string` | ISO timestamp of last update |
| `lastUpdatedBy` | `string` | User ID who made the last update |
| `sessionId` | `string \| null` | Session ID or null |

## Error Response

```JSON theme={null}
{
  "error": {
    "message": "Organization ID is required",
    "status": "INVALID_ARGUMENT"
  }
}
```

```json theme={null}
{
  "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"
      }
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.