> ## Documentation Index
> Fetch the complete documentation index at: https://docs.centure.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Base schema structure and overview of all audit log events

<Info>
  Audit logging requires the Audit Logging add-on. See [Add-ons pricing](/pricing/add-ons) for details.
</Info>

## Base Event Schema

All audit log events share a common structure with four main components:

### Actor

The user who performed the action.

<ResponseField name="actor.type" type="string" required>
  Always set to `"user"`
</ResponseField>

<ResponseField name="actor.id" type="string" required>
  User's unique identifier
</ResponseField>

<ResponseField name="actor.name" type="string" required>
  User's full name (first name + last name)
</ResponseField>

<ResponseField name="actor.metadata" type="object" required>
  <Expandable title="properties">
    <ResponseField name="first_name" type="string" required>
      User's first name
    </ResponseField>

    <ResponseField name="last_name" type="string" required>
      User's last name
    </ResponseField>

    <ResponseField name="email" type="string" required>
      User's email address
    </ResponseField>

    <ResponseField name="impersonator_email" type="string">
      Email of admin impersonating the user (empty string if not impersonated)
    </ResponseField>

    <ResponseField name="impersonator_reason" type="string">
      Reason provided for impersonation (empty string if not impersonated)
    </ResponseField>
  </Expandable>
</ResponseField>

### Targets

The resources affected by the action. Each event can have multiple targets.

<ResponseField name="targets" type="array" required>
  Array of target objects

  <Expandable title="target object">
    <ResponseField name="type" type="string" required>
      Resource type (e.g., `"api_key"`, `"project"`, `"organization"`)
    </ResponseField>

    <ResponseField name="id" type="string" required>
      Resource's unique identifier
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Resource's display name
    </ResponseField>

    <ResponseField name="metadata" type="object" required>
      Additional resource-specific fields (varies by resource type)
    </ResponseField>
  </Expandable>
</ResponseField>

### Context

Information about when and where the action occurred.

<ResponseField name="context.location" type="string" required>
  IP address of the request, or `"unknown"` if unavailable. Maximum 45 characters (IPv6 compatible).
</ResponseField>

<ResponseField name="context.userAgent" type="string" required>
  User agent string from the request, or `"unknown"` if unavailable. Maximum 500 characters.
</ResponseField>

### Metadata

Additional information specific to the action.

<ResponseField name="metadata.source" type="string" required>
  User-facing page route where the action was initiated
</ResponseField>

Additional metadata fields vary by event type and are documented in each event's specific schema.

## Field Conventions

### Naming

* Action names use snake\_case with dots: `api_key.create`, `organization.update_name`
* Metadata fields use snake\_case: `first_name`, `organization_id`, `status_from`
* Format follows `<resource>.<action>` pattern

### Value Constraints

* String fields are truncated to prevent exceeding WorkOS limits
* Default truncation: 500 characters
* IP addresses: maximum 45 characters
* User agents: maximum 500 characters
* All values are sanitized before storage

### Optional Fields

* `impersonator_email` and `impersonator_reason` are present but empty when not applicable
* `context.location` and `context.userAgent` default to `"unknown"` when unavailable
* Some metadata fields are optional and only present for specific events

## Event Categories

<CardGroup cols={2}>
  <Card title="API Keys" icon="key" href="/logs/events/api-keys">
    Key creation, updates, revocations, and access
  </Card>

  <Card title="MCP Proxies" icon="plug" href="/logs/events/mcp-proxies">
    Proxy configuration, OAuth flows, and connections
  </Card>

  <Card title="Projects" icon="folder" href="/logs/events/projects">
    Project creation, settings, and membership views
  </Card>

  <Card title="Project Memberships" icon="users" href="/logs/events/project-memberships">
    User access grants and revocations
  </Card>

  <Card title="Organizations" icon="building" href="/logs/events/organizations">
    Organization settings, domains, and membership views
  </Card>

  <Card title="External Apps" icon="shield-check" href="/logs/events/external-apps">
    OAuth consent and login approval flows
  </Card>

  <Card title="SSO" icon="fingerprint" href="/logs/events/sso">
    Single sign-on configuration and connections
  </Card>

  <Card title="Directory Sync" icon="arrows-rotate" href="/logs/events/directory-sync">
    User provisioning and directory connections
  </Card>

  <Card title="Audit Log Streams" icon="stream" href="/logs/events/audit-log-streams">
    Audit log portal access and SIEM configurations
  </Card>

  <Card title="Users" icon="user" href="/logs/events/users">
    User profile and settings access
  </Card>

  <Card title="Analytics" icon="chart-line" href="/logs/events/analytics">
    Usage analytics and metrics access
  </Card>
</CardGroup>

## Common Patterns

### View Events

Events with `.view_*` or `.list_*` suffixes record when users access information without making changes. These events:

* Include the viewed resource as a target
* Record the page route in `metadata.source`
* Do not include change tracking metadata

### Update Events

Events with `.update` or `.update_*` suffixes record modifications to resources. These events:

* Include `changes` metadata with before/after values for modified fields
* Use format: `{field_name: {from: old_value, to: new_value}}`
* Status changes use dedicated `status_from` and `status_to` metadata fields

### Create and Delete Events

Events with `.create` and `.delete` suffixes record resource lifecycle events. These events:

* Create events include full initial configuration in target metadata
* Delete events typically have minimal metadata (resource was removed)
* Both include the affected resource and its parent (e.g., API key and project)

### Multi-Target Events

Many events include multiple targets to provide full context:

* Primary resource (e.g., `api_key`)
* Parent resource (e.g., `project`)
* Related resources (e.g., `organization`)

This structure allows filtering events by any affected resource in the audit logs portal.
