You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
audit-log create-event --file does not parse occurredAt into a Date #254
workos audit-log create-event <organization-id> --file event.json parses the JSON file and passes the result directly to the Node SDK. An ISO 8601 occurredAt value remains a string, but the SDK expects a Date and calls event.occurredAt.toISOString(). The command fails locally before sending the event.
The non-file CLI path converts --occurred-at to a Date, so the two paths behave differently. This affects CLI v0.22.0; the same file-handling code is also present on main.
Reproduction
Save this as event.json (using any valid action and organization ID for your environment):
From the current code path, occurredAt remains a string and the SDK call to toISOString() fails. In an actual run with an API-format JSON file using occurred_at instead, I observed undefined is not an object (evaluating 'event.occurredAt.toISOString').
Expected behavior
The CLI should parse and validate occurredAt from the JSON file into a Date before calling the SDK, or clearly support and document a raw API JSON format for --file.
Workaround
Use workos api /audit_logs/events --method POST --file api-event.json --yes, where api-event.json uses the raw API field occurred_at with an ISO 8601 string (rather than the SDK field occurredAt).
Activity