v1

latestOpenAPI 3.0.32026-07-2652928.6 KB

Retrieve a single document by its unique identifier. This is the most efficient way to fetch a specific document when you know its ID.

post/store/findbyid

Headers

X-DITTO-TXN-IDinteger

Optional transaction ID for ensuring read consistency. The operation will only proceed if the Big Peer's transaction ID is at least this value, preventing reads of stale data.

Request body

collectionstring required

The name of the collection containing the document

formatAttachmentboolean

When true, any attachment fields will be formatted for easier consumption

{"stackTrail":"components:schemas:AnyValue","oasType":"schema","type":"unknown"}
serializedAs'latestValues' | 'latestValuesAndTypes'

Controls how document values are serialized in responses

Example request

{
  "collection": "people",
  "id": "abc123"
}

Response

The document was found and retrieved successfully. Returns the document data along with the transaction ID of the read operation.

{"stackTrail":"components:schemas:AnyValue","oasType":"schema","type":"unknown"}
{"stackTrail":"components:schemas:AnyValue","oasType":"schema","type":"unknown"}
txnIdinteger

The transaction ID at which this document was retrieved, useful for consistency tracking