Skip to main content

Audit

Every memory operation in Novyx is SHA-256 hashed and timestamped in a tamper-proof audit trail. Query the trail by operation type and time range, or export it for compliance.

Base URL: https://novyx-ram-api.fly.dev

Retention: Free: 7 days · Starter: 14 days · Pro: 30 days · Enterprise: 90 days


Audit Trail

GET /v1/audit

Get the cryptographic audit trail. Returns a paginated list of audit entries, each containing the operation type, affected memory, content hash, and timestamp.

Query parameters

ParameterTypeRequiredDefaultDescription
limitnumberNo50Max entries (1–1000)
sincestringNoISO 8601 start timestamp. Only entries after this time are returned
operationsstringNoComma-separated filter: create, update, delete, rollback

Response fields

FieldTypeDescription
entriesarrayArray of audit entries
entries[].timestampstringOperation timestamp (ISO 8601)
entries[].operationstringOperation type: create, update, delete, rollback
entries[].memory_idstringAffected memory ID
entries[].content_hashstringSHA-256 hash of the content at that point
entries[].agent_idstringAgent that performed the operation (if set)
entries[].metadataobjectAdditional metadata (varies by operation)

Examples

from novyx import Novyx

nx = Novyx(api_key="nram_your_key")

# Get recent audit entries
audit = nx.audit(limit=20)
for entry in audit["entries"]:
print(f"[{entry['timestamp']}] {entry['operation']}{entry['memory_id']}")

# Filter by operation type
creates = nx.audit(operations="create", limit=50)

# Filter by time range
from_yesterday = nx.audit(since="2026-03-08T00:00:00Z")

Response

{
"entries": [
{
"timestamp": "2026-03-09T14:30:00Z",
"operation": "create",
"memory_id": "urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"content_hash": "e3b0c44298fc1c149afbf4c8996fb924...",
"agent_id": "agent-001",
"metadata": {}
},
{
"timestamp": "2026-03-09T14:25:00Z",
"operation": "update",
"memory_id": "urn:uuid:b2c3d4e5-f6a7-8901-bcde-f12345678901",
"content_hash": "a7ffc6f8bf1ed76651c14756a061d662...",
"agent_id": null,
"metadata": {
"fields_changed": ["observation", "importance"]
}
},
{
"timestamp": "2026-03-09T14:00:00Z",
"operation": "rollback",
"memory_id": null,
"content_hash": null,
"agent_id": null,
"metadata": {
"target": "2026-03-09T12:00:00Z",
"restored": 3,
"removed": 7
}
}
]
}

Errors

StatusCodeCause
400VALIDATION_ERRORInvalid since timestamp format or unknown operation filter
429RATE_LIMITEDExceeded plan API call quota

Export Audit Logs

GET /v1/audit/export

Export audit logs in CSV or JSON format for compliance, reporting, or external archival.

Tier: Starter+

Query parameters

ParameterTypeRequiredDefaultDescription
formatstringNo"csv"Export format: csv or json
sincestringNoISO 8601 start timestamp
untilstringNoISO 8601 end timestamp

Response

Returns a file download:

FormatContent-Type
csvtext/csv
jsonapplication/json

Examples

# Export as CSV
csv_data = nx.audit_export(format="csv")

# Export a specific time range as JSON
json_data = nx.audit_export(
format="json",
since="2026-03-01T00:00:00Z",
until="2026-03-09T00:00:00Z",
)

Errors

StatusCodeCause
403TIER_REQUIREDAudit export requires Starter plan or higher

How the audit trail works

Every memory operation (create, update, delete, rollback) generates an audit entry with:

  1. Timestamp — when the operation happened (server time, UTC)
  2. Operation — what happened (create, update, delete, rollback)
  3. Memory ID — which memory was affected (null for rollback operations)
  4. Content hash — SHA-256 hash of the memory content at that point

The audit trail is append-only — entries cannot be modified or deleted. This makes it suitable for compliance scenarios where you need a tamper-proof record of all data operations.

Verification

You can independently verify any audit entry by:

  1. Retrieving the memory content at the recorded timestamp
  2. Computing the SHA-256 hash
  3. Comparing it to the content_hash in the audit entry

For cryptographic chain verification with RSA signatures, see the Traces API.