{
  "openapi": "3.1.0",
  "info": {
    "title": "Roosevelt 2028 — Public Content API",
    "version": "1.0.0",
    "description": "Public, unauthenticated read endpoints for the Roosevelt 2028 presidential campaign site. The site is brochure-ware; the canonical machine-readable surface is a set of feeds (JSON Feed, RSS, Atom) and XML sitemaps. There is no write API.",
    "contact": {
      "name": "Roosevelt 2028 Press Office",
      "email": "press@electteddy.com",
      "url": "https://electteddy.netlify.app"
    },
    "license": {
      "name": "All Rights Reserved with Quotation",
      "url": "https://electteddy.netlify.app/llms.txt"
    },
    "termsOfService": "https://electteddy.netlify.app/.well-known/ai.json"
  },
  "servers": [
    { "url": "https://electteddy.netlify.app", "description": "Production" }
  ],
  "tags": [
    { "name": "Feeds",        "description": "Machine-readable feeds of campaign content." },
    { "name": "Sitemaps",     "description": "XML sitemaps of pages." },
    { "name": "Discovery",    "description": "Agent / AI discovery files." },
    { "name": "Subscription", "description": "Newsletter / dispatch subscription." },
    { "name": "MCP",          "description": "Model Context Protocol endpoint." }
  ],
  "security": [
    { "ApiKeyHeader": [] },
    {}
  ],
  "paths": {
    "/api/subscribe": {
      "post": {
        "tags": ["Subscription"],
        "summary": "Subscribe to campaign dispatches",
        "description": "Primary write action — submit an email address to receive campaign news. Accepts an optional `X-API-Key` header for authenticated agent submissions; unauthenticated submissions are also accepted.",
        "operationId": "subscribeToDispatches",
        "x-primary-action": true,
        "x-agent-action": "primary",
        "security": [{ "ApiKeyHeader": [] }, {}],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SubscribeRequest" },
              "examples": {
                "basic": { "value": { "email": "press@yourpublication.com" } }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Subscription accepted",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SubscribeResponse" }
              }
            }
          },
          "422": { "description": "Invalid email" }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "tags": ["MCP"],
        "summary": "Model Context Protocol endpoint",
        "description": "JSON-RPC 2.0 over HTTP. Supports `initialize`, `tools/list`, `tools/call`, `ping`. See https://modelcontextprotocol.io/.",
        "operationId": "mcpRpc",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "type": "object", "description": "JSON-RPC 2.0 request (or batch)." }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      },
      "get": {
        "tags": ["MCP"],
        "summary": "MCP discovery (server info + tool list)",
        "operationId": "mcpDiscover",
        "responses": {
          "200": { "description": "Server info + tool list", "content": { "application/json": { "schema": { "type": "object" } } } }
        }
      }
    },
    "/feed.json": {
      "get": {
        "tags": ["Feeds"],
        "summary": "JSON Feed of campaign news dispatches",
        "description": "JSON Feed v1.1 document containing recent campaign news. Best general-purpose feed for agents.",
        "operationId": "listNews",
        "responses": {
          "200": {
            "description": "JSON Feed document",
            "content": { "application/feed+json": { "schema": { "$ref": "#/components/schemas/JsonFeed" } } },
            "headers": {
              "Cache-Control": { "schema": { "type": "string", "example": "public, max-age=300" } },
              "Access-Control-Allow-Origin": { "schema": { "type": "string", "example": "*" } }
            }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "tags": ["Feeds"],
        "summary": "RSS feed of campaign news dispatches",
        "operationId": "listNewsRss",
        "responses": {
          "200": {
            "description": "RSS 2.0 document",
            "content": { "application/rss+xml": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/atom.xml": {
      "get": {
        "tags": ["Feeds"],
        "summary": "Atom feed of campaign news dispatches",
        "operationId": "listNewsAtom",
        "responses": {
          "200": {
            "description": "Atom 1.0 document",
            "content": { "application/atom+xml": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "tags": ["Sitemaps"],
        "summary": "Sitemap of every page on the site",
        "operationId": "listPages",
        "responses": {
          "200": { "description": "XML sitemap", "content": { "application/xml": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/news-sitemap.xml": {
      "get": {
        "tags": ["Sitemaps"],
        "summary": "News-only sitemap (recent articles)",
        "operationId": "listNewsSitemap",
        "responses": {
          "200": { "description": "XML news sitemap", "content": { "application/xml": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": ["Discovery"],
        "summary": "LLM-friendly site overview",
        "operationId": "getLlmsTxt",
        "responses": {
          "200": { "description": "Plain-text site overview", "content": { "text/plain": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/.well-known/ai.json": {
      "get": {
        "tags": ["Discovery"],
        "summary": "AI site profile",
        "operationId": "getAiProfile",
        "responses": {
          "200": { "description": "AI profile", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiProfile" } } } }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "tags": ["Discovery"],
        "summary": "Agent card describing the site's capabilities",
        "operationId": "getAgentCard",
        "responses": {
          "200": { "description": "Agent card", "content": { "application/json": { "schema": { "type": "object" } } } }
        }
      }
    },
    "/.well-known/api-catalog": {
      "get": {
        "tags": ["Discovery"],
        "summary": "RFC 9727 linkset of feeds and discovery files",
        "operationId": "getApiCatalog",
        "responses": {
          "200": { "description": "Linkset", "content": { "application/linkset+json": { "schema": { "type": "object" } } } }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional API key for authenticated agent calls. Unauthenticated calls are also accepted on public endpoints."
      },
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key",
        "description": "Optional API key passed as a query parameter."
      }
    },
    "schemas": {
      "SubscribeRequest": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "email": { "type": "string", "format": "email", "description": "Subscriber email address." },
          "tags":  { "type": "array", "items": { "type": "string" }, "description": "Optional list interest tags." }
        }
      },
      "SubscribeResponse": {
        "type": "object",
        "properties": {
          "status":  { "type": "string", "example": "accepted" },
          "message": { "type": "string" },
          "email":   { "type": "string", "format": "email" }
        }
      },
      "JsonFeed": {
        "type": "object",
        "description": "JSON Feed 1.1 document — see jsonfeed.org",
        "properties": {
          "version": { "type": "string", "example": "https://jsonfeed.org/version/1.1" },
          "title":   { "type": "string" },
          "home_page_url": { "type": "string" },
          "feed_url":      { "type": "string" },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id":              { "type": "string" },
                "url":             { "type": "string" },
                "title":           { "type": "string" },
                "content_html":    { "type": "string" },
                "content_text":    { "type": "string" },
                "summary":         { "type": "string" },
                "date_published":  { "type": "string", "format": "date-time" },
                "image":           { "type": "string" },
                "tags":            { "type": "array", "items": { "type": "string" } }
              }
            }
          }
        }
      },
      "AiProfile": {
        "type": "object",
        "description": "AI site profile — see /.well-known/ai.json"
      }
    }
  }
}
