Query events associated with your organization

get/v1/audit-logs
Requires any one of these rolesAbout roles
org.permission.audit_logs.read
Legacyorg.admin.audit_logs.read

The API key or user must hold at least one of them. Legacy roles still work; prefer the others for new keys.


About this resource

Audit logs

The audit log is a read-only history of what happened in your Kustomer org, such as who changed a conversation, who signed in, and what a routing or business rule did. Each entry records the event, the object it touched, who or what did it, and the fields that changed.

Kustomer writes an audit log entry whenever something notable happens to the data in your org: a conversation or customer is updated or deleted, a user signs in or fails to, a business rule is created, a work item is routed, a message is created. Admins see these entries in the audit log screen of the Kustomer admin settings, and the API exposes the same history so you can export it to a SIEM, investigate an incident, or answer "who changed this, and when?". Entries are created only by Kustomer. You can't write, edit or delete them, and each one expires after a retention period, shown in expiresAt.

What an entry contains

Each entry has type audit_log and these key attributes:

Field Meaning
eventName The full event, such as kustomer.conversation.update or kustomer.user-auth.fail.
eventVerb The action alone, such as create, update or delete.
objectType, objectId The object the event is about.
userId, userType Who did it. userType is system and userId is null when Kustomer itself made the change, for example during routing.
client The part of Kustomer the change came from, such as routing.
ip The caller's IP address, when known.
changes For updates, a diff split into attributes and relationships. Each changed field has op, before and after.
publishedAt, createdAt When the event happened and when it was recorded.

Filtering

Narrow results with filter[objectType] (one of the types in the enum, such as conversation, customer, user, business_rule, work_item or work_session), then optionally filter[objectId] for one object. filter[userId] returns events by or about one user. filter[include] adds more object types to the results with OR logic, and filter[start] and filter[end] limit the date range. How far back you can search depends on your Kustomer plan.

Which endpoint to use

To Call
Search the org's audit history, by object, user or date GET /v1/audit-logs

Results come newest first and use cursor pagination rather than page numbers. count sets the page size (default 100, maximum 1000), and you move through pages with the before and after cursors, which are audit log IDs. The links.next and links.prev URLs in each response already contain the right cursor, so follow them instead of building cursors yourself. Reading the audit log requires the audit log read permission, which is usually limited to admins.

Query parameters

countstring
Example 100
afterstring
Example "12398b37f821774356daa2a5"
beforestring
Example "45698b37f821774356dcc2g1"
filter[objectType]string
One ofbill_subscriptionbusiness_rulecompanyconversationcustomermessagesearchshortcutuserwork_itemip_rulework_sessionshopify_rest
filter[objectId]string
Example "45698b37f821774356dcc2g1"
filter[userId]string
Example "45698b37f821774356dcc2g1"
filter[include]string
Example "user,shortcut,work_item,ip_rule"
filter[start]string
Example "2016-08-06T19:47:49.235Z"
filter[end]string
Example "2016-09-06T19:47:49.235Z"

Responses

OK

objectrequired