File Journal & Audit Log
Section titled “File Journal & Audit Log”The file journal records every mutation performed against a workspace’s files. Use these endpoints to query the audit log with cursor-based pagination, inspect storage health and pruning state, and force pending writes to be flushed and fsynced to disk.
Query journal entries
Section titled “Query journal entries”GET /api/v1/journal
Section titled “GET /api/v1/journal”Query file mutation journal entries with optional filters. Supports cursor-based pagination via after_id.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | query | string | No | Filter entries by path prefix |
op | query | string | No | Filter by operation type(s), comma-separated (e.g. write,delete) |
since | query | string | No | Filter entries since timestamp (RFC3339 or Unix ms) |
limit | query | integer | No | Max entries to return (default 100) |
after_id | query | integer | No | Cursor: return entries with id > after_id (default 0) |
Response
Section titled “Response”{ "count": 3, "has_more": true, "next_after_id": 100042, "entries": [ { "id": 100040, "ts": 1719840000000, "op": "write", "path": "docs/report.md", "seq": 42, "size_before": 4096, "size_after": 8192, "before": "5d41402abc4b2a76b9719d911017c592", "after": "e3b0c44298fc1c1f3a2bd49ad9b6e3ab", "blob": true, "blob_before": true, "blob_after": true }, { "id": 100041, "ts": 1719840060000, "op": "delete", "path": "tmp/scratch.txt" }, { "id": 100042, "ts": 1719840120000, "op": "chmod", "path": "scripts/deploy.sh", "old_mode": "0644", "new_mode": "0755" } ]}{ "statusCode": 404, "error": "Not Found", "message": "Journal not enabled"}{ "statusCode": 429, "error": "Too Many Requests", "message": "Too many concurrent journal queries"}Example
Section titled “Example”curl -X GET "https://api.hoody.com/api/v1/journal?path=docs/&op=write,delete&limit=50&after_id=100000" \ -H "Authorization: Bearer <token>"const page = await client.files.journal.query({ path: "docs/", op: "write,delete", since: "2024-06-01T00:00:00Z", limit: 50, after_id: 100000,});
console.log(page.count, page.has_more, page.next_after_id);Get journal statistics
Section titled “Get journal statistics”GET /api/v1/journal/stats
Section titled “GET /api/v1/journal/stats”Returns storage statistics for the journal system including entry counts, blob storage usage, writer health, and pruning info.
This endpoint takes no parameters.
Response
Section titled “Response”{ "total_entries": 1247, "total_blobs": 892, "total_blob_bytes": 5242880, "total_storage_bytes": 6291456, "writer_healthy": true, "entries_skipped_total": 0, "parse_failures": 0, "skipped_overflow": 0, "newest_entry_ts": 1719840000000, "pruned_before_date": "2024-06-01"}{ "statusCode": 404, "error": "Not Found", "message": "Journal not enabled"}{ "statusCode": 429, "error": "Too Many Requests", "message": "Too many concurrent journal queries"}Example
Section titled “Example”curl -X GET "https://api.hoody.com/api/v1/journal/stats" \ -H "Authorization: Bearer <token>"const stats = await client.files.journal.getStats();
if (!stats.writer_healthy || stats.skipped_overflow > 0) { console.warn("Journal health degraded", stats);}Flush journal to disk
Section titled “Flush journal to disk”POST /api/v1/journal/flush
Section titled “POST /api/v1/journal/flush”Forces all pending journal entries to be written and fsynced to disk. Returns 200 with flushed=true if all entries were durably persisted, or 503 with flushed=false if flush failed or entries were lost.
This endpoint takes no parameters.
Response
Section titled “Response”{ "flushed": true}{ "statusCode": 404, "error": "Not Found", "message": "Journal not enabled"}{ "flushed": false}Example
Section titled “Example”curl -X POST "https://api.hoody.com/api/v1/journal/flush" \ -H "Authorization: Bearer <token>"const result = await client.files.journal.flush();
if (!result.flushed) { throw new Error("Journal flush failed; entries may have been lost");}