Creates an Audit Log schema used to validate incoming Audit Log events, or returns the latest version if the submitted schema matches it. If the schema differs from the latest version, creates and returns a new version. If the action does not exist, creates the action and its first schema version.
Request
cURL
POST/audit_logs /actions /:actionName /schemas
Parameters
Returns
Get a list of all schemas for the Audit Logs action identified by :name.
cURL
| curl "https://api.workos.com/audit_logs/actions/user.logged_in/schemas" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.audit_logs.list_action_schemas(action_name: "user.logged_in") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.audit_logs.list_action_schemas(action_name="user.logged_in") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.AuditLogs().ListActionSchemas(context.Background(), "user.logged_in") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->auditLogs()->listActionSchemas(actionName: "user.logged_in"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.auditLogs.listActionSchemas("user.logged_in"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.AuditLogs.ListActionSchemasAsync("user.logged_in"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .audit_logs() | |
| .list_action_schemas("user.logged_in") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "audit_log_schema", | |
| "version": 1, | |
| "actor": { | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "role": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "targets": [ | |
| { | |
| "type": "invoice", | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "cost": { | |
| "type": "number" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "transactionId": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "created_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "list_metadata": { | |
| "before": "als_01HXYZ123456789ABCDEFGHIJ", | |
| "after": "als_01HXYZ987654321KJIHGFEDCBA" | |
| } | |
| } |
GET/audit_logs /actions /:actionName /schemas
Parameters
Returns object
Get a list of all Audit Log actions in the current environment.
cURL
| curl "https://api.workos.com/audit_logs/actions" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.audit_logs.list_actions |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.audit_logs.list_actions() |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.AuditLogs().ListActions(context.Background()) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->auditLogs()->listActions(); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.auditLogs.listActions(); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.AuditLogs.ListActionsAsync(); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .audit_logs() | |
| .list_actions() | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "audit_log_action", | |
| "name": "user.viewed_invoice", | |
| "schema": { | |
| "object": "audit_log_schema", | |
| "version": 1, | |
| "actor": { | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "role": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "targets": [ | |
| { | |
| "type": "invoice", | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "cost": { | |
| "type": "number" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "metadata": { | |
| "type": "object", | |
| "properties": { | |
| "transactionId": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "created_at": "2026-01-15T12:00:00.000Z" | |
| }, | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "list_metadata": { | |
| "before": "ala_01HXYZ123456789ABCDEFGHIJ", | |
| "after": "ala_01HXYZ987654321KJIHGFEDCBA" | |
| } | |
| } |
GET