API

REST API for programmatic access to SecZim.

Base URL

http://your-server:8080/api/v1

Authentication

All API requests require authentication using your admin password:

curl -H "Authorization: Bearer YOUR_PASSWORD" \ http://your-server:8080/api/v1/stats

Endpoints

GET /stats

Get email statistics.

{ "total_emails": 15234, "accepted": 14500, "rejected": 700, "deferred": 34 }

GET /sessions

List session logs. Supports pagination and filtering.

GET /api/v1/sessions?limit=100&offset=0&action=REJECT

GET /policies

List all policies.

POST /policies

Create a new policy.

{ "name": "Block Spam Domain", "sender": "@spam.com", "action": "REJECT", "priority": 50, "active": true }

GET /acl

List ACL entries (whitelist/blacklist).

POST /acl

Add ACL entry.

Response Codes

  • 200 - Success
  • 201 - Created
  • 400 - Bad request
  • 401 - Unauthorized
  • 404 - Not found
  • 500 - Server error

Rate Limiting

API requests are limited to 100 requests per minute per IP.