POST
/
store
/
findbyid
{
  "fields": "<any>",
  "id": "<any>",
  "txnId": 123
}

Authorizations

Authorization
string
header
required

Authentication using either an API key or JWT token in the Authorization header

Headers

X-DITTO-TXN-ID
integer

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.

Body

application/json

Request parameters for retrieving a specific document by its ID. This is the most efficient way to fetch a single document when you know its identifier.

collection
string
required

The name of the collection containing the document

id
any
required

The unique identifier of the document to retrieve

formatAttachment
boolean
default:
false

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

serializedAs
enum<string>
default:
latestValues

Controls how the document data is serialized in the response

Available options:
latestValues,
latestValuesAndTypes

Response

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

Represents a document in the Ditto store. Documents are schema-free and can contain nested fields of various CRDT types for conflict-free replication.

fields
any
required

The document's content, which can include any valid JSON data types and special Ditto CRDT types

id
any
required

The unique identifier for this document within its collection

txnId
integer

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