Skip to main content

Audit

Compliance audit trail. The Audit API provides a complete record of all system operations and changes, enabling regulatory compliance and forensic analysis.

Methods​

Method (TypeScript)Method (Python)DescriptionHTTP
list(options?)list(options=None)List audit logsGET /audit/logs
get(logId)get(log_id)Retrieve audit log entryGET /audit/logs/{id}
create(entry)create(entry)Create audit log entryPOST /audit/logs

Example​

import { OptropicClient } from 'optropic';

const client = new OptropicClient({ apiKey: 'optr_live_...' });

// List audit logs with filters
const logs = await client.audit.list({
actor: 'user-456',
resource: 'asset-123',
action: 'update',
limit: 50
});

logs.entries.forEach(entry => {
console.log(`${entry.timestamp}: ${entry.action} by ${entry.actor}`);
});