List Audit Logs
curl --request GET \
--url https://api.example.com/v1/audit-logsimport requests
url = "https://api.example.com/v1/audit-logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/audit-logs', 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://api.example.com/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/audit-logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"logs": [
{
"id": "<string>",
"timestamp": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"type": "<string>"
},
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"details": {},
"ip_address": "<string>",
"user_agent": "<string>"
}
]
},
"meta": {
"page": 123,
"per_page": 123,
"total": 123
}
}Audit Logs
List Audit Logs
Retrieve the workspace audit trail for compliance and security investigations (admin-only)
GET
/
v1
/
audit-logs
List Audit Logs
curl --request GET \
--url https://api.example.com/v1/audit-logsimport requests
url = "https://api.example.com/v1/audit-logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/audit-logs', 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://api.example.com/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/audit-logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"logs": [
{
"id": "<string>",
"timestamp": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"type": "<string>"
},
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"details": {},
"ip_address": "<string>",
"user_agent": "<string>"
}
]
},
"meta": {
"page": 123,
"per_page": 123,
"total": 123
}
}Returns a paginated, filterable log of every write action performed in the workspace — API calls, user actions, and automations. Essential for SOC 2, ISO 27001, and internal forensics.
This endpoint requires an admin API key. Standard API keys receive a
403 insufficient_permissions response.Request
Query Parameters
integer
default:"1"
Page number for pagination
integer
default:"50"
Entries per page (max: 200)
string
Filter by action:
create, update, delete, login, api_accessstring
Filter by the UUID of the acting user (human user only — API keys are filtered separately)
string
Filter by resource type:
contacts, companies, deals, tasks, notes, lists, campaigns, webhooks, api_keys, usersstring
Only entries on or after this ISO 8601 date/timestamp
string
Only entries on or before this ISO 8601 date/timestamp
Headers
Authorization: Bearer wbk_your_admin_key_here
Audit logs are retained for 365 days and are immutable once written.
Response
object
Show properties
Show properties
array
Array of audit log entries, newest first.
Show Audit log entry
Show Audit log entry
string
Log entry UUID
string
ISO 8601 timestamp of the action
object
string
Action performed:
create, update, delete, login, api_accessstring
Resource name (e.g.,
contacts)string
UUID of the affected resource
object
Action-specific metadata (HTTP method, path, request ID, diff, etc.)
string
Client IP address (IPv4 or IPv6)
string
Client user-agent string
object
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs?action=delete&from_date=2026-04-01&per_page=100" \
-H "Authorization: Bearer wbk_your_admin_key_here"
import requests
ADMIN_KEY = "wbk_your_admin_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
response = requests.get(
f"{BASE_URL}/v1/audit-logs",
headers={"Authorization": f"Bearer {ADMIN_KEY}"},
params={
"action": "delete",
"from_date": "2026-04-01",
"per_page": 100,
},
)
logs = response.json()["data"]["logs"]
for log in logs:
print(f"{log['timestamp']} {log['user']['email']} {log['action']} {log['resource_type']}/{log['resource_id']}")
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs?action=delete&from_date=2026-04-01&per_page=100',
{ headers: { 'Authorization': 'Bearer wbk_your_admin_key_here' } }
);
const { data, meta } = await response.json();
console.log(`Showing ${data.logs.length} of ${meta.total} entries`);
Example Response
{
"data": {
"logs": [
{
"id": "log_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"timestamp": "2026-04-17T14:23:05Z",
"user": {
"id": null,
"email": "api-key:wbk_abc12345",
"type": "api_key"
},
"action": "delete",
"resource_type": "contacts",
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
"details": {
"method": "DELETE",
"path": "/v1/contacts/123e4567-e89b-12d3-a456-426614174000",
"request_id": "req_9f8e7d6c5b4a",
"status_code": 200
},
"ip_address": "203.0.113.45",
"user_agent": "MyApp/1.0 (python-requests/2.31)"
}
]
},
"meta": {
"page": 1,
"per_page": 100,
"total": 1247
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | admin_key_required | This endpoint requires an admin-scoped API key |
| 400 | invalid_date_range | from_date is after to_date |
| 429 | rate_limited | Rate limit exceeded |