Skip to main content
GET
/
api
/
audit-logs
cURL
curl --request GET \
  --url https://app.cotool.ai/api/audit-logs \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "<string>",
    "timestamp": "<string>",
    "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "event": "<string>",
    "actor": "<string>",
    "userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "ipAddress": "<string>",
    "chatId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "data": {},
    "createdAt": "<string>",
    "user": {
      "email": "<string>"
    },
    "agent": {
      "name": "<string>"
    },
    "trigger": {
      "name": "<string>",
      "type": "<string>"
    }
  }
]

Authorizations

Authorization
string
header
required

API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here

Query Parameters

userId
string

Filter audit logs by specific user ID

Minimum length: 1
event
string

Filter audit logs by event type (e.g., user.login, agent.runStarted)

actor
string

Filter audit logs by actor type (user, agent, chat)

chatId
string

Filter audit logs by specific chat ID

Minimum length: 1
agentId
string

Filter audit logs by specific agent ID

Minimum length: 1
startDate
string

Filter audit logs from this date onwards (ISO string format)

endDate
string

Filter audit logs up to this date (ISO string format)

limit
integer
default:50

Maximum number of audit logs to return (1-100, default: 50)

Required range: 1 <= x <= 100
offset
integer
default:0

Number of audit logs to skip for pagination (default: 0)

Required range: x >= 0
sortBy
enum<string>
default:timestamp

Field to sort audit logs by (default: timestamp)

Available options:
timestamp,
createdAt
sortDirection
enum<string>
default:desc

Sort direction for audit logs (default: desc)

Available options:
asc,
desc

Response

200 - application/json

Successful response

Array of audit log entries matching the specified filters

id
string
required

Unique identifier for this audit log entry

Minimum length: 1
timestamp
string
required

When the audited event occurred

organizationId
string<uuid>
required

Organization where the event took place

event
string
required

Type of event that was audited (e.g., user.login, agent.runStarted)

actor
string
required

Who or what performed the action (user, agent, chat)

userId
string<uuid> | null
required

ID of the user involved in the event (null if not applicable)

ipAddress
string | null
required

IP address where the event originated (null if not applicable)

chatId
string<uuid> | null
required

ID of the chat involved in the event (null if not applicable)

agentId
string<uuid> | null
required

ID of the agent involved in the event (null if not applicable)

runId
string<uuid> | null
required

ID of the agent run involved in the event (null if not applicable)

triggerId
string<uuid> | null
required

ID of the trigger involved in the event (null if not applicable)

data
object | null
required

Additional event-specific data (null if no extra data)

createdAt
string
required

When this audit log entry was created in the database

user
object

Hydrated user information (included when available)

agent
object

Hydrated agent information (included when available)

trigger
object

Hydrated trigger information (included when available)