Skip to main content
GET
/
api
/
v1
/
audit-logs
/
entity
/
{entity_type}
/
{entity_id}
# Get all audit logs for a specific API key
curl "https://api.fileguard.io/api/v1/audit-logs/entity/api_key/key_m1n2o3p4q5r6" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "data": [
      {
        "audit_id": "aud_c3d4e5f6g7h8",
        "audit_type": "api_key",
        "action": "enabled",
        "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": "disabled",
          "new_status": "active"
        },
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0...",
        "created_at": "2026-01-17T16:00:00Z"
      },
      {
        "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"
      },
      {
        "audit_id": "aud_x9y0z1a2b3c4",
        "audit_type": "api_key",
        "action": "created",
        "entity_type": "api_key",
        "entity_id": "key_m1n2o3p4q5r6",
        "entity_name": "Production Upload Key",
        "performed_by_id": "key_admin123",
        "performed_by_name": "Admin Dashboard Key",
        "performed_by_email": null,
        "performed_by_type": "api_key",
        "performed_by_scopes": ["admin"],
        "details": {
          "scopes": ["upload", "download", "metadata"],
          "expires_in_days": 365
        },
        "ip_address": "10.0.0.1",
        "user_agent": "python-requests/2.28.0",
        "created_at": "2026-01-10T10:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_items": 3,
      "total_pages": 1,
      "has_next": false,
      "has_previous": false
    }
  },
  "timestamp": "2026-01-17T17: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 all audit logs for a specific entity (e.g., all actions performed on an API key).

Path Parameters

entity_type
string
required
Entity type: api_key, file, context
entity_id
string
required
Entity identifier (e.g., key_m1n2o3p4q5r6)

Query Parameters

page
integer
default:"1"
Page number
page_size
integer
default:"20"
Items per page (1-100)
# Get all audit logs for a specific API key
curl "https://api.fileguard.io/api/v1/audit-logs/entity/api_key/key_m1n2o3p4q5r6" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "data": [
      {
        "audit_id": "aud_c3d4e5f6g7h8",
        "audit_type": "api_key",
        "action": "enabled",
        "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": "disabled",
          "new_status": "active"
        },
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0...",
        "created_at": "2026-01-17T16:00:00Z"
      },
      {
        "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"
      },
      {
        "audit_id": "aud_x9y0z1a2b3c4",
        "audit_type": "api_key",
        "action": "created",
        "entity_type": "api_key",
        "entity_id": "key_m1n2o3p4q5r6",
        "entity_name": "Production Upload Key",
        "performed_by_id": "key_admin123",
        "performed_by_name": "Admin Dashboard Key",
        "performed_by_email": null,
        "performed_by_type": "api_key",
        "performed_by_scopes": ["admin"],
        "details": {
          "scopes": ["upload", "download", "metadata"],
          "expires_in_days": 365
        },
        "ip_address": "10.0.0.1",
        "user_agent": "python-requests/2.28.0",
        "created_at": "2026-01-10T10:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_items": 3,
      "total_pages": 1,
      "has_next": false,
      "has_previous": false
    }
  },
  "timestamp": "2026-01-17T17:00:00Z"
}

Use Cases

  • Security Investigation: See who made changes to an API key
  • Compliance Reporting: Document the full history of a resource
  • Change Tracking: Understand when and why settings were modified