<!-- ZenPays documentation · https://docs.zenpayz.com/docs/reference/objects/security-event -->

# The SecurityEvent object

Represents a security-related event in the audit log. Security events track authentication attempts, configuration changes, and suspicious activities for compliance and investigation purposes.

## Fields

<ParamTable
  label="Field"
  rows={[
    { name: "id", type: "string", required: true, desc: "Unique identifier for the event" },
    { name: "merchantId", type: "string", required: true, desc: "ID of the merchant this event relates to" },
    { name: "type", type: "SecurityEventType", required: true, desc: "Type of security event [SecurityEventType](/docs/reference/enums/security-events)" },
    { name: "severity", type: "'info' | 'warning' | 'critical'", required: true, desc: "Severity level of the event" },
    { name: "description", type: "string", required: true, desc: "Human-readable description of the event" },
    { name: "ipAddress", type: "string", required: false, desc: "IP address associated with the event" },
    { name: "userAgent", type: "string", required: false, desc: "User agent string from the request" },
    { name: "userId", type: "string", required: false, desc: "ID of the user who triggered the event" },
    { name: "metadata", type: "Record<string, unknown>", required: false, desc: "Additional event-specific data" },
    { name: "createdAt", type: "string", required: true, desc: "ISO 8601 timestamp when the event occurred" },
  ]}
/>

## Example

```json
{
  "id": "obj_1a2b3c",
  "merchantId": "merchant_1a2b3c",
  "type": "login_success",
  "severity": "info",
  "description": "string",
  "ipAddress": "string",
  "userAgent": "string",
  "userId": "user_1a2b3c",
  "createdAt": "2026-01-15T09:30:00Z"
}
```
