Skip to main content

Audit Logs

1 API call in this section.

List Audit Logs​

System Configuration / Audit Logs
GET/system/audit-logs

Retrieves a paginated list of audit logs with optional filtering. Audit logs track all API requests and responses for security and compliance purposes.

  • User must have 'manage:operations:tenant' permission or be a system admin

Response

  • Returns a paginated list of audit logs

  • Includes pagination metadata (total count, page, limit)

  • Each audit log entry includes:

    • Request details (method, endpoint, data)

    • Response details (status code, data)

    • Actor information (user ID)

    • Timestamps

    • IP address and user agent

Query parameters

ParameterTypeDescription
tenant_idOptionalstring

UUID of the tenant (optional for system admins) (optional for system admins): UUID of the tenant

Example: {{tenant_id}}

actor_idOptionalstring

Filter by user ID who performed the action (optional)

start_dateOptionalstring

Filter by start date (ISO format, optional) Filter by start date (ISO format)

end_dateOptionalstring

Filter by end date (ISO format, optional) Filter by end date (ISO format)

endpointOptionalstring

Filter by API endpoint (optional)

methodOptionalstring

Filter by HTTP method (optional)

status_codeOptionalstring

Filter by HTTP status code (optional)

pageOptionalstring

Page number for pagination (optional, default: 1) Page number for pagination (default: 1)

Example: 1

limitOptionalstring

Number of items per page (optional, default: 10) Number of items per page (default: 10)

Example: 10

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

X-API-Keystring

Example: {{api_key}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/system/audit-logs?tenant_id=${TENANT_ID}&actor_id=&start_date=&end_date=&endpoint=&method=&status_code=&page=1&limit=10" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --header "X-API-Key: ${ONDI_TENANT_API_KEY}"

Response examples

200OK
Response body
json
1{2  "success": true,3  "message": "Audit logs retrieved successfully",4  "audit_logs": [5    {6      "id": "audit-uuid-1",7      "tenant_id": "tenant-uuid",8      "actor_id": "user-uuid-1",9      "endpoint": "/api/deliveries",10      "method": "POST",11      "request_data": {12        "pickup_location": "location-1",13        "delivery_location": "location-2"14      },15      "response_data": {16        "id": "delivery-uuid-1",17        "status": "created"18      },19      "status_code": 201,20      "ip_address": "192.168.1.1",21      "user_agent": "Mozilla/5.0...",22      "created_at": "2023-04-01T10:00:00Z"23    },24    {25      "id": "audit-uuid-2",26      "tenant_id": "tenant-uuid",27      "actor_id": "user-uuid-2",28      "endpoint": "/api/deliveries/delivery-uuid-1",29      "method": "PUT",30      "request_data": {31        "status": "in_transit"32      },33      "response_data": {34        "id": "delivery-uuid-1",35        "status": "in_transit"36      },37      "status_code": 200,38      "ip_address": "192.168.1.2",39      "user_agent": "Mozilla/5.0...",40      "created_at": "2023-04-01T11:30:00Z"41    }42  ],43  "page": 1,44  "limit": 10,45  "total": 246}