{
  "openapi": "3.1.0",
  "info": {
    "title": "Portalize public API",
    "version": "1.0.0",
    "description": "Machine-readable description of Portalize public HTTP APIs. Authenticated agency and client portal endpoints are omitted here; see https://portalize.app/docs for product documentation.",
    "contact": {
      "url": "https://portalize.app/contact"
    }
  },
  "servers": [
    {
      "url": "https://portalize.app"
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "summary": "x402-gated agent discovery summary",
        "operationId": "getPaidAgentDiscovery",
        "description": "Returns HTTP 402 with x402 payment requirements unless a valid PAYMENT-SIGNATURE is supplied. Facilitator: https://x402.org/facilitator.",
        "responses": {
          "402": {
            "description": "Payment required (x402)"
          },
          "200": {
            "description": "Paid discovery summary"
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "summary": "List public Notion portal templates",
        "operationId": "listPublicTemplates",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": { "type": "string" }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": { "type": "string" },
            "description": "Search query"
          }
        ],
        "responses": {
          "200": {
            "description": "Template catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "data": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/templates/{slug}": {
      "get": {
        "summary": "Get a public template by slug",
        "operationId": "getPublicTemplate",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Template detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "data": { "type": "object" }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Template not found"
          }
        }
      }
    },
    "/status.json": {
      "get": {
        "summary": "Static service manifest",
        "operationId": "getServiceManifest",
        "description": "A build-time manifest of the public API surface Portalize intends to serve. It is regenerated on deploy and is NOT a live health probe: it does not reflect incidents, so do not gate calls on it. `kind` is always `static-manifest`.",
        "responses": {
          "200": {
            "description": "Manifest for the deployed build",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["kind", "service"],
                  "properties": {
                    "kind": { "type": "string", "const": "static-manifest" },
                    "service": { "type": "string" },
                    "status": { "type": "string" },
                    "note": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "summary": "Submit the public contact form",
        "operationId": "submitContactForm",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "email", "subject", "message"],
                "properties": {
                  "name": { "type": "string", "minLength": 1, "maxLength": 200 },
                  "email": { "type": "string", "format": "email", "minLength": 1, "maxLength": 254 },
                  "subject": { "type": "string", "minLength": 1, "maxLength": 200 },
                  "message": { "type": "string", "minLength": 10, "maxLength": 5000 }
                }
              }
            }
          }
        },
        "description": "Sends a notification to the Portalize team and a confirmation to the supplied address. Rate limited to 5 submissions per IP per hour; a 429 carries Retry-After.",
        "responses": {
          "200": {
            "description": "Message accepted"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limit exceeded",
            "headers": {
              "Retry-After": {
                "schema": { "type": "integer" },
                "description": "Seconds to wait before retrying"
              }
            }
          }
        }
      }
    }
  }
}
