{
  "openapi": "3.1.0",
  "info": {
    "title": "nextxch REST & CLI Management API",
    "version": "1.0.0",
    "description": "Schema-driven REST API powering nextxch-cli (/api/admin/cli/*) and high-throughput transactional email delivery (/api/v1/send)."
  },
  "servers": [
    { "url": "https://mail.firma.de", "description": "Self-Hosted nextxch Instance" }
  ],
  "security": [
    { "BearerApiKey": [] }
  ],
  "components": {
    "securitySchemes": {
      "BearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "smk_<id>_<secret>",
        "description": "Scoped API Key minted in /admin/#pApiAuth or via 'nextxch-cli create ApiKey'."
      }
    }
  },
  "paths": {
    "/api/v1/send": {
      "post": {
        "summary": "Send transactional email with category & provider quota governance",
        "operationId": "sendTransactionalEmail"
      }
    },
    "/api/v1/openapi.json": { "get": { "summary": "Full OpenAPI 3.1 document of the integration API v1 of an installation (calendar, rooms, booking, contacts, directory, sharing, webhooks)" } },
    "/api/v1/oauth/token": { "post": { "summary": "OAuth 2.0 client credentials: integration key id + key for a 1 h access token" } },
    "/api/v1/calendar/events": { "get": { "summary": "Occurrences in a window (scope calendar.read)" }, "post": { "summary": "Create an event with attendees and rooms (scope calendar.write)" } },
    "/api/v1/calendar/freebusy": { "post": { "summary": "Free/busy of people, rooms and equipment (scope calendar.read)" } },
    "/api/v1/rooms": { "get": { "summary": "Rooms and resources with availability (scope rooms.read)" } },
    "/api/v1/booking/event-types/{id}/slots": { "get": { "summary": "Free booking slots (scope booking.read)" } },
    "/api/v1/booking/bookings": { "get": { "summary": "Bookings of the user (scope booking.read)" } },
    "/api/v1/contacts": { "get": { "summary": "Contacts (scope contacts.read)" }, "post": { "summary": "Create a contact (scope contacts.write)" } },
    "/api/v1/directory": { "get": { "summary": "Global address list (scope directory.read)" } },
    "/api/v1/sharing/grants": { "get": { "summary": "Grants of the user (scope sharing.manage)" }, "put": { "summary": "Set or remove a grant or delegation (scope sharing.manage)" } },
    "/api/v1/webhooks": { "get": { "summary": "Webhooks (scope webhooks.manage)" }, "post": { "summary": "Register an HMAC-signed webhook (scope webhooks.manage)" } },
    "/api/admin/cli/schema": {
      "get": {
        "summary": "Retrieve machine-readable object schema and X-Nextxch-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" }
    }
  }
}