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

# Clay Enterprise: Clay Query Audit Logs

> Query your Clay workspace audit log events by filter and time range, returning a page of events and a cursor. Includes SDK V2 examples, schemas, and cost.

Query your Clay workspace audit log events by filter and time range, returning a page of events and a cursor.

> [!NOTE]
>
> Tool ID: `clay_query_audit_logs`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'clay_query_audit_logs',
  {
    "cursor": "cursor_123",
    "filter": {
      "actor_ids": [
        "actor_123"
      ],
      "event_types": [
        "example"
      ],
      "occurred_at": {
        "gte": "2026-01-15T12:00:00Z",
        "lt": "2026-01-15T12:00:00Z"
      }
    },
    "limit": 20
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run clay_query_audit_logs --input '{
  "cursor": "cursor_123",
  "filter": {
    "actor_ids": [
      "actor_123"
    ],
    "event_types": [
      "example"
    ],
    "occurred_at": {
      "gte": "2026-01-15T12:00:00Z",
      "lt": "2026-01-15T12:00:00Z"
    }
  },
  "limit": 20
}'
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe clay_query_audit_logs --json` for the complete live contract.

## Input reference

Available to workspace admins in workspaces with audit logs enabled. other API keys receive `403`. Returns audit events within the available access window ordered by `(occurred_at, event_id)`. `cursor` is an opaque position valid only with the same order. Send the intended filter with every request, including continuations. changing it returns matching events after the cursor position. Omit `cursor` from the response when there is no next page. A query that exceeds the request deadline returns `504`. retry with a narrower filter or time range. The [audit event catalog](https://deepline.com/docs/compliance/audit-logs) documents the `resources` each event type carries.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.cursor` | `string` | No | — | Opaque `cursor` from the previous page. Use with the same `order`. The cursor does not record filters: send the intended `filter` with every request. Minimum length: 1. Maximum length: 4096. |
| `payload.filter` | `object` | No | — | — |
| `payload.limit` | `integer` | No | `20` | Minimum: 1. Maximum: 100. |
| `payload.order` | `"asc" \| "desc"` | No | `"asc"` | Allowed: `asc`, `desc`. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Available to workspace admins in workspaces with audit logs enabled; other API keys receive `403`. Returns audit events within the available access window ordered by `(occurred_at, event_id)`. `cursor` is an opaque position valid only with the same order. Send the intended filter with every request, including continuations; changing it returns matching events after the cursor position. Omit `cursor` from the response when there is no next page. A query that exceeds the request deadline returns `504`; retry with a narrower filter or time range. The [audit event catalog](/compliance/audit-logs) documents the `resources` each event type carries.",
    "properties": {
      "cursor": {
        "type": "string",
        "description": "Opaque `cursor` from the previous page. Use with the same `order`. The cursor does not record filters: send the intended `filter` with every request.",
        "minLength": 1,
        "maxLength": 4096
      },
      "filter": {
        "type": "object",
        "properties": {
          "actor_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "event_types": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "occurred_at": {
            "type": "object",
            "properties": {
              "gte": {
                "type": "string",
                "description": "Inclusive lower bound. Fractional seconds beyond milliseconds are truncated.",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "format": "date-time"
              },
              "lt": {
                "type": "string",
                "description": "Exclusive upper bound. Fractional seconds beyond milliseconds are truncated.",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "format": "date-time"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "limit": {
        "type": "integer",
        "default": 20,
        "minimum": 1,
        "maximum": 100
      },
      "order": {
        "type": "string",
        "default": "asc",
        "enum": [
          "asc",
          "desc"
        ]
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.cursor` | `string` | No | — | — |
| `result.data.data` | `array` | Yes | — | — |
| `result.data.data[].actor` | `object` | Yes | — | — |
| `result.data.data[].actor.alternative_identifier` | `string \| null` | Yes | — | — |
| `result.data.data[].actor.id` | `string \| null` | Yes | — | — |
| `result.data.data[].actor.impersonated_by` | `object \| null` | Yes | — | Present when the action was performed by Clay support on the customer's behalf. |
| `result.data.data[].actor.impersonated_by.alternative_identifier` | `null` | Yes | — | — |
| `result.data.data[].actor.impersonated_by.id` | `"clay_support"` | Yes | — | — |
| `result.data.data[].actor.impersonated_by.name` | `"Clay support"` | Yes | — | — |
| `result.data.data[].actor.impersonated_by.type` | `"user"` | Yes | — | — |
| `result.data.data[].actor.name` | `string \| null` | Yes | — | — |
| `result.data.data[].actor.type` | `string` | Yes | — | — |
| `result.data.data[].auth` | `object` | Yes | — | — |
| `result.data.data[].auth.authentication` | `object` | Yes | — | — |
| `result.data.data[].auth.authentication.method` | `"session" \| "api_key" \| "oauth" \| "service" \| "none" \| "unknown"` | Yes | — | Allowed: `session`, `api_key`, `oauth`, `service`, `none`, `unknown`. |
| `result.data.data[].auth.authentication.strategy` | `"password" \| "google" \| "sso" \| "unknown"` | Yes | — | Null when the request was not a login session. Allowed: `password`, `google`, `sso`, `unknown`. |
| `result.data.data[].auth.client` | `object` | Yes | — | — |
| `result.data.data[].auth.client.id` | `string \| null` | Yes | — | Null when unavailable. |
| `result.data.data[].auth.client.name` | `string \| null` | Yes | — | Null when unavailable. |
| `result.data.data[].auth.client.type` | `"clay_ui" \| "clay_cli" \| "oauth_app" \| "managed_agent" \| "mcp" \| "service" \| "api" \| "none" \| "unknown"` | Yes | — | Allowed: `clay_ui`, `clay_cli`, `oauth_app`, `managed_agent`, `mcp`, `service`, `api`, `none`, `unknown`. |
| `result.data.data[].event_id` | `string` | Yes | — | Format: `uuid`. Pattern: `^([0-9a-fA-F]&#123;8&#125;-[0-9a-fA-F]&#123;4&#125;-[1-8][0-9a-fA-F]&#123;3&#125;-[89abAB][0-9a-fA-F]&#123;3&#125;-[0-9a-fA-F]&#123;12&#125;\|00000000-0000-0000-0000-000000000000\|ffffffff-ffff-ffff-ffff-ffffffffffff)$`. |
| `result.data.data[].event_type` | `string` | Yes | — | — |
| `result.data.data[].event_version` | `integer` | Yes | — | Event-specific schema version for this event\_type. Must be greater than 0. Maximum: 9007199254740991. |
| `result.data.data[].occurred_at` | `string` | Yes | — | Format: `date-time`. Pattern: `^(?:(?:\d\d[2468][048]\|\d\d[13579][26]\|\d\d0[48]\|[02468][048]00\|[13579][26]00)-02-29\|\d&#123;4&#125;-(?:(?:0[13578]\|1[02])-(?:0[1-9]\|[12]\d\|3[01])\|(?:0[469]\|11)-(?:0[1-9]\|[12]\d\|30)\|(?:02)-(?:0[1-9]\|1\d\|2[0-8])))T(?:(?:[01]\d\|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z\|([+-](?:[01]\d\|2[0-3]):[0-5]\d)))$`. |
| `result.data.data[].origin` | `object` | Yes | — | — |
| `result.data.data[].origin.ip_address` | `string \| null` | Yes | — | Null when unavailable. |
| `result.data.data[].origin.user_agent` | `string \| null` | Yes | — | Null when unavailable. |
| `result.data.data[].outcome` | `object` | Yes | — | — |
| `result.data.data[].outcome.reason_code` | `string \| null` | Yes | — | — |
| `result.data.data[].outcome.status` | `string` | Yes | — | Known values include success, attempted, and failed. |
| `result.data.data[].request_context` | `object` | Yes | — | — |
| `result.data.data[].request_context.originating_request_id` | `string \| null` | Yes | — | — |
| `result.data.data[].request_context.request_id` | `string \| null` | Yes | — | — |
| `result.data.data[].resources` | `array` | Yes | — | — |
| `result.data.data[].resources[].alternative_identifier` | `string \| null` | Yes | — | — |
| `result.data.data[].resources[].attributes` | `object \| null` | Yes | — | — |
| `result.data.data[].resources[].change` | `object` | No | — | An omitted side was not captured or audited. null means the resource did not exist on that side. null fields are explicitly absent. |
| `result.data.data[].resources[].change.after` | `object \| null` | No | — | — |
| `result.data.data[].resources[].change.before` | `object \| null` | No | — | — |
| `result.data.data[].resources[].id` | `string` | Yes | — | — |
| `result.data.data[].resources[].name` | `string \| null` | Yes | — | — |
| `result.data.data[].resources[].relationship` | `string` | Yes | — | Known values include source and target. |
| `result.data.data[].resources[].type` | `string` | Yes | — | — |
| `result.data.data[].resources[].count` | `object` | Yes | — | — |
| `result.data.data[].resources[].count.precision` | `string` | Yes | — | Known values include exact and estimated. |
| `result.data.data[].resources[].count.value` | `integer` | Yes | — | — |
| `result.data.data[].schema_version` | `1` | Yes | — | Common envelope version. Event-specific shape is selected by event\_type and event\_version. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

> [!NOTE]
>
> This output schema is too large for an inline display. Read the complete live contract with `deepline describe clay_query_audit_logs --json`.

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.