List the workspace's audit events.
curl --request GET \
--url https://{workspace}.klef.ai/api/audit \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/audit"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/audit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{workspace}.klef.ai/api/audit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{workspace}.klef.ai/api/audit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/audit")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"action": "entity_insert",
"actorUserId": "<string>",
"actorName": "<string>",
"actorType": "user",
"targetType": "workspace",
"targetId": "<string>",
"targetLabel": "<string>",
"data": {},
"traceId": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>"
}
],
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
],
"pagination": {
"nextCursor": 123,
"limit": 123,
"hasMore": true,
"total": 123
}
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}Audit
List the workspace's audit events.
GET
/
audit
List the workspace's audit events.
curl --request GET \
--url https://{workspace}.klef.ai/api/audit \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/audit"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/audit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{workspace}.klef.ai/api/audit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{workspace}.klef.ai/api/audit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/audit")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"action": "entity_insert",
"actorUserId": "<string>",
"actorName": "<string>",
"actorType": "user",
"targetType": "workspace",
"targetId": "<string>",
"targetLabel": "<string>",
"data": {},
"traceId": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>"
}
],
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
],
"pagination": {
"nextCursor": 123,
"limit": 123,
"hasMore": true,
"total": 123
}
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}Authorizations
cookieAuthapiKeyAuth
Cookie-based session. Obtain by completing the /auth/login/{provider} OAuth flow; the /auth/callback response sets the klef.session cookie that subsequent requests send automatically.
Query Parameters
The catalog of every audit verb: entity-change CRUD plus explicitly-recorded activities.
Available options:
entity_insert, entity_update, entity_delete, workspace_onboarded, member_invited, member_role_changed, member_removed, invitation_revoked, invitation_resent, invitation_accepted, workspace_accessed, audit_retention_changed, workspace_deletion_scheduled, workspace_restored, workspace_exported, workspace_purged, connection_created, connection_updated, connection_deleted, connection_secret_revealed, workspace_secret_created, workspace_secret_updated, workspace_secret_deleted, workspace_secret_revealed, inbox_item_resolved, inbox_items_resolved_all, api_key_created, api_key_rotated, api_key_revoked, policy_created, policy_updated, policy_enabled, policy_disabled, policy_deleted, subscription_checkout_started, subscription_plan_changed, subscription_cancellation_scheduled, subscription_cancellation_cleared, subscription_status_changed, agent_credit_checkout_started, agent_credits_purchased, agent_credits_adjusted, signed_in, signed_out, workers_exported, audit_events_exported, target_account_provisioned, target_account_updated, target_account_adopted, target_account_detached, target_account_grants_changed, target_account_link_changed, target_account_forgotten, target_account_claims_changed, target_account_elements_changed, target_account_element_ended, agent_turn_requested, agent_turn_answered, agent_turn_failed, agent_tool_called, agent_change_proposed, agent_change_applied, worker_record_viewed, sync_plan_approved, sync_plan_auto_approved, scheduled_approval_changed, password_set, temporary_access_pass_issued, first_sign_in_link_sent, first_sign_in_link_opened, recipient_code_requested, recipient_proven, recipient_refused, first_sign_in_revealed, password_reset_requested Required string length:
3 - 100What an audited activity acted upon. Entity-change records carry the CLR type name of the row that moved instead, and are never read back out of the audit log.
Available options:
workspace, workspace_connection, workspace_secret, membership, invitation, api_key, inbox_item, policy, billing, session, data_export, target_account, agent_turn, worker, sync_plan Maximum string length:
200Response
OK
The envelope for a collection response: IReadOnlyList<T> ApiCollectionResponse<T>.Results.
Was this page helpful?