{
  "openapi": "3.0.3",
  "info": {
    "title": "Quorum Digital demonstration echo",
    "version": "2026-10-14",
    "description": "One read-only route for demonstration. It echoes a short message and does not store it. It is not a client login and it does not call the account API. The full Worker spec stays in the repository at api-spec/openapi.yaml.",
    "contact": {
      "name": "Quorum Digital",
      "url": "https://quorumdigital.co.uk/developers",
      "email": "ceo@quorumdigital.co.uk"
    }
  },
  "servers": [
    {
      "url": "https://quorumdigital.co.uk",
      "description": "Production marketing site"
    },
    {
      "url": "http://127.0.0.1:8787",
      "description": "Local wrangler dev"
    }
  ],
  "paths": {
    "/api/demo/echo": {
      "get": {
        "operationId": "demoEcho",
        "summary": "Echo a short message (for demonstration)",
        "description": "Optional query parameter message. Control characters are removed, then the value is trimmed and cut to 120 characters. A missing or blank message is returned as hello. Other query parameters are ignored. Rate limit: 30 calls from one network (CF-Connecting-IP) each 60 seconds, in one Worker isolate. The next call is HTTP 429 with Retry-After.",
        "parameters": [
          {
            "name": "message",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "example": "hello"
          }
        ],
        "responses": {
          "200": {
            "description": "The echoed message.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["ok", "demo", "purpose", "echo", "rateLimit"],
                  "properties": {
                    "ok": { "type": "boolean", "enum": [true] },
                    "demo": { "type": "boolean", "enum": [true] },
                    "purpose": { "type": "string", "enum": ["demonstration"] },
                    "echo": { "type": "string", "maxLength": 120 },
                    "rateLimit": {
                      "type": "object",
                      "required": ["limit", "windowSeconds"],
                      "properties": {
                        "limit": { "type": "integer", "enum": [30] },
                        "windowSeconds": { "type": "integer", "enum": [60] }
                      }
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "demo": true,
                  "purpose": "demonstration",
                  "echo": "hello",
                  "rateLimit": { "limit": 30, "windowSeconds": 60 }
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed. Allow: GET.",
            "content": {
              "application/json": {
                "example": {
                  "error": { "code": "method_not_allowed", "message": "Method not allowed" }
                }
              }
            }
          },
          "429": {
            "description": "Too many demo calls from this network. Wait a minute and try again. Retry-After is the number of seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": { "type": "integer", "minimum": 1 }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many demo calls from this network. Wait a minute and try again."
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
