{"openapi":"3.1.0","info":{"title":"lucid.page","version":"1.0.0","description":"lucid.page turns Markdown into beautiful, shareable pages. Anonymous publishing works out of the box; an lp_ API key (Authorization: Bearer) unlocks private documents, updates, listing, bundles, and deletion. Agent guide: https://lucid.page/docs/agents — MCP endpoint: POST /mcp."},"servers":[{"url":"https://lucid.page"}],"security":[{"bearerAuth":[]},{"apiKeyQuery":[]},{}],"paths":{"/publish":{"post":{"operationId":"publishDoc","summary":"Publish a Markdown document","description":"Accepts either a raw text/markdown body or a JSON body { markdown, title?, visibility?, ttl? }. Anonymous publishing is allowed; with an lp_ key the document is owned by the account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}},"text/markdown":{"schema":{"type":"string"}}}},"responses":{"201":{"description":"Published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResponse"}}}},"400":{"description":"Empty/invalid body, bad visibility, or ttl < 60","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Private visibility without authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Document over the 1 MB cap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (10 req/min per IP anonymous, 120 req/min per account)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Index temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/publish":{"post":{"operationId":"publishDocAlias","summary":"Publish a Markdown document (alias of POST /publish)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}},"text/markdown":{"schema":{"type":"string"}}}},"responses":{"201":{"description":"Published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResponse"}}}}}}},"/raw/{slug}":{"get":{"operationId":"getRawDoc","summary":"Fetch the canonical Markdown source of a page","parameters":[{"$ref":"#/components/parameters/slug"}],"responses":{"200":{"description":"The Markdown source","content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Not found, expired, or a private page without owner credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Removed after a takedown","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/{slug}":{"post":{"operationId":"updateDoc","summary":"Update a document you own","description":"Replaces the Markdown source; the URL is stable and every update is stored as a revision. Requires an lp_ API key or session.","parameters":[{"$ref":"#/components/parameters/slug"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"markdown":{"type":"string"},"title":{"type":["string","null"]}},"required":["markdown"]}},"text/markdown":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or owned by someone else)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteDoc","summary":"Delete a document you own","parameters":[{"$ref":"#/components/parameters/slug"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or owned by someone else)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/docs":{"get":{"operationId":"listDocs","summary":"List documents owned by the account","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","description":"The nextCursor value from a previous response","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of documents, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocList"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/bundles":{"get":{"operationId":"listBundles","summary":"List bundles owned by the account","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of bundles, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"bundles":{"type":"array","items":{"type":"object"}},"nextCursor":{"type":["string","null"]}},"required":["bundles","nextCursor"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bundles":{"post":{"operationId":"createBundle","summary":"Create a multi-chapter bundle from documents you own","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleResponse"}}}},"400":{"description":"Invalid title, visibility, or chapter list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bundles/{slug}":{"get":{"operationId":"getBundle","summary":"Fetch a bundle you own, including its chapter list","parameters":[{"$ref":"#/components/parameters/slug"}],"responses":{"200":{"description":"The bundle","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"updateBundle","summary":"Update a bundle's title, visibility, intro, or chapters","parameters":[{"$ref":"#/components/parameters/slug"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteBundle","summary":"Delete a bundle you own (chapters themselves are kept)","parameters":[{"$ref":"#/components/parameters/slug"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys":{"post":{"operationId":"mintKey","summary":"Mint an lp_ API key (requires a Firebase ID token from sign-in)","responses":{"201":{"description":"The key, shown exactly once","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"apiKey":{"type":"string"},"keyId":{"type":"string"},"note":{"type":"string"}},"required":["accountId","apiKey","keyId"]}}}},"401":{"description":"Missing or invalid Firebase ID token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listKeys","summary":"List your API keys (ids and prefixes only)","responses":{"200":{"description":"Your keys","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys/{keyId}":{"delete":{"operationId":"revokeKey","summary":"Revoke an API key","parameters":[{"name":"keyId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/me":{"get":{"operationId":"billingMe","summary":"Plan and subscription status for the account","responses":{"200":{"description":"Account status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingMe"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/checkout":{"post":{"operationId":"billingCheckout","summary":"Create a checkout session for a paid plan","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["pro","team"]}}}}}},"responses":{"200":{"description":"Checkout URL","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"Checkout unavailable (plan price not configured, or payments unreachable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/portal":{"post":{"operationId":"billingPortal","summary":"Create a billing-portal session","responses":{"200":{"description":"Portal URL","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"operationId":"mcp","summary":"Model Context Protocol endpoint (JSON-RPC 2.0, stateless)","description":"Speaks MCP protocol versions 2026-07-28, 2025-11-25, 2025-06-18 and 2025-03-26. Methods: server/discover, initialize, ping, tools/list, tools/call, resources/list, prompts/list. Tools: publish_doc, update_doc, get_doc, list_docs, delete_doc, create_bundle, get_limits.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Notification accepted; no response body"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An lp_ API key (minted via POST /keys) or a Firebase ID token."},"apiKeyQuery":{"type":"apiKey","in":"query","name":"apiKey","description":"Alternative to the Authorization header (also accepts api_key). The header wins when both are present."}},"parameters":{"slug":{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,80}$"}}},"schemas":{"PublishRequest":{"type":"object","properties":{"markdown":{"type":"string","description":"Max 1 MB"},"title":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","unlisted","public"],"default":"unlisted"},"ttl":{"type":"integer","minimum":60,"description":"Lifetime in seconds; omit for no expiry"},"name":{"type":["string","null"]}},"required":["markdown"]},"PublishResponse":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string","enum":["private","unlisted","public"]},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["slug","url","visibility","expires_at"]},"UpdateResponse":{"type":"object","properties":{"slug":{"type":"string"},"revision_hash":{"type":"string"},"visibility":{"type":"string"},"url":{"type":"string"}},"required":["slug","revision_hash","visibility","url"]},"DocList":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":["string","null"]},"visibility":{"type":"string"},"view_count":{"type":"integer"},"updated_at":{"type":"string"},"expires_at":{"type":["string","null"]},"is_bundle":{"type":"boolean"}}}},"nextCursor":{"type":["string","null"]}},"required":["docs","nextCursor"]},"BundleRequest":{"type":"object","properties":{"title":{"type":"string"},"visibility":{"type":"string","enum":["private","unlisted","public"],"default":"unlisted"},"markdown":{"type":"string","description":"Landing-page introduction"},"items":{"type":"array","maxItems":200,"items":{"type":"object","properties":{"doc_slug":{"type":"string"},"path_slug":{"type":"string"},"nav_title":{"type":"string"}},"required":["doc_slug"]}}}},"BundleResponse":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string"}},"required":["slug","url","visibility"]},"BillingMe":{"type":"object","properties":{"accountId":{"type":"string"},"plan":{"type":"string","enum":["free","pro","team"]},"activeSubscription":{"type":"boolean"},"currentPeriodEnd":{"type":["string","null"]},"cancelAt":{"type":["string","null"]},"portalAvailable":{"type":"boolean"}},"required":["accountId","plan","activeSubscription"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","description":"Machine-readable code on agent-facing endpoints"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["error"]}}}}