Tearleads

POST/documents/pulls/query

Query read-only document pulls in batch

Operation documents.pulls.query

Description

Returns bounded read-only paginated Loro update pull pages for up to 32 unique documents in one database snapshot, sharing container path access checks, current-epoch KEK resolution, and commit LSN evaluation. Per-document existence, access, billing, or sync-state conflicts report per item while sibling documents still resolve; replica lag returns 503 for the batch, and 413 means the serialized request exceeds the document sync byte limit.

Authentication

Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.

Request body

application/jsonQueryDocumentPullsRequest

Batch request for up to 32 pure read-only paginated document pulls.

1 field
  • itemslist of DocumentPullQueryItemrequired
    • 1 to 32 items

    Unique document pull requests evaluated in one shared snapshot.

Responses

200 OK

application/jsonQueryDocumentPullsResponse

Batched read-only document pull responses in request order.

1 field

Other responses

StatusMeaningBody
400Bad Request

application/jsonErrorResponse

401Unauthorized

application/jsonSessionFailureResponse

413Serialized document pull batch requests are limited to 16777216 bytes

application/jsonErrorResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse

Additional rules

The server also enforces these rules, which the schema above cannot express.

  • Items must not repeat a documentId.

  • historyMode "raw" requires localVersionVector to be null so the complete retained history is requested.

  • processedThroughUpdateId requires a non-null localVersionVector, so a raw-history pull carries none.

  • Results must not repeat a documentId.

  • baselineId and baselineSegmentIndex must be absent together or both present; baselineSegmentCount and baselineSegmentsDigest appear only together and only with them, marking a baseline's final segment; only a final segment may carry coversThroughUpdateId.

  • commitLsnMode "untracked" requires the commitLsn "0/0" sentinel.

  • commitLsn "0/0" requires commitLsnMode "untracked" in the same response.

  • pullPage.hasMore is true exactly when pullPage.nextCursor is non-null.

  • pullPage.throughUpdateId is null exactly when pullPage.throughUpdateCount is 0.

  • contentKeyBundles carries each content-key epoch at most once.