PlatformXeDocs
Get API Key

Audit

SDK methods for dispatching federated audit events into the trace pipeline.

The client.audit namespace dispatches audit events into PlatformXe's federated trace pipeline. Available in TypeScript, Python, and Go SDKs.

SDKInstallNamespace
TypeScriptnpm install @caldera/platformxe-sdkclient.audit
Pythonpip install platformxeclient.audit
Gogo get github.com/calderax/platformxe-goclient.Audit

Log an audit event

Events are accepted asynchronously (HTTP 202) and durably recorded by the inngest worker.

await client.audit.log({
  app: 'lettings',
  actorId: 'user_123',
  entityType: 'BOOKING',
  entityId: 'bk_abc',
  action: 'CONFIRMED',
  metadata: { propertyId: 'prop_xyz', amount: 50000 },
});
client.audit.log(
    app="lettings",
    actor_id="user_123",
    entity_type="BOOKING",
    entity_id="bk_abc",
    action="CONFIRMED",
)
err := client.Audit.Log(px.AuditLogRequest{
    App:        "lettings",
    ActorID:    "user_123",
    EntityType: "BOOKING",
    EntityID:   "bk_abc",
    Action:     "CONFIRMED",
})

Request fields

FieldTypeDescription
appstringSource application emitting the event (lettings, concierge, xadmin).
actorIdstringStable identifier of the actor performing the action.
entityTypestringPolymorphic entity kind (BOOKING, PROPERTY, USER).
entityIdstringStable identifier of the entity.
actionstringVerb describing the action (CREATED, APPROVED, CANCELLED).
metadataRecord<string, unknown> (optional)Free-form structured context persisted with the event.
occurredAtstring (optional)ISO 8601 timestamp. Defaults to server-side new Date().

Scopes required

MethodScope
audit.log()audit:write