{"components":{"schemas":{"APIKeyRequest":{"properties":{"name":{"type":"string"}},"type":"object"},"MagicLinkRequest":{"properties":{"email":{"format":"email","type":"string"},"name":{"type":"string"}},"required":["email"],"type":"object"},"PublishRequest":{"examples":[{"agent_id":"your-agent-id","files":{"index.html":"\u003c!doctype html\u003e\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eMy report\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e"},"mode":"fast","title":"My report","ttl_seconds":86400,"visibility":"public"},{"files":{"index.html":"\u003c!doctype html\u003e\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eBoard report\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e"},"mode":"registered","share":{"emails":["reader@example.com"]},"title":"Board report","visibility":"recipients"}],"properties":{"agent_id":{"type":"string"},"agent_name":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"files":{"additionalProperties":{"type":"string"},"type":"object"},"mode":{"enum":["fast","registered"],"type":"string"},"require_registration":{"type":"boolean"},"share":{"properties":{"emails":{"items":{"type":"string"},"type":"array"},"message":{"type":"string"}},"type":"object"},"title":{"type":"string"},"ttl_seconds":{"type":"integer"},"visibility":{"enum":["private","magic","recipients","signed","public"],"type":"string"}},"required":["files"],"type":"object"},"ShareRequest":{"properties":{"emails":{"items":{"type":"string"},"type":"array"},"id":{"type":"string"},"message":{"type":"string"},"publication_id":{"type":"string"},"slug":{"type":"string"}},"required":["emails"],"type":"object"}},"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"},"sessionCookie":{"in":"cookie","name":"htmlshare_session","type":"apiKey"}}},"info":{"description":"AI-first API for publishing and sharing generated HTML pages. Default agent flow: POST /publish with mode=fast and agent_id. Fast mode requires no registration, no OAuth, no MCP, and no bearer token.","title":"htmlshare API","version":"v1"},"openapi":"3.1.0","paths":{"/abuse-reports":{"post":{"responses":{"201":{"description":"Abuse notice accepted"}},"summary":"Submit abuse or illegal content notice"}},"/ai/signup":{"post":{"responses":{"201":{"description":"Magic link created"}},"summary":"Start registered-account automation signup with a magic link"}},"/api-keys":{"post":{"description":"Requires a confirmed authenticated session. For a new email, /api/ai/signup returns a temporary hsk_... token and sends a confirmation email. For an existing confirmed email, /api/ai/signup emails a new token to the account owner instead of returning it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyRequest"}}},"required":true},"responses":{"201":{"description":"Agent key created"}},"security":[{"sessionCookie":[]}],"summary":"Create an agent API key"}},"/auth/magic-link":{"post":{"description":"Use this for browser login. It sends a single-use /auth/magic link and never returns or emails an hsk_... agent token.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}},"required":true},"responses":{"202":{"description":"Sign-in link sent"}},"summary":"Send a human sign-in link by email"}},"/mcp":{"post":{"description":"Use Authorization: Bearer hsk_... and JSON-RPC methods initialize, tools/list, and tools/call.","responses":{"200":{"description":"MCP JSON-RPC response"}},"security":[{"bearerAuth":[]}],"summary":"Remote MCP JSON-RPC endpoint"}},"/publish":{"post":{"description":"Canonical agent endpoint. Default to mode=fast with agent_id for short-lived public or recipient-restricted publishing. Fast mode has no bearer auth, no registration, no OAuth, and no MCP requirement. Use mode=registered with bearer/session auth only for account-owned sharing, dashboard control, signed access, audit history, or long-lived library storage.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}}},"required":true},"responses":{"201":{"description":"HTML published"}},"security":[{},{"bearerAuth":[]},{"sessionCookie":[]}],"summary":"Publish an HTML bundle. Default mode=fast (no auth). Use mode=registered with bearer token for persistence."}},"/share":{"post":{"description":"Creates magic links for recipients and sends email when email delivery is configured.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareRequest"}}},"required":true},"responses":{"201":{"description":"Publication shared"}},"security":[{"bearerAuth":[]}],"summary":"Share an existing publication by email"}}},"servers":[{"url":"https://share.metricauno.com/api/v1"}]}
