{
  "openapi": "3.1.0",
  "info": {
    "title": "SharpMailserver REST & CLI Management API",
    "version": "1.2.5",
    "description": "Schema-driven REST API powering sharpmail-cli (/api/admin/cli/*) and high-throughput transactional email delivery (/api/v1/send)."
  },
  "servers": [
    { "url": "https://mail.firma.de", "description": "Self-Hosted SharpMailserver Instance" }
  ],
  "security": [
    { "BearerApiKey": [] }
  ],
  "components": {
    "securitySchemes": {
      "BearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "smk_<id>_<secret>",
        "description": "Scoped API Key minted in /admin/#pApiAuth or via 'sharpmail-cli create ApiKey'."
      }
    }
  },
  "paths": {
    "/api/v1/send": {
      "post": {
        "summary": "Send transactional email with category & provider quota governance",
        "operationId": "sendTransactionalEmail"
      }
    },
    "/api/admin/cli/schema": {
      "get": {
        "summary": "Retrieve machine-readable object schema and X-SharpMail-Schema-Version hash",
        "operationId": "getCliSchema"
      }
    },
    "/api/admin/cli/objects/{type}": {
      "get": { "summary": "Query/filter objects of a given type (Tenant, Domain, Account, Alias, ApiKey, Route, Singletons)" },
      "post": { "summary": "Create a new object (Tenant, Domain, Account/User, Account/List, Alias, ApiKey, Route)" }
    },
    "/api/admin/cli/objects/{type}/{idOrName}": {
      "get": { "summary": "Get single object by primary key/email/slug/GUID or 'singleton'" },
      "patch": { "summary": "Partially update object or singleton policy in 0 ms without service restart" },
      "delete": { "summary": "Delete alias/route, revoke ApiKey, or soft-delete Account/Domain" }
    },
    "/api/admin/cli/dns/{domain}": {
      "get": { "summary": "Live DNS verification (MX, SPF, Dual-DKIM, DMARC, MTA-STS, DANE) or RFC 1035 BIND zone export" }
    },
    "/api/admin/cli/snapshot": {
      "get": { "summary": "Export idempotent NDJSON declarative state snapshot" }
    },
    "/api/admin/cli/apply": {
      "post": { "summary": "Validate (--dry-run) or apply declarative NDJSON infrastructure plan" }
    }
  }
}