{
  "openapi": "3.1.0",
  "info": {
    "title": "Envolt Mail website interfaces",
    "version": "1.0.0",
    "description": "The public website's own endpoints. Envolt Mail itself is in development; its agent API runs in staging only and is not open."
  },
  "servers": [
    {
      "url": "https://envoltmail.com"
    }
  ],
  "paths": {
    "/api/early-access": {
      "post": {
        "summary": "Request early access (store-only)",
        "description": "Needs a Cloudflare Turnstile token from the form on /contact, so agents should give the person the link instead.",
        "operationId": "requestEarlyAccess",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "role",
                  "token"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254
                  },
                  "role": {
                    "enum": [
                      "builder",
                      "owner",
                      "recipient",
                      "other"
                    ]
                  },
                  "provider": {
                    "enum": [
                      "google",
                      "microsoft",
                      "zoho",
                      "fastmail",
                      "self",
                      "other",
                      ""
                    ]
                  },
                  "agents": {
                    "enum": [
                      "0",
                      "1",
                      "2-5",
                      "6-20",
                      "20+",
                      ""
                    ]
                  },
                  "worry": {
                    "enum": [
                      "injection",
                      "wrong-send",
                      "trust",
                      "deliverability",
                      "cost",
                      "other",
                      ""
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/feedback": {
      "post": {
        "summary": "Say whether a page was clear (store-only, anonymous)",
        "operationId": "pageFeedback",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "page",
                  "helpful"
                ],
                "properties": {
                  "page": {
                    "type": "string",
                    "pattern": "^/[a-z0-9/-]{0,80}$"
                  },
                  "helpful": {
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 300
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "An error with a short code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "Model Context Protocol (JSON-RPC 2.0, read-only)",
        "description": "Tools: get_status, search_docs, verify_agent_seal. See /.well-known/mcp.json.",
        "operationId": "mcp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A JSON-RPC response"
          },
          "202": {
            "description": "A notification was accepted"
          }
        }
      }
    }
  }
}
