Skip to main content
GET
/
api
/
v1
/
audit-logs
# Get all audit logs
curl "https://api.fileguard.io/api/v1/audit-logs" \
  -H "Authorization: Bearer fg_your_api_key"

# Filter by type and action
curl "https://api.fileguard.io/api/v1/audit-logs?audit_type=api_key&action=revoked" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "data": [
      {
        "audit_id": "aud_a1b2c3d4e5f6",
        "audit_type": "api_key",
        "action": "disabled",
        "entity_type": "api_key",
        "entity_id": "key_m1n2o3p4q5r6",
        "entity_name": "Production Upload Key",
        "performed_by_id": "usr_xyz789",
        "performed_by_name": "John Admin",
        "performed_by_email": "john@company.com",
        "performed_by_type": "user",
        "performed_by_scopes": ["admin"],
        "details": {
          "previous_status": "active",
          "new_status": "disabled"
        },
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0...",
        "created_at": "2026-01-17T14:30:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_items": 50,
      "total_pages": 3,
      "has_next": true,
      "has_previous": false
    }
  },
  "timestamp": "2026-01-17T15:00:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://fileguard.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Get paginated audit logs with optional filtering.

Query Parameters

page
integer
default:"1"
Page number
page_size
integer
default:"20"
Items per page (1-100)
audit_type
string
Filter by type: api_key, file, context, tenant
action
string
Filter by action: created, enabled, disabled, revoked, updated, deleted
entity_id
string
Filter by specific entity ID
# Get all audit logs
curl "https://api.fileguard.io/api/v1/audit-logs" \
  -H "Authorization: Bearer fg_your_api_key"

# Filter by type and action
curl "https://api.fileguard.io/api/v1/audit-logs?audit_type=api_key&action=revoked" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "data": [
      {
        "audit_id": "aud_a1b2c3d4e5f6",
        "audit_type": "api_key",
        "action": "disabled",
        "entity_type": "api_key",
        "entity_id": "key_m1n2o3p4q5r6",
        "entity_name": "Production Upload Key",
        "performed_by_id": "usr_xyz789",
        "performed_by_name": "John Admin",
        "performed_by_email": "john@company.com",
        "performed_by_type": "user",
        "performed_by_scopes": ["admin"],
        "details": {
          "previous_status": "active",
          "new_status": "disabled"
        },
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0...",
        "created_at": "2026-01-17T14:30:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_items": 50,
      "total_pages": 3,
      "has_next": true,
      "has_previous": false
    }
  },
  "timestamp": "2026-01-17T15:00:00Z"
}

Audit Types

TypeDescription
api_keyAPI key operations (create, enable, disable, revoke)
fileFile operations
contextContext operations
tenantTenant operations

Actions

ActionDescription
createdEntity was created
enabledEntity was enabled
disabledEntity was disabled
revokedEntity was revoked
updatedEntity was updated
deletedEntity was deleted

Performer Types

TypeDescription
userDashboard user (JWT auth)
api_keyAPI key (programmatic access)
systemSystem operation

Compliance-First Design

Performer details are snapshotted at action time:
  • performed_by_name - Name at time of action
  • performed_by_email - Email at time of action
  • performed_by_scopes - Permissions at time of action
This ensures accurate audit trails even if user information changes later.