---
title: "Count audit logs"
method: GET
path: "/api/audit-logs/count"
tags: ["Audit Logs"]
---

# Count audit logs

`GET /api/audit-logs/count`

## Request

- Base URL: `https://app.cotool.ai`
- URL: `https://app.cotool.ai/api/audit-logs/count`
- Auth: HTTP bearer

Return the total number of audit-log records that match a set of optional filters.

## Query parameters

- `userId` string: Count audit logs for specific user ID
- `event` string: Count audit logs for specific event type (e.g., user.login, agent.runStarted)
- `actor` string: Count audit logs for specific actor type (user, agent, chat)
- `chatId` string: Count audit logs for specific chat ID
- `agentId` string: Count audit logs for specific agent ID
- `triggerId` string: Count audit logs for specific trigger ID
- `toolGroup` string: Count audit logs for a specific tool family (matches data.toolId equal to the value or starting with "<value>_")
- `mcpConnectionId` string, uuid: Count audit logs for one MCP app connection (via.connectionId or data.mcpApp.connectionId)
- `startDate` string: Count audit logs from this date onwards (ISO string format)
- `endDate` string: Count audit logs up to this date (ISO string format)
- `search` string: Text search across event type, actor, user email, agent name, and data fields

## Response `200`

Successful response

- object: Count of audit log entries
  - `count` number, required: Total number of audit log entries matching the specified filters

## Other responses

- `400`: Bad request — input validation failed or the request was malformed
- `401`: Unauthorized — missing or invalid API key / session
- `403`: Forbidden — the authenticated user lacks the required permissions
- `500`: Internal server error

---

[API](https://skmtc.dev/cotool/apis/cotool-api.md) - [All operations](https://skmtc.dev/cotool/apis/cotool-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cotool/apis/cotool-api/revisions/f5abe0add203?raw)
