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

Request

  • Base URL: https://YOUR_CLOUD_URL_ENDPOINT/api/v4
  • URL: https://YOUR_CLOUD_URL_ENDPOINT/api/v4/store/findbyid
  • Auth: HTTP bearer

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

idunknown required
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.

fieldsunknown required
idunknown required
txnIdinteger

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

Changes

No recorded changes to this operation across all 1 revision of this API.