---
title: "Get the internal CRDT state"
method: GET
path: "/api/cards/{cardId}/yjs-state"
tags: ["Internal"]
---

# Get the internal CRDT state

`GET /api/cards/{cardId}/yjs-state`

## Request

- Base URL: `https://tre-app.com`
- URL: `https://tre-app.com/api/cards/{cardId}/yjs-state`
- Auth: HTTP bearer

## Response `200`

Success

- YjsStateResponse
  - `state` string, required
  - `epoch` integer, required: Lineage epoch of the CRDT document. Bumps only when the server rebuilds the document at load (a pre-2026-09-16 format-1 document, one still holding a `\r`, or one whose stored state reached 32 KB); an external rewrite or a restore reaches the document as an update under the same epoch. Saves must carry it back and get 409 when it is stale.

## Other responses

- `400`: Invalid request
- `401`: Unauthenticated
- `403`: Forbidden: insufficient role or token scope; scope denials name the held scope and the operation
- `404`: Not found
- `409`: Conflict
- `429`: Rate limited
- `500`: Internal server error
- `503`: Temporarily unavailable

---

[API](https://skmtc.dev/tre-app/apis/tre-rest-api.md) · [All operations](https://skmtc.dev/tre-app/apis/tre-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tre-app/apis/tre-rest-api/revisions/26a7187a05fc?raw)
