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

# Audit Events API: Query Activity Logs

> Query the immutable audit log to review actions in your tenant: product changes, order events, settings updates, team invitations, and integration events.

The Audit Events API gives you read-only access to the complete activity log for your tenant. Every significant action in Synq — creating a product, updating settings, inviting a team member, connecting an integration — is written to this log automatically. You can query it to support compliance reviews, investigate incidents, or build custom monitoring dashboards. The audit log is immutable: you can query it, but you cannot modify or delete events.

<Note>
  All requests require three headers: `Authorization: Bearer YOUR_TOKEN`, `X-Tenant-ID: YOUR_TENANT_ID`, and `X-Org-ID: YOUR_ORG_ID`.
</Note>

***

## List audit events

Retrieve the most recent audit events for your tenant and organization, ordered by most recent first. Returns up to 50 events per request.

**`GET /api/v1/audit`**

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token from your authentication provider.
</ParamField>

<ParamField header="X-Tenant-ID" type="string" required>
  UUID of your tenant.
</ParamField>

<ParamField header="X-Org-ID" type="string" required>
  UUID of your organization.
</ParamField>

### Response

Returns an array of audit event objects directly.

<ResponseField name="id" type="string">UUID of the audit event.</ResponseField>
<ResponseField name="actor_email" type="string">Email or system identifier of the user or process that triggered the event.</ResponseField>

<ResponseField name="action" type="string">
  The action that occurred. Common values include:

  * `PRODUCT_CREATED`
  * `PRODUCT_UPDATED`
  * `PRODUCT_DELETED`
  * `INTEGRATION_CONNECTED`
  * `USER_INVITED`
  * `TENANT_SETTINGS_UPDATED`
</ResponseField>

<ResponseField name="entity_type" type="string">The type of resource affected, e.g. `PRODUCT`, `USER`, `COMMERCE_CONNECTION`, `TENANT_SETTINGS`.</ResponseField>
<ResponseField name="entity_id" type="string">UUID of the specific resource affected. May be empty if the entity does not yet have a persisted ID at the time of the event.</ResponseField>
<ResponseField name="details" type="object">Free-form JSON object with additional context about the event.</ResponseField>
<ResponseField name="ip_address" type="string">IP address from which the request originated.</ResponseField>
<ResponseField name="created_at" type="string">ISO 8601 timestamp of when the event was recorded.</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.synq.app/api/v1/audit \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "X-Tenant-ID: YOUR_TENANT_ID" \
    -H "X-Org-ID: YOUR_ORG_ID"
  ```

  ```json Response theme={null}
  [
    {
      "id": "f6a7b8c9-d0e1-2345-abcd-678901234567",
      "actor_email": "alice@example.com",
      "action": "TENANT_SETTINGS_UPDATED",
      "entity_type": "TENANT_SETTINGS",
      "entity_id": "e5f6a7b8-c9d0-1234-efab-567890123456",
      "details": {
        "inventory_allocation_model": "HARD",
        "auto_po_enabled": true,
        "default_low_stock_threshold": 20,
        "costing_method": "FIFO"
      },
      "ip_address": "203.0.113.42",
      "created_at": "2024-06-15T14:00:00Z"
    },
    {
      "id": "a7b8c9d0-e1f2-3456-bcde-789012345678",
      "actor_email": "alice@example.com",
      "action": "USER_INVITED",
      "entity_type": "USER",
      "entity_id": "",
      "details": {
        "email": "dana@example.com",
        "role": "EDITOR"
      },
      "ip_address": "203.0.113.42",
      "created_at": "2024-06-14T10:05:00Z"
    },
    {
      "id": "b8c9d0e1-f2a3-4567-cdef-890123456789",
      "actor_email": "alice@example.com",
      "action": "INTEGRATION_CONNECTED",
      "entity_type": "COMMERCE_CONNECTION",
      "entity_id": "",
      "details": {
        "connection_id": "conn_3Xabc...",
        "provider": "shopify",
        "category": "commerce"
      },
      "ip_address": "203.0.113.42",
      "created_at": "2024-06-10T09:30:00Z"
    },
    {
      "id": "c9d0e1f2-a3b4-5678-defa-901234567890",
      "actor_email": "bob@example.com",
      "action": "PRODUCT_CREATED",
      "entity_type": "PRODUCT",
      "entity_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "details": {
        "title": "Classic Wool Sweater",
        "category": "apparel"
      },
      "ip_address": "198.51.100.7",
      "created_at": "2024-06-01T10:00:00Z"
    }
  ]
  ```
</CodeGroup>

<Note>
  The audit log is **read-only**. There are no endpoints to create, update, or delete audit events. Events are written automatically by Synq whenever a significant action occurs.
</Note>
