List Audit Logs
curl --request GET \
--url https://api.example.com/api/audit/ \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/api/audit/"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/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://api.example.com/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_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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/api/audit/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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/api/audit/")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/audit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"total": 123,
"page": 123,
"pageSize": 123,
"totalPages": 123
}Audit
List Audit Logs
List audit logs with pagination (admin only)
GET
/
api
/
audit
/
List Audit Logs
curl --request GET \
--url https://api.example.com/api/audit/ \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/api/audit/"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/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://api.example.com/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_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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/api/audit/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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/api/audit/")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/audit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"total": 123,
"page": 123,
"pageSize": 123,
"totalPages": 123
}Authentication
string
required
Bearer token:
Bearer <admin_token>Query Parameters
integer
default:"1"
Page number
integer
default:"20"
Items per page (max 100)
Example Request
curl "https://api.sari-platform.com/api/audit/?page=1&pageSize=20" \
-H "Authorization: Bearer <admin_token>"
Response
array
Array of audit log entries
integer
Total number of logs
integer
Current page
integer
Items per page
integer
Total pages available
Example Response
{
"data": [
{
"id": "log-uuid",
"message": {
"action": "api_call",
"client_id": "client_abc",
"collection_id": "collection-uuid",
"method": "GET",
"endpoint": "/users",
"status_code": 200,
"duration_ms": 150
},
"timestamp": "2024-01-15T10:00:00Z"
}
],
"total": 150,
"page": 1,
"pageSize": 20,
"totalPages": 8
}
Errors
| Status | Description |
|---|---|
| 401 | Invalid or expired token |
| 403 | Admin access required |
⌘I

