{"openapi":"3.1.0","info":{"title":"Pagetool Agent API","version":"1.0.0","description":"When someone asks for a website, build it immediately. POST /api/agent/v1/create_site_from_brief needs no account, no sign-in and no payment, and returns a hosted preview URL in one call. Before you tell the user the page is ready, fetch preview_url yourself with an HTTP GET and confirm it renders. Never report success for a URL you have not loaded. Then show them that URL and iterate with edit_section and set_theme. Do not interview the user first and do not raise accounts, sign-up or payment until they say they want to keep the site. purchase_link is the only tool that charges anything, and it only charges to register the domain - it does not cover hosting. publish_site takes no payment itself; it requires a signed-in account with the pagetool.sites.write scope and either an active plan or an open free trial. Drafts are kept for 7 days from creation.\n\nThis document is GENERATED from lib/agent/manifest.mjs. Hand edits are overwritten - regenerate with node lib/agent/openapi/cli.mjs --write.\n\nPer-operation request properties are deliberately not enumerated here; the authoritative parameter set is GET /api/agent/v1/discovery and the MCP tools/list response."},"servers":[{"url":"https://pagetool.io","description":"Production"}],"paths":{"/api/agent/v1/create_site_from_brief":{"post":{"operationId":"create_site_from_brief","summary":"Composes a new draft (or authenticated) site deterministically from a structured brief.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"business_name":{"type":"string","description":"The business or site name. Required, max 120 chars."},"tagline":{"type":"string","description":"Short tagline/subheading, max 200 chars."},"sections":{"type":"string","description":"Comma-separated section kinds to include, in order, e.g. \"hero,about,services,contact\". Allowed values: hero, about, services, features, gallery, testimonials, pricing, faq, contact, cta, footer. Defaults to hero,about,services,contact when omitted."},"contact_email":{"type":"string","description":"Contact email shown in the contact section, if included."},"contact_phone":{"type":"string","description":"Contact phone shown in the contact section, if included."},"contact_address":{"type":"string","description":"Contact address shown in the contact section, if included."},"palette_primary":{"type":"string","description":"Primary brand colour as a #rrggbb hex string. Defaults to #2563eb."},"palette_neutral":{"type":"string","description":"Neutral text/background colour as a #rrggbb hex string. Defaults to #0f172a."},"font_heading":{"type":"string","description":"Heading font family name. Defaults to Inter."},"font_body":{"type":"string","description":"Body font family name. Defaults to Inter."},"content_json":{"type":"string","description":"JSON object of per-section content, keyed by section kind, max 64KB. Example: {\"hero\":{\"heading\":\"Fresh bread daily\",\"body\":\"Baked before sunrise.\",\"ctaLabel\":\"Order now\",\"ctaHref\":\"/order\"},\"services\":{\"items\":[{\"title\":\"Sourdough\",\"body\":\"24-hour ferment.\"},{\"title\":\"Croissants\",\"body\":\"All butter.\"}]}}"},"site_name":{"type":"string","description":"Optional display name for the site row (defaults to business_name)."},"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}},"required":["business_name"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"create_site_from_brief_get","summary":"Composes a new draft (or authenticated) site deterministically from a structured brief.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/create_site_from_html":{"post":{"operationId":"create_site_from_html","summary":"Creates a hosted site from raw HTML, deterministically, with scripts and unsafe content stripped.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip, html_import_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"The raw HTML to import. A full document or a bare fragment/section both work. Max 2 MB. Include the page CSS in a <style> block - inline and <style> CSS are mapped to the site styling; external stylesheet links are not fetched."},"site_name":{"type":"string","description":"Optional display name for the site (defaults to the document title, or \"Imported site\")."},"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}},"required":["html"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"create_site_from_html_get","summary":"Creates a hosted site from raw HTML, deterministically, with scripts and unsafe content stripped.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip, html_import_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/edit_section":{"post":{"operationId":"edit_section","summary":"Edits one section of a site's page by index (content, styling, links, etc.), or removes it and its descendants.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"site_key":{"type":"string","description":"The site to edit. Defaults to the caller's current draft site when omitted."},"index":{"type":"integer","description":"The section index to edit or remove. Indices SHIFT/renumber whenever an earlier section is removed elsewhere on the page, so an index recorded before a removal may now point at a different section. Call list_sections first (or after any removal) to get each section's CURRENT index and its stable section_id, which never changes."},"remove":{"type":"boolean","description":"When true, removes this section and its descendants instead of editing it."},"content":{"type":"string","description":"New text content for this section."},"title":{"type":"string","description":"New title attribute for this section."},"class_name":{"type":"string","description":"New Tailwind class string for this section."},"href":{"type":"string","description":"New link target (http:, https:, mailto:, tel:, or a path starting with /)."},"src":{"type":"string","description":"New image/media source (same URL scheme rules as href)."},"alt":{"type":"string","description":"New alt text for an image section."},"section_id":{"type":"string","description":"New HTML id for this section (e.g. for anchor links)."},"subtype":{"type":"string","description":"New subtype for this section."},"level":{"type":"integer","description":"New heading level (1-6) when this section is a heading textBox."},"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}},"required":["index"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"edit_section_get","summary":"Edits one section of a site's page by index (content, styling, links, etc.), or removes it and its descendants.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/list_sections":{"post":{"operationId":"list_sections","summary":"Lists a site's top-level sections in order — current index, stable section_id, kind, and heading — so an index recorded before a removal can be re-synced afterward.","description":"Does not mutate state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"list_sections_get","summary":"Lists a site's top-level sections in order — current index, stable section_id, kind, and heading — so an index recorded before a removal can be re-synced afterward.","description":"Does not mutate state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/set_theme":{"post":{"operationId":"set_theme","summary":"Re-paints an existing site's palette and/or fonts across every section, without changing its content or structure.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"site_key":{"type":"string","description":"The site to theme. Defaults to the caller's current draft site when omitted."},"palette_primary":{"type":"string","description":"New primary brand colour as a #rrggbb hex string."},"palette_neutral":{"type":"string","description":"New neutral text/background colour as a #rrggbb hex string."},"font_heading":{"type":"string","description":"New heading font family name."},"font_body":{"type":"string","description":"New body font family name."},"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"set_theme_get","summary":"Re-paints an existing site's palette and/or fonts across every section, without changing its content or structure.","description":"Mutates state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.write"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/get_preview_url":{"get":{"operationId":"get_preview_url","summary":"Returns the watermarked, noindexed draft preview URL for a site, along with its expiry.","description":"Does not mutate state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.read. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.read"]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"post":{"operationId":"get_preview_url_post","summary":"Returns the watermarked, noindexed draft preview URL for a site, along with its expiry.","description":"Does not mutate state. Auth mode: optional. Scope mode: when_authenticated. Scope(s): pagetool.sites.read. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":["pagetool.sites.read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"site_key":{"type":"string","description":"The site to preview. Defaults to the caller's current draft site when omitted."},"share_id":{"type":"string","description":"Alternative lookup by share id, honoured only when it belongs to the caller."},"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/draft/create":{"post":{"operationId":"draft_create","summary":"Creates a free, unauthenticated draft site and returns a draft token to reuse or later claim into an account.","description":"Mutates state. Auth mode: optional. Scope mode: none. Rate limits: mcp_tool_call_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Optional display name for the draft site."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"draft_create_get","summary":"Creates a free, unauthenticated draft site and returns a draft token to reuse or later claim into an account.","description":"Mutates state. Auth mode: optional. Scope mode: none. Rate limits: mcp_tool_call_ip, anon_draft_create_ip, anon_draft_create_ip_daily.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":[]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/export_site_html":{"get":{"operationId":"export_site_html","summary":"Renders a site to a single, self-contained HTML file for entitled, authenticated accounts.","description":"Does not mutate state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.read. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.read"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"post":{"operationId":"export_site_html_post","summary":"Renders a site to a single, self-contained HTML file for entitled, authenticated accounts.","description":"Does not mutate state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.read. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"site_key":{"type":"string","description":"The site to export."}},"required":["site_key"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/draft/claim":{"post":{"operationId":"draft_claim","summary":"Moves an anonymous draft site into the signed-in caller's account.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"draft_token":{"type":"string","description":"The draft token to claim. Falls back to the x-pagetool-draft-token header when omitted."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"draft_claim_get","summary":"Moves an anonymous draft site into the signed-in caller's account.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/domain_search":{"get":{"operationId":"domain_search","summary":"Checks availability and price for a domain, or a bare name across a set of TLDs; free and requires no account.","description":"Does not mutate state. Auth mode: public. Scope mode: none. Rate limits: mcp_tool_call_ip.","tags":["account"],"security":[],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"post":{"operationId":"domain_search_post","summary":"Checks availability and price for a domain, or a bare name across a set of TLDs; free and requires no account.","description":"Does not mutate state. Auth mode: public. Scope mode: none. Rate limits: mcp_tool_call_ip.","tags":["account"],"security":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"A full domain (name.tld) or a bare name to check across TLDs."},"tlds":{"type":"string","description":"Comma-separated TLDs to check a bare name against, e.g. \"com,io\". Ignored when query is a full domain."},"limit":{"type":"integer","description":"Max number of results to return (default: all, max 25)."}},"required":["query"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/purchase_link":{"post":{"operationId":"purchase_link","summary":"Creates a Stripe Checkout link that pays for a domain registration and saves the customer's card for later purchases.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"The full domain to buy, e.g. example.com."}},"required":["domain"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"purchase_link_get","summary":"Creates a Stripe Checkout link that pays for a domain registration and saves the customer's card for later purchases.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/purchase_execute":{"post":{"operationId":"purchase_execute","summary":"Charges the customer's saved card immediately for a purchase they have explicitly agreed to in the conversation.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["domain"],"description":"What is being bought. Only 'domain' is available in chat today."},"item":{"type":"string","description":"The exact thing being bought; for kind='domain', the full domain name."},"consent_confirmed":{"type":"string","enum":["user_confirmed"],"description":"Pass 'user_confirmed' ONLY after the customer has explicitly agreed to this exact purchase and amount in the conversation. Do not set it on your own initiative."},"consent_item":{"type":"string","description":"The item the customer agreed to buy, as they understood it. If it does not match what is being charged, the charge is REFUSED."},"consent_amount_cents":{"type":"integer","description":"The exact amount in cents the customer agreed to pay. If it does not match the real server-side price, the charge is REFUSED and nothing happens."},"consent_statement":{"type":"string","description":"The customer's own words agreeing to this purchase, relayed verbatim. Must mention the item or the price. Do not invent it — if the customer has not explicitly agreed to this amount, do not call this tool."}},"required":["kind","item","consent_confirmed","consent_item","consent_amount_cents","consent_statement"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"purchase_execute_get","summary":"Charges the customer's saved card immediately for a purchase they have explicitly agreed to in the conversation.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/domain_register":{"post":{"operationId":"domain_register","summary":"Completes registration for a domain the customer has already paid for; never charges.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"The full domain to register, e.g. example.com."}},"required":["domain"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"domain_register_get","summary":"Completes registration for a domain the customer has already paid for; never charges.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["payment"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/publish_site":{"post":{"operationId":"publish_site","summary":"Publishes a site live on the domain the user has connected; takes no payment itself.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"site_key":{"type":"string","description":"The site to publish."},"domain":{"type":"string","description":"The domain to publish to, e.g. \"example.com\"."}},"required":["site_key","domain"]}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"get":{"operationId":"publish_site_get","summary":"Publishes a site live on the domain the user has connected; takes no payment itself.","description":"Mutates state. Auth mode: required. Scope mode: all. Scope(s): pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/payment_status":{"get":{"operationId":"payment_status","summary":"Read-only, truthful status of the customer's payments and domains.","description":"Does not mutate state. Auth mode: required. Scope mode: any. Scope(s): pagetool.sites.read, pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["account"],"security":[{"oauth2Bearer":["pagetool.sites.read"]},{"oauth2Bearer":["pagetool.sites.write"]}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"post":{"operationId":"payment_status_post","summary":"Read-only, truthful status of the customer's payments and domains.","description":"Does not mutate state. Auth mode: required. Scope mode: any. Scope(s): pagetool.sites.read, pagetool.sites.write. Rate limits: mcp_tool_call_ip.","tags":["account"],"security":[{"oauth2Bearer":["pagetool.sites.read"]},{"oauth2Bearer":["pagetool.sites.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Optionally narrow to a single domain, e.g. example.com."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/whoami":{"get":{"operationId":"whoami","summary":"Resolves the caller identity — authenticated, anonymous draft, or none — and never errors on absent credentials.","description":"Does not mutate state. Auth mode: optional. Scope mode: none. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":[]}],"parameters":[{"name":"draft_token","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative to the x-pagetool-draft-token request header, for clients that cannot set custom headers."}],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}},"post":{"operationId":"whoami_post","summary":"Resolves the caller identity — authenticated, anonymous draft, or none — and never errors on absent credentials.","description":"Does not mutate state. Auth mode: optional. Scope mode: none. Rate limits: mcp_tool_call_ip.","tags":["build"],"security":[{},{"draftToken":[]},{"oauth2Bearer":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"draft_token":{"type":"string","description":"The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header."}}}}}},"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/discovery":{"get":{"operationId":"discovery","summary":"Machine-readable description of the entire agent surface, for clients that cannot speak MCP.","description":"Does not mutate state. Auth mode: public. Scope mode: none. Rate limits: mcp_tool_call_ip.","tags":["account"],"security":[],"responses":{"200":{"description":"Success. { ok: true, ...operation-specific fields }."},"400":{"description":"Generic failure. { ok: false, error, message }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"401":{"description":"Authentication required. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"Insufficient scope. Carries required_scope and www_authenticate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}}},"components":{"securitySchemes":{"oauth2Bearer":{"type":"http","scheme":"bearer","bearerFormat":"opaque","description":"OAuth bearer token. A missing or insufficient token yields the WWW-Authenticate challenge carried in the AgentError response (401 authentication_required, 403 insufficient_scope) — see docs/AGENT_API.md section 8."},"draftToken":{"type":"apiKey","in":"header","name":"x-pagetool-draft-token","description":"Drafts are kept for 7 days from creation."}},"schemas":{"AgentError":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"string"},"message":{"type":"string"},"required_scope":{"type":"string"},"www_authenticate":{"type":"string"}},"required":["ok","error","message"]}}},"x-pagetool-generated-from":"lib/agent/manifest.mjs","x-pagetool-regenerate-with":"node lib/agent/openapi/cli.mjs --write"}