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, otp+totp, totp, access_code or passkey), auth.new_device, auth.step_up (a browser the owner never used asked for the passkey or authenticator code; detail = how the sign-in started), security.require_totp, security.idle_signout (automatic sign-out; detail = minutes, 0 = off), security.sign_out, security.sign_out_all, security.passkey_add, security.passkey_remove, auth.refresh_reuse (a dashboard login token was used twice, so the session was signed out), auth.agency_sign_in (your agency opened your dashboard; detail = agency id), 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.update, api_key.rotate, api_key.revoke, api_key.ip_denied (a request from an address not on the key's allow-list; at most once an hour per address), api_key.new_location (first use from a new country), api_key.usage_spike (a key made far more requests in an hour than it usually does; at most once a day per key), api_key.rotate_reminder, agent.create, agent.revoke_sessions; privacy: consent.config, consent.bulk, privacy.export, privacy.erase, privacy.retention, privacy.archive, privacy.archive_download, privacy.archive_delete, account.export (the owner downloaded all business data), account.deletion_requested (detail = when the deletion runs), account.deletion_cancelled, contact.bulk_delete; devices: session.create, session.delete, session.limits; agency (resellers): agency.brand, agency.domain, agency.client_create, agency.client_plan, agency.client_suspend, agency.client_activate, agency.client_delete, agency.client_sign_in, agency.topup; 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.schedule ("send later" from a chat), message.delete, message.edit, message.unsend; campaigns: blast.create, blast.start, blast.risk_accepted (a high-risk broadcast started anyway; detail = score), blast.ab_decide (the owner sent an A/B variant early; detail = A or B), blast.cancel, blast.delete; webhooks: webhook.create, webhook.update, webhook.delete, webhook.paused_failing (an endpoint paused after 50 failed deliveries in a row), link.create, link.update, link.delete, payments.settings, payments.payout_account (the bank account for payouts changed; detail = bank and the last digits), payments.payout_request (detail = amount), payments.disconnect, invoice.create, invoice.cancel, invoice.resend, invoice.export, reports.weekly_summary, leads.lost_auto_analyze (the AI reads every lost lead: detail on or off), leads.lesson_applied (a lesson from lost leads became a saved answer or a guideline for the AI; detail = faq or guidance), leads.lesson_removed; inbox: chat.assign, chat.resolve, chat.reopen (a closed chat opened again by hand), chat.note_delete (an internal note was deleted), chat.snooze, chat.unsnooze, chat.export (a conversation was downloaded; detail = number of entries), settings.reply_alert (alerts for unanswered chats), 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 (sumopod, 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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/audit", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
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
}