Skip to main content
GET
/
api
/
audit
List Audit Logs
curl --request GET \
  --url https://api.example.com/api/audit/ \
  --header 'Authorization: <authorization>'
{
  "data": [
    {}
  ],
  "total": 123,
  "page": 123,
  "pageSize": 123,
  "totalPages": 123
}

Authentication

Authorization
string
required
Bearer token: Bearer <admin_token>

Query Parameters

page
integer
default:"1"
Page number
pageSize
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

data
array
Array of audit log entries
total
integer
Total number of logs
page
integer
Current page
pageSize
integer
Items per page
totalPages
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

StatusDescription
401Invalid or expired token
403Admin access required