List Audit Logs
curl --request GET \
--url https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data.leadlex.com/functions/v1/api-gateway/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://data.leadlex.com/functions/v1/api-gateway/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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data.leadlex.com/functions/v1/api-gateway/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://data.leadlex.com/functions/v1/api-gateway/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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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
Filter by resource type:
contacts, companies, deals, tasks, notes, lists, campaigns, webhooks, api_keys, usersHeaders
Authorization: Bearer wbk_your_admin_key_here
Audit logs are retained for 365 days and are immutable once written.
Response
Show properties
Show properties
Array of audit log entries, newest first.
Show Audit log entry
Show Audit log entry
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 |