Temporal Tracking — MDDB API
Document event history, hot-docs leaderboard and activity histograms (requires MDDB_TEMPORAL=true)
Query document event history #
POST /v1/temporal/query
Returns create/update/access events for a specific document within a time range. Requires MDDB_TEMPORAL=true.
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Required.
Content type application/json: object
| Property | Type | Description |
|---|---|---|
collection (required) |
string |
|
key (required) |
string |
|
lang (required) |
string |
|
eventType |
string |
Filter by event type; omit for all events One of "create", "update", "access". |
from |
integer (int64) |
Unix timestamp; defaults to 30 days ago |
to |
integer (int64) |
Unix timestamp; defaults to now |
limit |
integer |
Default 100. |
{
"collection": "string",
"eventType": "create",
"from": 0,
"key": "string",
"lang": "string",
"limit": 100,
"to": 0
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Event history | object (application/json) |
400 |
Missing required fields | |
404 |
The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. | object (application/json) |
404 example (application/json)
{
"error": "feature disabled",
"feature": "temporal"
}
Hot documents leaderboard #
POST /v1/temporal/hot
Returns the top-N most accessed documents in a collection. Requires MDDB_TEMPORAL=true.
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Required.
Content type application/json: object
| Property | Type | Description |
|---|---|---|
collection (required) |
string |
|
topN |
integer |
Default 10. |
since |
integer (int64) |
Unix timestamp to filter events from |
{
"collection": "string",
"since": 0,
"topN": 10
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Hot documents list | object (application/json) |
400 |
Missing required field | |
404 |
The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. | object (application/json) |
404 example (application/json)
{
"error": "feature disabled",
"feature": "temporal"
}
Event frequency histogram #
POST /v1/temporal/histogram
Returns a bucketed histogram of event frequency for a collection. Requires MDDB_TEMPORAL=true.
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Required.
Content type application/json: object
| Property | Type | Description |
|---|---|---|
collection (required) |
string |
|
eventType |
string |
One of "create", "update", "access". Default "access". |
interval |
string |
One of "day", "week", "month". Default "day". |
from |
integer (int64) |
|
to |
integer (int64) |
{
"collection": "string",
"eventType": "access",
"from": 0,
"interval": "day",
"to": 0
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Histogram buckets | object (application/json) |
400 |
Missing required field | |
404 |
The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. | object (application/json) |
404 example (application/json)
{
"error": "feature disabled",
"feature": "temporal"
}