{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-audit-log-schema.json",
  "title": "AuditLog",
  "description": "An immutable record of an action performed via the API.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-audit-logs-api-openapi.yml#/components/schemas/AuditLog",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "action": {
      "type": "string",
      "description": "The action that was performed. CRUD actions use bare verbs\n(`create`, `update`, `delete`, `rotate`, `revoke`); feature areas\nuse dotted actions (e.g. `vault.detokenize`, `transit.encrypt`,\n`pki.leaf.issue`, `webhook.test`, `client_token.mint.decrypt`).\n"
    },
    "resource_type": {
      "type": "string",
      "description": "The type of resource the action was performed on (e.g. `route`,\n`route_environment_config`, `secret`, `client`, `client_credential`,\n`environment`, `api_key`, `webhook`, `oauth_client`, `agent`,\n`transit`, `vault`, `pki`, `dyn_db_cred`, `ephemeral_proxy`,\n`client_capability_token`).\n"
    },
    "resource_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "UUID of the affected resource."
    },
    "details": {
      "type": [
        "object",
        "null"
      ],
      "description": "Additional context about the action (e.g. changed field names, resource name).\nAlways sanitised: values under credential-shaped keys are replaced with\n`***REDACTED***` and `user:password@` userinfo is removed from URLs.\nIdentifiers are kept (a UUID under an `*_id` key, such as the acting\n`api_key_id`). When the caller may not read audit details this is an\nempty object and `details_redacted` is `true`. It is always an object\n(or null), never a string: an entry whose stored details are not a JSON\nobject (a bare string, array or number from a self-hosted agent) is\nreturned sanitised and wrapped as `{\"value\": ...}`.\n",
      "additionalProperties": true
    },
    "details_redacted": {
      "type": "boolean",
      "description": "`true` when `details` was withheld from this caller (it is then `{}`).\nA user-bound token needs its holder's `audit_log:read_details` permission\n(Admin or Owner) to see `details`. API keys and OAuth clients holding\n`audit_log:list` always receive sanitised `details`.\n"
    },
    "ip_address": {
      "type": [
        "string",
        "null"
      ],
      "description": "IP address of the API caller."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of when the action occurred."
    }
  }
}