ChatKomodo Docs Home Sign in

API reference · Account

Audit log

Read the tenant audit log

GET/v1/audit

Security-relevant and destructive events of the tenant, newest first, kept for 365 days. Recorded actions — account: auth.login (detail otp, totp or access_code), tenant.self_register, profile.update, payment.completed, payment.rejected, payment.unverifiable, expiry.reminder_sent, billing.notifications, ai_reply.update, ai_kb.upload, ai_kb.delete (knowledge documents and web pages for AI replies), ai_kb.faq (saved answers: detail add, edit, delete or answer); stores: store.connect, store.update, store.disconnect; access: api_key.create, api_key.revoke, agent.create, agent.revoke_sessions; privacy: consent.config, consent.bulk, privacy.export, privacy.erase, privacy.retention, contact.bulk_delete; devices: session.create, session.delete; messages: message.send (a message sent by a support agent; sends by the owner or through the API are in the message log instead), message.delete, message.edit, message.unsend; campaigns: blast.create, blast.start, blast.cancel, blast.delete; webhooks: webhook.create, webhook.update, webhook.delete; inbox: chat.assign, chat.resolve, and chat.view (a support agent opening a chat, recorded at most once an hour per agent and chat). target is usually the id of the object concerned and detail a short note; message text is never stored and phone numbers in chat ids are masked. Page through older events by passing next_before and next_before_id of the previous response as before and before_id; the cursor is a pair because a bulk action writes several events in the same millisecond.

Query parameters

  • limitinteger
    Events to return (default 100); larger values are capped at 200
    Default: 100From 1 to 200
  • beforeinteger | null
    Return only events older than this Unix time in milliseconds; use next_before of the previous page
  • before_idinteger | null
    Tie-breaker for before: with an equal timestamp only events with a smaller id are returned; use next_before_id of the previous page

Responses

  • 200Events
    Response fields
    • eventsarray of objectrequired
    • events[].idintegerrequired
      Event id, increasing over time
    • events[].tsintegerrequired
      When it happened, Unix time in milliseconds
    • events[].actor_typestringrequired
      admin (the owner login or an API key), agent, system, or the payment provider (pakasir, creem, paypal)
    • events[].actor_idstring | nullrequired
      Agent id for agent actions; api-key for some actions done with an API key
    • events[].actionstringrequired
    • events[].targetstring | nullrequired
    • events[].detailstring | nullrequired
    • events[].ipstring | nullrequired
      Client IP address, when known
    • next_beforeinteger | nullrequired
      Cursor for the next page (before), or null when this was the last page
    • next_before_idinteger | nullrequired
      Cursor for the next page (before_id), or null when this was the last page
  • 401Missing, invalid or expired credentials
  • 403Forbidden for a customer-service agent login (Agent access is not allowed for this operation) and an API key restricted to specific sessions (KEY_SCOPE_FORBIDDEN)
Request
curl "https://api.chatkomodo.com/v1/audit" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/audit', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/audit",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/audit', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "events": [
    {
      "id": 1,
      "ts": 1767225600000,
      "actor_type": "string",
      "actor_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
      "action": "string",
      "target": "+447700900123",
      "detail": "string",
      "ip": "string"
    }
  ],
  "next_before": 1767225600000,
  "next_before_id": 1
}