Skip to main content
GET
/
audit-logs
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const auditLogEntry of client.auditLogs.list({
  end: '2026-01-02T00:00:00Z',
  start: '2026-01-01T00:00:00Z',
})) {
  console.log(auditLogEntry.user_id);
}
[
  {
    "timestamp": "2023-11-07T05:31:56Z",
    "auth_strategy": "<string>",
    "user_id": "<string>",
    "email": "<string>",
    "status": 123,
    "method": "<string>",
    "path": "<string>",
    "route": "<string>",
    "domain": "<string>",
    "duration_ms": 123,
    "client_ip": "<string>",
    "user_agent": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

start
string<date-time>
required

Lower bound (inclusive) for the audit record timestamp.

Example:

"2026-01-01T00:00:00Z"

end
string<date-time>
required

Upper bound (exclusive) for the audit record timestamp.

Example:

"2026-01-02T00:00:00Z"

auth_strategy
string

Filter by authentication strategy.

service
string

Filter by service name.

method
string

Filter by HTTP method.

exclude_method
string

Filter out results by HTTP method.

Free-text search over path, user ID, email, client IP, and status.

search_user_id
string[]

Additional user IDs to OR into free-text search.

limit
integer
default:100

Maximum number of results to return.

Required range: 1 <= x <= 100
page_token
string

Opaque page token from X-Next-Page-Token for the next page of older records.

Response

A list of audit log records.

timestamp
string<date-time>
required

UTC time when the request was received.

auth_strategy
string
required

Authentication strategy used for the request.

user_id
string
required

ID of the authenticated user, if any.

email
string
required

Email of the authenticated user at request time, if any.

status
integer
required

HTTP response status code.

method
string
required

HTTP method.

path
string
required

Request path.

route
string
required

Matched API route pattern, if available.

domain
string
required

Request host.

duration_ms
integer
required

Request duration in milliseconds.

client_ip
string
required

Client IP address.

user_agent
string
required

User agent header.