An object representing an Audit Log Schema.
const auditLogSchema = { object: 'audit_log_schema', version: 1, targets: [{ type: 'user', metadata: {} }], actor: { metadata: {} }, metadata: {}, createdAt: '2024-10-14T15:09:44.537Z', };
interface AuditLogSchemaCreates a new Audit Log schema used to validate the payload of incoming Audit Log Events. If the action does not exist, it will also be created.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const schema = await workos.auditLogs.createSchema({ action: 'user.viewed_invoice', actor: { metadata: { role: 'string', }, }, targets: [ { type: 'user', metadata: { status: 'string', }, }, ], metadata: { invoice_id: 'string', }, });
Get a list of all schemas for the Audit Logs action identified by :name.
curl https://api.workos.com/audit_logs/actions/user.viewed_invoice/schemas \ --header "Authorization: Bearer sk_example_123456789"
GET/audit_logs /actions /:name /schemasParameters Returns objectGet a list of all Audit Log actions in the current environment.
curl https://api.workos.com/audit_logs/actions \ --header "Authorization: Bearer sk_example_123456789"
GET/audit_logs /actionsParameters Returns object