{
  "openapi": "3.0.3",
  "info": {
    "title": "myreach.top API",
    "version": "1.3.0",
    "description": "MyReach creator-page API. This reference covers the documented app and page-scoped agent API; it is not a catalog of internal admin, provider webhook, or operational routes. SESSION means the signed-in owner browser cookie; KEY means a revocable page-scoped key sent as Authorization: Bearer mr_live_\u2026. A page key can access only its own page scope and cannot manage the account or API keys. Guide: https://myreach.top/ai-agents-guide. Base URL https://myreach.top (local development: http://localhost:8788). Errors return JSON with an error string unless noted. Agents can provision a temporary page with POST /api/agent/pages, build it with the returned key, then hand the claim URL to its intended owner for verified Google/email sign-in and explicit confirmation. Creation is limited to 2 pages per intended owner in a rolling 24 hours, including deleted pages. Remote public images are copied to durable MyReach storage on import/save and served locally. Conditional upstream checks occur on access after six hours; outages keep the last good copy. firstLesson.image is the left header icon; firstLesson.feature.image is a separate banner. Temporary pages stay private (public 404) until verified owner claim and publication. Private previews use the returned previewUrl. Claim confirmation requires the exact expectedRevision returned by claim inspection. Unclaimed pages are deleted after 24 hours; editing never renews expiry. The MCP protocol is documented separately from this REST schema.\n\n## MCP connections and directories\n\nUse the live [MCP guide](https://myreach.top/ai-agents/mcp) for OAuth, private drafts and owner approval. MyReach 1.0.0 is [listed in the Official MCP Registry](https://registry.modelcontextprotocol.io/?q=top.myreach%2Fmyreach). The [OpenClaw / ClawHub connector bundle](https://clawhub.ai/myreach-top/plugins/myreach) is also listed at 1.0.1. The [Hermes catalog submission](https://github.com/NousResearch/hermes-agent/pull/147158) awaits review and merge; direct Hermes connection is available now. Muse submission requirements are complete and review is pending; no public Muse listing is claimed. New owners build anonymously and claim through email-code verification; OAuth is separate access for ongoing maintenance."
  },
  "servers": [
    {
      "url": "https://myreach.top"
    },
    {
      "url": "http://localhost:8788"
    }
  ],
  "tags": [
    {
      "name": "Agent provisioning",
      "description": "Build by API before owner login; verified owner claims last. Unclaimed pages and builder credentials expire after 24 hours."
    },
    {
      "name": "Auth model",
      "description": "Verify the scope and capabilities of a page-scoped API key."
    },
    {
      "name": "API keys",
      "description": "Owner-session operations for creating, listing, and revoking page keys."
    },
    {
      "name": "Accounts & sign-in",
      "description": "Public sign-in flows and owner-session account operations."
    },
    {
      "name": "Page store",
      "description": "Read a public page snapshot or replace its editable owner snapshot."
    },
    {
      "name": "Pages (Pro)",
      "description": "Owner-session page and plan management."
    },
    {
      "name": "Bookings",
      "description": "Public booking requests and owner-only booking records."
    },
    {
      "name": "Leads",
      "description": "Public lead capture and owner-only lead records."
    },
    {
      "name": "Courses",
      "description": "Public enrollment/progress actions and owner-only student records."
    },
    {
      "name": "Analytics",
      "description": "Consented event collection and privacy-safe owner reports."
    },
    {
      "name": "Payments",
      "description": "Public checkout/status and safe owner payment settings."
    },
    {
      "name": "Domains",
      "description": "Public .top availability search only; search does not register or reserve. Existing-domain attachment is a platform-admin operation. The internal /api/host/allow Caddy authorization route is not part of this public API."
    },
    {
      "name": "Public unfurls \u2014 GitHub \u00b7 links",
      "description": "Public GitHub and website metadata previews."
    },
    {
      "name": "Blog feeds",
      "description": "Owner-authorized discovery of public RSS, Atom, JSON Feed, and article pages."
    },
    {
      "name": "Calendar connections",
      "description": "Owner-authorized status, OAuth connection, and disconnect operations for Google Calendar (free/busy and event write), Microsoft Outlook Calendar (delegated calendar read/write), and Calendly (account and event-type read for external scheduling URLs). Tokens remain server-side and connections are scoped to the owner's page."
    }
  ],
  "security": [],
  "paths": {
    "/api/agent/pages": {
      "post": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Provision a page before owner sign-in",
        "description": "Public bootstrap; no cookie or key needed. Accepts at most 8 KB. Returns a temporary page key and claimUrl once; save both securely. Limits: 2 creations per intended owner per rolling 24 hours (shared with owner POST /api/pages; deletion never refunds quota), 10 per network per 24 hours and 20 attempts per network per minute. Uses atomic shared storage. Limits deter bursts; rotating unverified emails and networks can bypass them. Temporary builders cannot upload private delivery files before ownership is claimed. Build with PUT /api/store?slug=...; then hand claimUrl to the owner. Normal account page caps apply at claim time (Free: 1, active Pro: 3). Unclaimed pages expire after 24 hours. A lost response cannot recover the key: retain responses and check slug conflicts before retrying.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentPageCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Page provisioned; key and claim URL shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPageCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or reserved slug/email."
          },
          "403": {
            "description": "Cross-origin request rejected."
          },
          "409": {
            "description": "Slug already taken."
          },
          "413": {
            "description": "Request exceeds 8 KB."
          },
          "429": {
            "description": "Creation or attempt limit reached. Honor Retry-After."
          },
          "503": {
            "description": "Atomic storage or creation unavailable; do not assume success."
          }
        }
      },
      "get": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Read provisioning status using the page key",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page slug, ownership state and optional expiry."
          },
          "401": {
            "description": "Wrong, expired or revoked key."
          }
        }
      },
      "delete": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Delete an unclaimed page and revoke its key",
        "description": "Only the original provisioning key may delete its own unclaimed page. Removes the page, provisional owner, key and claim link. Creation quota is retained. Once claimed, use owner account controls; the builder cannot delete it.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; slug is free for an API restart."
          },
          "401": {
            "description": "Wrong, expired or revoked key."
          },
          "403": {
            "description": "Already owned or not the original provisioning key."
          },
          "409": {
            "description": "Ownership changed."
          },
          "503": {
            "description": "Deletion unavailable."
          }
        }
      }
    },
    "/api/agent/claim": {
      "get": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Inspect a valid owner claim link",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Intended owner and page preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentClaimStatus"
                }
              }
            }
          },
          "404": {
            "description": "Expired, deleted or invalid claim link."
          }
        }
      },
      "post": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Claim and publish the reviewed revision after owner verification",
        "description": "Use the existing /login?claim=... screen. Requires an mr_session for the exact intended email authenticated with email code, magic link or verified Google email. Password sessions and API keys cannot claim. Owner must explicitly confirm. Normal account page limit applies. Confirmation is idempotent, makes the page permanent, and revokes the provisioning key. A new intended owner can complete claim sign-in even while general signup is waitlisted; the token alone never signs anyone in. The claim screen verifies the intended owner email and automatically creates an account if needed or retains the existing account; no new/existing account choice or separate signup is required. Legacy account=new/account=existing claim return paths remain accepted. Confirmation links the already-built page and skips page creation onboarding. Free accounts allow one page; active Pro accounts allow three. A full account gets a 403 account_page_limit_reached error, and the unclaimed draft stays private. Accepts at most 8 KB, including chunked requests. Public content stays unavailable until this confirmation. Include expectedRevision from the current GET claim response. A stale revision returns 412; missing revision returns 428. Claim tokens permit status inspection after claim but never ongoing editing.",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "expectedRevision": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The exact page revision reviewed by the owner."
                  }
                },
                "required": [
                  "token",
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Page permanently linked to verified owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentClaimConfirmed"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON."
          },
          "401": {
            "description": "Owner login required."
          },
          "403": {
            "description": "Wrong owner, unverified sign-in, account page cap or cross-origin request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "account_page_limit_reached"
                      ],
                      "description": "Present for an account page-cap failure."
                    },
                    "pageLimit": {
                      "type": "integer",
                      "enum": [
                        1,
                        3
                      ]
                    },
                    "pageCount": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "upgrade": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Invalid, deleted or expired claim."
          },
          "409": {
            "description": "Ownership changed."
          },
          "503": {
            "description": "Claim unavailable; retry safely."
          },
          "413": {
            "description": "Request exceeds 8 KB."
          },
          "412": {
            "description": "Page changed since review. Reload and review again."
          },
          "428": {
            "description": "expectedRevision is required."
          }
        }
      }
    },
    "/api/auth/whoami": {
      "get": {
        "tags": [
          "Auth model"
        ],
        "description": "Verify an API key and return its page scope, plan and capabilities.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Key scope, plan and capabilities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoamiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getApiKeyIdentity",
        "summary": "Verify API key scope"
      }
    },
    "/api/auth/keys": {
      "get": {
        "tags": [
          "API keys"
        ],
        "description": "List active API keys for the owned page. Secret values are never returned.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. <page>"
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active key metadata. Key secrets are never returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listApiKeys",
        "summary": "List page API keys"
      },
      "post": {
        "tags": [
          "API keys"
        ],
        "description": "Create a page-scoped key, or claim a first page with {claim:true,slug}. Claiming requires an owner session with no page; key creation requires ownership of the requested slug.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "New key secret (shown once) or successful claim response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CreateApiKeyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/ClaimPageResponse"
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createApiKeyOrClaimPage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CreateApiKeyInput"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimPageInput"
                  }
                ]
              }
            }
          }
        },
        "summary": "Create a page API key or claim a page"
      },
      "delete": {
        "tags": [
          "API keys"
        ],
        "description": "Revoke one key for the owned page. The revoked key stops authenticating immediately.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "The key was revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeApiKeyResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "revokeApiKey",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Revoke a page API key"
      }
    },
    "/api/auth/signup": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Create a human account with name, email, password (8\u2013256 chars) and slug, or provision an agent account with email, slug and agent:true. The claim:true form claims a first page for a signed-in owner. Successful account signup sets mr_session.",
        "security": [],
        "responses": {
          "200": {
            "description": "Account signup or page-claim response; signup sets the session cookie.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SignupResponse"
                    },
                    {
                      "$ref": "#/components/schemas/ClaimPageResponse"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createAccount",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupInput"
              }
            }
          }
        },
        "summary": "Create an account"
      }
    },
    "/api/auth/check": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Check a page slug. Reserved names count as taken.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])?$"
            },
            "description": "Candidate slug."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Availability result; reserved names report taken=true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlugAvailabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid slug.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "checkSlugAvailability",
        "summary": "Check page slug availability"
      }
    },
    "/api/auth/password/login": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Sign in with email and password. Agent-provisioned accounts cannot use password login. Successful login sets the mr_session cookie.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successful login sets mr_session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionLoginResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Credentials are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "loginWithPassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordLoginInput"
              }
            }
          }
        },
        "summary": "Sign in with email and password"
      }
    },
    "/api/auth/magic/request": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Request a one-time sign-in link by email. Development may return devLink when email delivery is not configured.",
        "security": [],
        "responses": {
          "200": {
            "description": "Email sent, or a development link returned when dev auth links are enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MagicRequestResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "requestMagicLink",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagicRequestInput"
              }
            }
          }
        },
        "summary": "Request an email sign-in link"
      }
    },
    "/api/auth/oauth/start": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Start Google or AgentID sign-in. Successful requests redirect to the provider.",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "google",
                "agentid"
              ]
            }
          },
          {
            "name": "redir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional safe return path."
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Redirect to the configured provider authorization page.",
            "headers": {
              "Location": {
                "description": "Provider authorization URL.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "startOAuthSignIn",
        "summary": "Start provider sign-in"
      }
    },
    "/api/auth/session": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Return the signed-in account, or user:null for an anonymous visitor.",
        "security": [],
        "responses": {
          "200": {
            "description": "Current account, or user:null when anonymous.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getSession",
        "summary": "Read the current session"
      }
    },
    "/api/auth/profile": {
      "put": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Update the signed-in owner\u2019s display name or account type. A non-empty slug must belong to that account; this route does not claim or create a page. Use POST /api/pages to choose a slug for a slugless account.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Updated public account profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateAccountProfile",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileInput"
              }
            }
          }
        },
        "summary": "Update the owner profile"
      }
    },
    "/api/auth/account": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Export owner account data",
        "operationId": "exportAccountData",
        "description": "Download a JSON export of the signed-in owner's account data for the requested page. Sensitive credentials and signed URLs are redacted. Requires the owner session; API keys are not accepted.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Slug of a page owned by the signed-in account."
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account export JSON. The response includes an attachment filename.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Owner session is missing or does not own the requested page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Page/account was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts & sign-in"
        ],
        "description": "Permanently delete the signed-in account and its owned page data.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug to delete."
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account data deleted and session cookie cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletedResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "Clears the HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "deleteAccount",
        "summary": "Delete the owner account"
      }
    },
    "/api/auth/account-export": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Download owner account data",
        "operationId": "downloadAccountExport",
        "description": "Download the same owner-only JSON export as GET /api/auth/account. Sensitive credentials and signed URLs are redacted. This explicit export route requires the owner session; API keys are not accepted.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Slug of a page owned by the signed-in account."
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account export JSON. The response includes an attachment filename.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Owner session is missing or does not own the requested page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Page/account was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/store": {
      "get": {
        "tags": [
          "Page store"
        ],
        "description": "Read a page snapshot. Public reads are CDN cached; owner/key reads are no-store. Returns 204 when no snapshot has been saved.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Previously returned ETag. An unchanged snapshot returns 304."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Saved store snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSnapshot"
                }
              }
            }
          },
          "204": {
            "description": "No saved snapshot exists yet."
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "304": {
            "description": "Snapshot unchanged."
          }
        },
        "operationId": "getPageStore",
        "summary": "Read a page snapshot"
      },
      "put": {
        "tags": [
          "Page store"
        ],
        "description": "Replace the saved editable page snapshot for this slug. This is not a partial merge: read the current snapshot first, apply the requested changes, and include every editable slice you want to retain. Design, language, sections, social icon style, booking configuration, and cards live in this snapshot. Private delivery URLs and files are moved to private storage. A page key can modify only its own slug. Limits: page saves accept at most 2 MB and 30 writes per page per minute. API changes are reflected by active admin views. Owner browser saves must include If-Match; stale admin tabs cannot overwrite newer API edits.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug; API keys are always restricted to their own scope."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact quoted ETag from the latest GET. Required for owner browser sessions; recommended for page keys. A stale revision returns 412 without writing."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreUpdate"
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Snapshot saved. Response includes the new snapshotVersion and ETag for the next conditional write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached; honor Retry-After."
          },
          "412": {
            "description": "The page changed since it was read. Fetch the latest snapshot and reapply the intended edit."
          },
          "428": {
            "description": "Owner browser saves require the latest page ETag in If-Match. Reload an older admin tab."
          }
        },
        "operationId": "savePageStore",
        "summary": "Replace the editable page snapshot"
      }
    },
    "/api/bookings": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "description": "List up to the latest 100 booking records for the owned page, newest first. Records contain visitor contact details; requires the owner session or matching page-scoped API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bookings, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listBookings",
        "summary": "List page bookings"
      },
      "post": {
        "tags": [
          "Bookings"
        ],
        "description": "Create a public manual booking request for an enabled booking/coaching card and configured future local date/time. The server rechecks configured weekdays and slots, active Google/Outlook calendar conflicts, existing holds, and other bookings before claiming the slot. The response means requested, not creator-confirmed; an active Google or Outlook calendar may receive a tentative event. A conflict returns 409; if storage or active calendar availability cannot be checked, it returns 503. Calendly bookings happen on Calendly and are not submitted here. Use /api/pay/create for paid booking checkout.",
        "operationId": "createBooking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingInput"
              }
            }
          }
        },
        "security": [],
        "responses": {
          "200": {
            "description": "Manual booking request stored with status requested; creator confirmation is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingCreateResponse"
                }
              }
            }
          },
          "409": {
            "description": "The slot is booked, held, outside configured availability, or conflicts with the active Google or Outlook calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Booking request rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Booking storage or active calendar availability is unavailable; the request was not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Invalid request, unavailable slot, or booking service error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "summary": "Submit a booking request"
      }
    },
    "/api/lead": {
      "post": {
        "tags": [
          "Leads"
        ],
        "description": "Capture a public lead. Name and contact are required; optional fields are saved with the lead.",
        "security": [],
        "responses": {
          "200": {
            "description": "Lead captured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createLead",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Fallback page slug; body slug takes precedence."
          }
        ],
        "summary": "Submit a lead"
      },
      "get": {
        "tags": [
          "Leads"
        ],
        "description": "List leads for the owned page. Requires owner session or a page API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Leads, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listLeads",
        "summary": "List page leads"
      }
    },
    "/api/course/progress": {
      "post": {
        "tags": [
          "Courses"
        ],
        "description": "Enroll a paid student or mark a lesson complete/incomplete. Enroll requires the matching paid checkout paymentId, course idx and mail. Unknown students return 404.",
        "security": [],
        "responses": {
          "200": {
            "description": "Enrollment or lesson-progress update accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourseProgressResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "updateCourseProgress",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourseProgressInput"
              }
            }
          }
        },
        "summary": "Enroll or update course progress"
      },
      "get": {
        "tags": [
          "Courses"
        ],
        "description": "List course students for the owned page. Requires owner session or a page API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Students with completed lesson ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourseStudentsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listCourseStudents",
        "summary": "List course students"
      }
    },
    "/api/analytics": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "description": "Read privacy-safe aggregate analytics for the owned page. Requires owner session or a page API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 90
            },
            "description": "Window in days; defaults to 30 and is clamped to 7\u201390."
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Daily totals and aggregate source, country, device, browser, platform, click-map, and active-time data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getAnalytics",
        "summary": "Read aggregate analytics"
      },
      "post": {
        "tags": [
          "Analytics"
        ],
        "description": "Record consented visits, link clicks, or active visible-page time. The service stores daily aggregates only; booking/revenue analytics are server-controlled.",
        "security": [],
        "responses": {
          "200": {
            "description": "Event recorded, or ignored when consent is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OkResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "enum": [
                            true
                          ]
                        },
                        "ignored": {
                          "type": "boolean",
                          "enum": [
                            true
                          ]
                        }
                      },
                      "required": [
                        "ok",
                        "ignored"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Booking analytics cannot be submitted by clients.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Event rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "limited": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "ok",
                    "limited"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "recordAnalyticsEvent",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsInput"
              }
            }
          }
        },
        "summary": "Record consented page activity"
      }
    },
    "/api/pay/config": {
      "get": {
        "tags": [
          "Payments"
        ],
        "description": "Read public payment configuration status for a page. Secrets are never exposed.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Public Stripe connection and enabled state; no secrets are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentConfigResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getPaymentConfig",
        "summary": "Read public payment status"
      },
      "put": {
        "tags": [
          "Payments"
        ],
        "description": "Compatibility endpoint for existing page settings. It validates a JSON object and rejects payment credential fields, but does not persist submitted settings; Stripe credentials and readiness are platform-managed. Use /api/pay/connect for an owner-authorized Stripe Connect onboarding flow.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page slug."
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Compatibility response; Stripe settings remain platform-managed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentConfigSaveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "savePaymentConfigCompatibility",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentConfigInput"
              }
            }
          }
        },
        "summary": "Validate payment settings compatibility payload"
      }
    },
    "/api/pay/create": {
      "post": {
        "tags": [
          "Payments"
        ],
        "description": "Create a public Stripe checkout for a saved booking, product or course card. Price and checkout rules come from the saved card; a client-supplied amount is ignored. Paid bookings require a configured future local date and slot, then reserve that slot for up to four days; the Stripe Checkout session expires after 23 hours. Failed or expired checkout releases the claim; delayed payment can extend it for 30 days. A successful paid booking confirms the connected Google or Outlook event. Product/course requires kind and card.index. Name and email are required.",
        "security": [],
        "responses": {
          "200": {
            "description": "Hosted Stripe Checkout URL and payment details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayCreateResponse"
                }
              }
            }
          },
          "409": {
            "description": "Payments are disabled, the creator payout account is not ready, or the requested booking slot cannot be reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Stripe did not create a checkout session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Payment configuration or safe slot reservation is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createCheckoutSession",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayCreateInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Fallback page slug; body slug takes precedence."
          }
        ],
        "summary": "Create a checkout session"
      }
    },
    "/api/pay/status": {
      "get": {
        "tags": [
          "Payments"
        ],
        "description": "Publicly poll a single booking hold or checkout payment; returns free, hold, or paid, with post-payment access details when available. Missing booking query fields return status=free.",
        "parameters": [
          {
            "name": "card",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "slot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Checkout payment id."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Current reservation/payment state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentStatusResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getPaymentStatus",
        "summary": "Check booking or checkout status"
      }
    },
    "/api/domains/search": {
      "get": {
        "tags": [
          "Domains"
        ],
        "description": "Search for affordable .top domain names.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Name or name fragment."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Available affordable .top suggestions, or a JSON error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainSearchResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "searchTopDomains",
        "summary": "Search available .top domains"
      }
    },
    "/api/pages": {
      "get": {
        "tags": [
          "Pages (Pro)"
        ],
        "description": "List pages owned by the signed-in account with the selected analytics window.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                90
              ]
            },
            "description": "Window in days; defaults to 30."
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Owned pages and aggregate stats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagesOverviewResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listOwnedPages",
        "summary": "List owned pages"
      },
      "post": {
        "tags": [
          "Pages (Pro)"
        ],
        "description": "Create another page for the signed-in account. Free plans allow one page; active Pro allows three. At most 2 page creations per owner per rolling 24 hours, shared with agent provisioning.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "New page created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePageResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached; honor Retry-After."
          }
        },
        "operationId": "createOwnedPage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePageInput"
              }
            }
          }
        },
        "summary": "Create an owned page"
      }
    },
    "/api/github/chart": {
      "get": {
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "description": "Return a contribution graph as SVG. A stale cached chart includes X-Chart-Stale: 1.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "GitHub username."
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ]
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "GitHub contribution graph SVG.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid username.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "GitHub is unavailable and no cached chart exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getGitHubContributionChart",
        "summary": "Read a public GitHub chart"
      }
    },
    "/api/github/preview": {
      "get": {
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "description": "Fetch a cached GitHub user/organization or repository preview. A stale cached response sets stale=true.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "GitHub username or organization."
          },
          {
            "name": "repo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Repository name; omit for profile."
          },
          {
            "name": "nocache",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set to 1 to bypass the cache."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "GitHub profile, organization, or repository preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubPreviewResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getGitHubPreview",
        "summary": "Preview a public GitHub profile or repo"
      }
    },
    "/api/link/meta": {
      "get": {
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "description": "Fetch title, description, image, and favicon from a public HTTP(S) URL. On supported LinkedIn or Instagram profile URLs, profileImage may contain the extracted profile photo; published MyReach creator pages set myreach=true and return the latest saved avatar in image (or the MyReach icon if no avatar exists). Normal requests may return stale=true when an origin is unavailable. Some providers block automated fetches.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Absolute public HTTP(S) URL. Private network destinations are rejected."
          },
          {
            "name": "nocache",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set to 1 to force an upstream refresh. On failure, stale cache fallback is also disabled."
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ],
              "default": "light"
            },
            "description": "Background color scheme. Prefers the corresponding declared favicon over larger icons for the opposite scheme."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Fetched metadata. A normal request may use stale cache if the upstream is unavailable; nocache=1 disables cache and stale fallback.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkMetaResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "getLinkMetadata",
        "summary": "Fetch public website metadata"
      }
    },
    "/api/instagram/media": {
      "get": {
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "summary": "Fetch a public Instagram post image",
        "operationId": "getInstagramPostImage",
        "description": "Return the poster image for a public Instagram post, reel, or TV post as raw image bytes. Only instagram.com post URLs are accepted; the upstream image must come from cdninstagram.com. Responses may be cached. This endpoint does not access private posts or accounts.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Public Instagram URL such as https://www.instagram.com/p/SHORTCODE/ or /reel/SHORTCODE/."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Image bytes. Content type is image/jpeg, image/png, or image/webp.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported Instagram URL.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Instagram image is unavailable.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/providers": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "List configured sign-in providers",
        "operationId": "getAuthProviders",
        "description": "Return which sign-in providers are enabled by the current runtime configuration.",
        "security": [],
        "responses": {
          "200": {
            "description": "Provider capability flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthProvidersResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/magic/verify": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Verify an email sign-in link",
        "operationId": "verifyMagicLink",
        "description": "Consume a one-time magic link. A valid link sets mr_session and redirects to the saved return path or admin page.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Valid link; redirect to the account destination.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Set-Cookie": {
                "description": "HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Missing, expired, or already-used token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/oauth/callback": {
      "get": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Complete provider sign-in",
        "operationId": "completeOAuthSignIn",
        "description": "OAuth provider callback. A valid callback creates or resumes the account session and redirects to its destination.",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "google",
                "agentid"
              ]
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Redirect after provider sign-in.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Set-Cookie": {
                "description": "Session cookie when sign-in succeeds.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Invalid callback, provider error, or provider configuration error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/blog/discover": {
      "post": {
        "tags": [
          "Blog feeds"
        ],
        "summary": "Discover posts from a public blog URL",
        "operationId": "discoverBlogFeed",
        "description": "Fetch and parse an owner-approved public blog, article, RSS, Atom, or JSON Feed URL. Requires the matching owner session or page-scoped API key. Discovery is read-only; it does not publish or save posts. The result contains at most ten feed entries or article previews. Private, loopback, and otherwise non-public destinations are rejected.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Owned page slug; include it for a non-default page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogDiscoverInput"
              },
              "example": {
                "url": "https://example.com/blog/"
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Discovered feed entries or article previews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogDiscoverResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unauthorized page owner credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds the 4 KiB limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The public page could not be parsed or has no feed/article previews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/otp/request": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Request an email sign-in code",
        "operationId": "requestEmailSignInCode",
        "description": "Send a six-digit one-time code to an existing account. Codes expire after 10 minutes. In invite-only mode, unknown emails receive 403; development may return devCode when development auth links are enabled. Requests are rate limited.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpRequestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code sent, or development code returned when explicitly enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OtpRequestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Email address is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public signup is closed and this email has no existing account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Email provider could not send the code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Email delivery or rate limiting is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/otp/verify": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Verify an email sign-in code",
        "operationId": "verifyEmailSignInCode",
        "description": "Verify the six-digit code for its email address. Codes expire after 10 minutes, can be used once, and allow up to five wrong-code attempts. Success creates a seven-day owner session.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpVerifyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code accepted; sets the HttpOnly owner session cookie.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionLoginResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Malformed input or expired code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "The code does not match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Verification rate limit or attempt limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Account or rate-limit service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Accounts & sign-in"
        ],
        "summary": "Sign out the current owner session",
        "operationId": "logoutOwnerSession",
        "description": "Clear the current mr_session cookie, if present, and redirect to /login.",
        "security": [],
        "responses": {
          "302": {
            "description": "Session ended; redirects to /login.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Set-Cookie": {
                "description": "Clears the HttpOnly mr_session cookie.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/pay/connect": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Read Stripe Connect status",
        "operationId": "getStripeConnectStatus",
        "description": "Read safe onboarding and readiness status for the owned page. Requires the owner session or matching page-scoped API key. The response may include the Stripe connected-account ID and due requirement names; it never returns provider credentials.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connected-account setup and readiness status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StripeConnectStatus"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Start Stripe Connect onboarding",
        "operationId": "startStripeConnectOnboarding",
        "description": "Create or reuse a Stripe Express connected account for the owned page, then return a hosted onboarding URL. This operation has an external financial-provider side effect. Require the owner\u2019s approval, and have the owner complete the returned URL. Requires the owner session or matching page-scoped API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Hosted onboarding URL and connected-account ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StripeConnectStartResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Payments"
        ],
        "summary": "Link a verified Stripe Connect account",
        "operationId": "linkStripeConnectAccount",
        "description": "Link an existing Stripe connected-account ID after MyReach verifies that Stripe metadata associates it with this page. Requires the owner session or matching page-scoped API key.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StripeConnectLinkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified connected account linked to the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StripeConnectStatus"
                }
              }
            }
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/booking": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Get the active booking URL",
        "operationId": "getCalendarBookingLink",
        "description": "Read the active booking provider and, for a Calendly offer, its safe public scheduling URL. No owner credentials are returned. A returned Calendly URL sends the visitor to Calendly for live availability and booking.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card",
            "in": "query",
            "required": false,
            "description": "Offer identifier: numeric card index, fl, or first-lesson.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Active provider and optional public booking URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarBookingLink"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/availability": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "summary": "List available booking times",
        "operationId": "listCalendarAvailability",
        "description": "Return available configured start times for one enabled booking offer and local date, excluding existing bookings and active holds. Google and Outlook modes also check provider busy intervals. Calendly owns live availability; this endpoint returns configured page-offer times only and does not reserve a slot. Event details and credentials are never returned. Public and rate limited. If the calendar check fails, return 503 and do not treat a time as free.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "description": "Page slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card",
            "in": "query",
            "required": true,
            "description": "Booking card index, or fl for the featured booking offer.",
            "schema": {
              "type": "string",
              "pattern": "^(?:fl|[0-9]{1,3})$"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Selected calendar date in YYYY-MM-DD format, interpreted in the page calendar time zone.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Provider and available local start times. A valid date with no openings returns an empty slots array; returned times are not reservations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarAvailabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid page slug, date, or booking offer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Page or enabled booking offer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Availability request rate limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Calendar, storage, or availability service unavailable; do not treat the time as free.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/providers": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Read calendar provider status",
        "operationId": "getCalendarProviderStatus",
        "description": "Read whether calendar providers are configured and connected for the owned page. Requires the owner session or matching page-scoped API key. Emails and profile names are returned only as connection labels; access tokens remain private.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar provider configuration and connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarProvidersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/google/start": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Start Google Calendar connection",
        "description": "Begin Google OAuth for the owned page and redirect to the provider consent screen. Requests identity, calendar.events.freebusy (availability on calendars the account can access), and calendar.events.owned (view/create/change/delete events on calendars the account owns). MyReach currently checks availability and creates retry-safe booking events with invitations; it does not otherwise use those event permissions. Requires the owner session or matching page-scoped API key. The callback uses one-time server-side state and PKCE, then returns to the safe internal admin path. Agents should get owner approval and hand the returned redirect URL to the owner to complete consent.",
        "operationId": "startGoogleCalendarConnection",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnTo",
            "in": "query",
            "required": false,
            "description": "Optional same-site return path. External URLs are rejected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to Google consent."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/google/callback": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Complete Google Calendar connection",
        "description": "Provider OAuth callback. The one-time state binds this response to the page and internal return path created by the start operation. This callback is intentionally unauthenticated; provider authorization code and state are required.",
        "operationId": "completeGoogleCalendarConnection",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider authorization code."
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One-time state from the start operation."
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider cancellation or error."
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Redirect back to the safe admin return path with a connection result."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/google/disconnect": {
      "delete": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Disconnect Google Calendar",
        "description": "Revoke or remove the Google connection for the owned page. Requires the owner session or its matching page-scoped API key.",
        "operationId": "disconnectGoogleCalendar",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar connection removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarDisconnectResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/microsoft/start": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Start Microsoft Calendar connection",
        "description": "Begin Microsoft OAuth for the owned page and redirect to the provider consent screen. Requests delegated calendar read/write access for the signed-in owner; it does not request tenant-wide mailbox access. Requires the owner session or the matching page-scoped API key. The callback uses one-time server-side state and PKCE, then returns to the safe internal admin path. Agents should get owner approval and hand the returned redirect URL to the owner to complete consent.",
        "operationId": "startMicrosoftCalendarConnection",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnTo",
            "in": "query",
            "required": false,
            "description": "Optional same-site return path. External URLs are rejected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to Microsoft consent."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/microsoft/callback": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Complete Microsoft Calendar connection",
        "description": "Provider OAuth callback. The one-time state binds this response to the page and internal return path created by the start operation. This callback is intentionally unauthenticated; provider authorization code and state are required.",
        "operationId": "completeMicrosoftCalendarConnection",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider authorization code."
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One-time state from the start operation."
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider cancellation or error."
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Redirect back to the safe admin return path with a connection result."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/microsoft/disconnect": {
      "delete": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Disconnect Microsoft Calendar",
        "description": "Revoke or remove the Microsoft connection for the owned page. Requires the owner session or its matching page-scoped API key.",
        "operationId": "disconnectMicrosoftCalendar",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar connection removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarDisconnectResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/calendly/start": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Start Calendly Calendar connection",
        "description": "Begin Calendly OAuth for the owned page and redirect to the provider consent screen. Requests account and active event-type read access to resolve the connected user's scheduling URL; Calendly hosts scheduling. Requires the owner session or the matching page-scoped API key. The callback uses one-time server-side state and PKCE, then returns to the safe internal admin path. Agents should get owner approval and hand the returned redirect URL to the owner to complete consent.",
        "operationId": "startCalendlyCalendarConnection",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnTo",
            "in": "query",
            "required": false,
            "description": "Optional same-site return path. External URLs are rejected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to Calendly consent."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/calendly/callback": {
      "get": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Complete Calendly Calendar connection",
        "description": "Provider OAuth callback. The one-time state binds this response to the page and internal return path created by the start operation. This callback is intentionally unauthenticated; provider authorization code and state are required.",
        "operationId": "completeCalendlyCalendarConnection",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider authorization code."
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One-time state from the start operation."
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider cancellation or error."
          }
        ],
        "security": [],
        "responses": {
          "302": {
            "description": "Redirect back to the safe admin return path with a connection result."
          },
          "400": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar/calendly/disconnect": {
      "delete": {
        "tags": [
          "Calendar connections"
        ],
        "summary": "Disconnect Calendly Calendar",
        "description": "Revoke or remove the Calendly connection for the owned page. Requires the owner session or its matching page-scoped API key.",
        "operationId": "disconnectCalendlyCalendar",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Page slug. Omit only for the default page; a page key can access only its own slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          },
          {
            "bearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar connection removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarDisconnectResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed or provider is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/claim-email": {
      "post": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Email the intended owner a claim button after the page is ready",
        "description": "Requires the original temporary provisioning key and its claim token. The server chooses the recipient from ownerEmail; agents cannot choose another recipient or email URL. Sends a branded Claim your page button. The owner chooses Link existing account or Create account and claim, verifies Google/email, then confirms. Account creation skips page onboarding. Maximum 4 claim emails per owner per rolling 24 hours. Delivery acceptance does not prove inbox receipt. Accepts at most 8 KB, including chunked requests.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email provider accepted the claim email. Response {ok:true,sent:true}."
          },
          "401": {
            "description": "Invalid or expired provisioning key."
          },
          "403": {
            "description": "Wrong claim token, claimed page, key or cross-origin request."
          },
          "429": {
            "description": "4 emails per intended owner per rolling 24 hours reached; Retry-After: 86400."
          },
          "502": {
            "description": "Provider could not send."
          },
          "503": {
            "description": "Email delivery or rate limit unavailable."
          },
          "413": {
            "description": "Request exceeds 8 KB."
          }
        }
      }
    },
    "/api/link/icon": {
      "get": {
        "operationId": "getWebsiteIcon",
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "summary": "Resolve the destination website\u2019s declared favicon",
        "description": "Reads the origin home page metadata, including non-/favicon.ico icons. Redirects to the durable MyReach image cache when storage is configured. Platform/custom icon choices remain available.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ],
              "default": "light"
            },
            "description": "Background color scheme. Prefers the corresponding declared favicon over larger icons for the opposite scheme."
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the declared favicon or its cached local image URL. Cache-Control: public, max-age=3600."
          },
          "400": {
            "description": "Invalid or private destination."
          },
          "404": {
            "description": "No usable icon."
          },
          "502": {
            "description": "Origin metadata unavailable and no saved metadata."
          }
        }
      }
    },
    "/api/media/image": {
      "get": {
        "operationId": "getCachedPublicImage",
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "summary": "Serve a durable local copy of a public remote image",
        "description": "Public image only, 5 MiB maximum actual bytes; accepts validated PNG/JPEG/WebP/AVIF/GIF/SVG/ICO content. DNS-pinned fetch rejects private targets and unsafe redirects. Uses existing STORE_KV metadata and FILES_BUCKET bytes; no TTL on last-good copies. On access after six hours, cached hits return immediately while background revalidation sends upstream ETag/Last-Modified validators. A 304 or identical content hash updates metadata only; changed bytes create a new cached object. Origin failures retain the last-good image and retry after 30 minutes. A fresh miss is negatively cached for five minutes. Never-cached images cannot be recovered during an origin outage. Re-import discovers replacement URLs when a website deployment changes hashed asset paths. SVG uses sandbox CSP and nosniff. Anonymous cold fills are capped at 60 per network per hour; cached hits and refreshes do not consume that budget.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cached image bytes with SHA-256 ETag, Last-Modified, nosniff, sandbox CSP, and public cache headers.",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Browser ETag matches cached image."
          },
          "400": {
            "description": "Invalid or private image URL."
          },
          "429": {
            "description": "Cold-fill network budget reached. Retry-After: 3600."
          },
          "502": {
            "description": "No cached bytes and upstream image unavailable, unsupported or oversized."
          },
          "503": {
            "description": "Media storage or safe rate-limit service unavailable."
          }
        }
      }
    },
    "/api/import/website": {
      "get": {
        "operationId": "importWebsiteBrand",
        "tags": [
          "Public unfurls \u2014 GitHub \u00b7 links"
        ],
        "summary": "Read website identity, socials and brand tokens",
        "description": "Public read-only website import. Returns profile name/bio/avatar, socialLinks, brand primary/secondary/font, favicon, pageTheme and found flags. Explicit semantic primary/secondary tokens take precedence over unrelated error/alert colors. Theme may be null when static source has no trustworthy active mode. With media storage configured, logo and favicon are copied locally and returned as absolute MyReach cache URLs. Map profile.bio to store profile.tagline; use the returned brand primary instead of forcing a preset color.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Website identity and brand suggestions; cached for up to six hours."
          },
          "400": {
            "description": "Invalid/private URL."
          },
          "502": {
            "description": "Website unavailable; no saved import response."
          }
        }
      }
    },
    "/api/agent/preview": {
      "get": {
        "tags": [
          "Agent provisioning"
        ],
        "summary": "Preview an unclaimed private page",
        "description": "Uses the actual storefront renderer. Claim token grants private read access only. No-store, noindex, no-referrer. Optional revision pins the preview; changed revisions return 409. data=1 returns a sanitized JSON snapshot.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "data",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private HTML preview or sanitized JSON."
          },
          "404": {
            "description": "Expired, claimed, or invalid preview."
          },
          "409": {
            "description": "Revision changed."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Per-page API key: Authorization: Bearer mr_live_\u2026"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "mr_session",
        "description": "Owner dashboard session cookie."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "waitlist": {
            "type": "boolean"
          },
          "upgrade": {
            "type": "boolean"
          },
          "limited": {
            "type": "boolean"
          }
        },
        "required": [
          "error"
        ]
      },
      "AuthPages": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "count",
          "limit"
        ],
        "additionalProperties": false
      },
      "AuthCapabilities": {
        "type": "object",
        "properties": {
          "storeRead": {
            "type": "boolean"
          },
          "storeWrite": {
            "type": "boolean"
          },
          "onboardingWrite": {
            "type": "boolean",
            "description": "Whether this key may publish an onboarding page. This is currently false because onboarding publication requires the owner session."
          },
          "pro": {
            "type": "boolean"
          },
          "customDomains": {
            "type": "boolean"
          }
        },
        "required": [
          "storeRead",
          "storeWrite",
          "onboardingWrite",
          "pro",
          "customDomains"
        ],
        "additionalProperties": false
      },
      "WhoamiResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "auth": {
            "type": "string",
            "enum": [
              "api-key"
            ]
          },
          "slug": {
            "type": "string"
          },
          "page": {
            "type": "string",
            "format": "uri"
          },
          "keyId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "planStatus": {
            "type": "string"
          },
          "proActive": {
            "type": "boolean"
          },
          "pages": {
            "$ref": "#/components/schemas/AuthPages"
          },
          "capabilities": {
            "$ref": "#/components/schemas/AuthCapabilities"
          }
        },
        "required": [
          "ok",
          "auth",
          "slug",
          "page",
          "keyId",
          "name",
          "plan",
          "planStatus",
          "proActive",
          "pages",
          "capabilities"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "lastUsedAt": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt",
          "lastUsedAt"
        ],
        "additionalProperties": false
      },
      "ApiKeyListResponse": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            }
          }
        },
        "required": [
          "keys"
        ],
        "additionalProperties": false
      },
      "CreateApiKeyInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "slug"
        ],
        "additionalProperties": false
      },
      "ClaimPageInput": {
        "type": "object",
        "properties": {
          "claim": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "claim",
          "slug"
        ],
        "additionalProperties": false
      },
      "CreateApiKeyResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "Shown once; the API does not return it again."
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "id",
          "slug",
          "name",
          "prefix",
          "key",
          "note"
        ],
        "additionalProperties": false
      },
      "ClaimPageResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "claimed": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "ok",
          "slug",
          "claimed"
        ],
        "additionalProperties": false
      },
      "RevokeApiKeyResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "revoked": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "revoked"
        ],
        "additionalProperties": false
      },
      "SlugAvailabilityResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "taken": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "slug",
          "taken"
        ],
        "additionalProperties": false
      },
      "SignupHumanInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 256,
            "writeOnly": true
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])?$"
          },
          "onboarding": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "name",
          "email",
          "password",
          "slug"
        ]
      },
      "SignupAgentInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])?$"
          },
          "agent": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "onboarding": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "email",
          "slug",
          "agent"
        ]
      },
      "SignupInput": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/SignupHumanInput"
          },
          {
            "$ref": "#/components/schemas/SignupAgentInput"
          },
          {
            "$ref": "#/components/schemas/ClaimPageInput"
          }
        ]
      },
      "SignupResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "onboarding": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "ok",
          "slug",
          "name",
          "plan",
          "token",
          "onboarding"
        ]
      },
      "PasswordLoginInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "writeOnly": true
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "SessionLoginResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "platformAdmin": {
            "type": "boolean",
            "description": "True when this account has platform-admin access."
          }
        },
        "required": [
          "ok",
          "slug"
        ],
        "additionalProperties": false
      },
      "MagicRequestInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "redir": {
            "type": "string",
            "description": "Optional safe same-origin return path."
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "MagicRequestResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "sent": {
            "type": "boolean"
          },
          "devLink": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "ok",
          "sent"
        ]
      },
      "AuthProviderStatus": {
        "type": "object",
        "properties": {
          "magic": {
            "type": "boolean"
          },
          "otp": {
            "type": "boolean"
          },
          "google": {
            "type": "boolean"
          },
          "agentid": {
            "type": "boolean"
          }
        },
        "required": [
          "magic",
          "otp",
          "google",
          "agentid"
        ],
        "additionalProperties": false
      },
      "AuthUser": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "planStatus": {
            "type": "string"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accountType": {
            "type": "string",
            "enum": [
              "human",
              "agent",
              "business"
            ]
          }
        },
        "required": [
          "email",
          "name",
          "slug",
          "plan",
          "providers"
        ]
      },
      "SessionResponse": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "nullable": true,
            "properties": {
              "email": {
                "type": "string",
                "format": "email"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "plan": {
                "type": "string"
              },
              "planStatus": {
                "type": "string"
              },
              "providers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "accountType": {
                "type": "string",
                "enum": [
                  "human",
                  "agent",
                  "business"
                ]
              },
              "pages": {
                "type": "array",
                "description": "All non-demo page slugs owned by this account. Empty when the account has not chosen a page slug.",
                "items": {
                  "type": "string"
                }
              },
              "platformAdmin": {
                "type": "boolean",
                "description": "Whether this signed-in account can use platform-admin tools."
              }
            },
            "required": [
              "email",
              "name",
              "slug",
              "plan",
              "providers"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "user"
        ],
        "additionalProperties": false
      },
      "ProfileInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "accountType": {
            "type": "string",
            "enum": [
              "human",
              "agent",
              "business"
            ]
          }
        },
        "required": [
          "slug"
        ],
        "additionalProperties": false
      },
      "ProfileResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "user": {
            "$ref": "#/components/schemas/AuthUser"
          }
        },
        "required": [
          "ok",
          "user"
        ],
        "additionalProperties": false
      },
      "AccountDeletedResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "deleted": {
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "ok",
          "deleted"
        ],
        "additionalProperties": false
      },
      "AccountExportResponse": {
        "type": "object",
        "description": "A page-scoped export of owner data. Private credentials and signed URLs are removed.",
        "properties": {
          "exportedAt": {
            "type": "string",
            "format": "date-time"
          },
          "account": {
            "type": "object",
            "additionalProperties": true
          },
          "page": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "analytics": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "leads": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "bookings": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "courseProgress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "growth": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "emailQueue": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "deliverySettings": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "calendarSettings": {
            "type": "object",
            "properties": {
              "google": {
                "type": "object",
                "nullable": true,
                "additionalProperties": true
              },
              "microsoft": {
                "type": "object",
                "nullable": true,
                "additionalProperties": true
              },
              "calendly": {
                "type": "object",
                "nullable": true,
                "additionalProperties": true
              }
            },
            "required": [
              "google",
              "microsoft",
              "calendly"
            ],
            "additionalProperties": false
          },
          "apiKeys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "prefix": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "number"
                },
                "lastUsedAt": {
                  "type": "number"
                },
                "revoked": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "paymentRecords": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "uploads": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "size": {
                  "type": "number"
                },
                "visibility": {
                  "type": "string",
                  "enum": [
                    "private",
                    "public"
                  ]
                }
              },
              "required": [
                "key",
                "name",
                "size",
                "visibility"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "exportedAt",
          "account",
          "page",
          "analytics",
          "leads",
          "bookings",
          "courseProgress",
          "growth",
          "emailQueue",
          "deliverySettings",
          "calendarSettings",
          "apiKeys",
          "paymentRecords",
          "uploads"
        ],
        "additionalProperties": false
      },
      "StoreProfile": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "taglineRu": {
            "type": "string"
          },
          "translations": {
            "type": "object",
            "description": "Localized profile text keyed by BCP 47 language code.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 2000
                },
                "tagline": {
                  "type": "string",
                  "maxLength": 2000
                }
              },
              "additionalProperties": false
            }
          },
          "avatar": {
            "type": "string"
          },
          "cover": {
            "type": "string"
          },
          "mobileCover": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "StoreCard": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Current Store editor types include booking, product, ecourse, digital, webinar, coaching, membership, service, community, agent, email, lead, social, link, video, instagram, podcast, and blog. Legacy and future values remain forward-compatible."
          },
          "title": {
            "type": "string"
          },
          "desc": {
            "type": "string"
          },
          "href": {
            "type": "string"
          },
          "cta": {
            "type": "string"
          },
          "translations": {
            "type": "object",
            "description": "Localized card text keyed by BCP 47 language code.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "maxLength": 2000
                },
                "desc": {
                  "type": "string",
                  "maxLength": 2000
                },
                "cta": {
                  "type": "string",
                  "maxLength": 2000
                },
                "badge": {
                  "type": "string",
                  "maxLength": 2000
                }
              },
              "additionalProperties": false
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "price": {
            "type": "number"
          },
          "booking": {
            "$ref": "#/components/schemas/BookingAvailabilitySettings"
          },
          "checkout": {
            "type": "object",
            "properties": {}
          },
          "accessUrl": {
            "type": "string"
          },
          "deliveryUrl": {
            "type": "string"
          },
          "deliveryFile": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "description": "Optional image URL for the card."
          },
          "brandIcon": {
            "type": "string",
            "description": "Optional automatic URL icon, built-in MyReach glyph or platform logo, website favicon, or named icon choice. The six-choice sets are social-custom-1\u20266, instagram-custom-1\u20266, whatsapp-custom-1\u20266, menu/menu-2\u20266, review/review-2\u20266, and location/location-2\u20266. Choice 6 in each set is an unframed SVG glyph in the theme text color; choices 1\u20135 use colorful artwork."
          },
          "durationMin": {
            "type": "integer",
            "minimum": 15,
            "description": "Booking duration in minutes."
          },
          "badge": {
            "type": "string"
          },
          "standalone": {
            "type": "boolean",
            "description": "Display this booking or coaching card as an independent offer when supported."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "calendarProvider": {
            "type": "string",
            "enum": [
              "google",
              "apple",
              "outlook",
              "teams",
              "yandex"
            ],
            "description": "Card calendar artwork choice. The top-level Store calendarProvider selects the connected booking integration."
          },
          "duration": {
            "type": "integer",
            "minimum": 15,
            "maximum": 480,
            "description": "Legacy booking duration in minutes; durationMin is preferred."
          },
          "blogFeed": {
            "$ref": "#/components/schemas/BlogFeedSnapshot"
          }
        },
        "description": "One Store card. The API keeps editable card-specific fields, including unknown forward-compatible fields. Public reads redact private delivery URLs and files; owner reads may include them."
      },
      "StoreUpdate": {
        "type": "object",
        "description": "Only recognized editable slices are saved; delivery links/files are moved to private storage.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreCard"
            }
          },
          "firstLesson": {
            "$ref": "#/components/schemas/StoreCard",
            "description": "Highlighted card: image + showIcon:true sets its small left header icon; desc is body text. feature.image is an independent optional large banner, with feature.imageFit cover/contain. cta + ctaHref + showCta:true sets the button; glow:true enables the light border. Remote public images are copied to durable media storage."
          },
          "calendly": {
            "type": "object",
            "properties": {}
          },
          "calendarProvider": {
            "type": "string",
            "enum": [
              "builtin",
              "google",
              "microsoft",
              "calendly"
            ]
          },
          "testimonials": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "translations": {
                  "type": "object",
                  "description": "Optional localized name, role, and quote keyed by language code.",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSection"
            }
          },
          "socials": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSocial"
            }
          },
          "payments": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "brand": {
            "type": "string",
            "maxLength": 120
          },
          "currency": {
            "type": "string",
            "maxLength": 3
          },
          "displayCurrency": {
            "type": "string"
          },
          "secondaryLanguage": {
            "type": "string",
            "description": "Legacy single-language field. Prefer secondaryLanguages; English remains primary.",
            "deprecated": true
          },
          "languages": {
            "type": "array",
            "description": "English plus up to two creator-selected additional languages. Activation copies existing English profile and card text into editable translations; rows stay shared.",
            "items": {
              "type": "string"
            },
            "maxItems": 3
          },
          "analytics": {
            "type": "object",
            "properties": {
              "googleMeasurementId": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "levelQuiz": {
            "type": "object",
            "properties": {}
          },
          "teaching": {
            "type": "boolean"
          },
          "onboarding": {
            "type": "object",
            "properties": {}
          },
          "accountType": {
            "type": "string",
            "enum": [
              "human",
              "agent",
              "business"
            ]
          },
          "design": {
            "$ref": "#/components/schemas/StoreDesign"
          },
          "favicon": {
            "type": "string"
          },
          "desktopBg": {
            "$ref": "#/components/schemas/DesktopBackground"
          },
          "profile": {
            "$ref": "#/components/schemas/StoreProfile"
          },
          "secondaryLanguages": {
            "type": "array",
            "maxItems": 2,
            "uniqueItems": true,
            "description": "Up to two additional BCP 47 language codes; English remains primary.",
            "items": {
              "type": "string"
            }
          },
          "translationSeeds": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "description": "Language codes whose initial editable translations were seeded from English.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "StoreSnapshot": {
        "type": "object",
        "description": "Saved page snapshot. Older snapshots may contain additional legacy properties.",
        "properties": {
          "languages": {
            "type": "array",
            "description": "Enabled languages: English and up to two additional BCP 47 language codes.",
            "items": {
              "type": "string"
            },
            "maxItems": 3
          },
          "secondaryLanguage": {
            "type": "string",
            "description": "Legacy first additional language code; use languages or secondaryLanguages for the full selection.",
            "deprecated": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreCard"
            }
          },
          "firstLesson": {
            "$ref": "#/components/schemas/StoreCard",
            "description": "Highlighted card: image + showIcon:true sets its small left header icon; desc is body text. feature.image is an independent optional large banner, with feature.imageFit cover/contain. cta + ctaHref + showCta:true sets the button; glow:true enables the light border. Remote public images are copied to durable media storage."
          },
          "calendly": {
            "type": "object",
            "properties": {}
          },
          "calendarProvider": {
            "type": "string",
            "enum": [
              "builtin",
              "google",
              "microsoft",
              "calendly"
            ]
          },
          "testimonials": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "translations": {
                  "type": "object",
                  "description": "Optional localized name, role, and quote keyed by language code.",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSection"
            }
          },
          "socials": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSocial"
            }
          },
          "payments": {
            "type": "object",
            "properties": {}
          },
          "brand": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "displayCurrency": {
            "type": "string"
          },
          "analytics": {
            "type": "object",
            "properties": {}
          },
          "levelQuiz": {
            "type": "object",
            "properties": {}
          },
          "teaching": {
            "type": "boolean"
          },
          "onboarding": {
            "type": "object",
            "properties": {}
          },
          "accountType": {
            "type": "string"
          },
          "design": {
            "$ref": "#/components/schemas/StoreDesign"
          },
          "favicon": {
            "type": "string"
          },
          "desktopBg": {
            "$ref": "#/components/schemas/DesktopBackground"
          },
          "profile": {
            "$ref": "#/components/schemas/StoreProfile"
          },
          "snapshotVersion": {
            "type": "string"
          },
          "secondaryLanguages": {
            "type": "array",
            "maxItems": 2,
            "uniqueItems": true,
            "description": "Enabled additional BCP 47 language codes; English remains primary.",
            "items": {
              "type": "string"
            }
          },
          "translationSeeds": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "description": "Language codes whose initial editable translations were seeded from English.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "OkResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": false
      },
      "BookingInput": {
        "type": "object",
        "description": "Use card with a numeric index or \"fl\" for the featured offer, or set fl:true. Name, email, date, and slot are required. The date and slot are local to the page calendar time zone. The slug is supplied in the query string.",
        "properties": {
          "card": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string",
                "pattern": "^(?:[0-9]+|fl)$"
              }
            ]
          },
          "fl": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "mail": {
            "type": "string",
            "format": "email"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "slot": {
            "type": "string",
            "pattern": "^\\d{1,2}:\\d{2}$"
          },
          "level": {
            "type": "string",
            "enum": [
              "A1",
              "A2",
              "B1",
              "B2",
              "C1",
              "C2",
              "unknown"
            ]
          },
          "levelSource": {
            "type": "string",
            "enum": [
              "quiz",
              "self"
            ]
          }
        },
        "required": [
          "name",
          "mail",
          "date",
          "slot"
        ],
        "additionalProperties": true,
        "anyOf": [
          {
            "required": [
              "card"
            ]
          },
          {
            "required": [
              "fl"
            ]
          }
        ]
      },
      "Booking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "ts": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "mail": {
            "type": "string",
            "format": "email"
          },
          "card": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "slot": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "levelSource": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "paymentStatus": {
            "type": "string"
          },
          "calendarProvider": {
            "type": "string"
          },
          "calendarStatus": {
            "type": "string",
            "enum": [
              "external",
              "created",
              "failed",
              "not-applicable"
            ]
          },
          "calendarEventId": {
            "type": "string"
          },
          "joinUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "BookingCreateResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "requested"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "status",
          "id"
        ],
        "additionalProperties": false
      },
      "BookingsResponse": {
        "type": "object",
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          }
        },
        "required": [
          "bookings"
        ],
        "additionalProperties": false
      },
      "LeadInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "contact": {
            "type": "string",
            "minLength": 4,
            "maxLength": 120
          },
          "goal": {
            "type": "string",
            "maxLength": 20
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "ru"
            ]
          },
          "src": {
            "type": "string",
            "maxLength": 40
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "contact"
        ]
      },
      "Lead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ts": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "goal": {
            "type": "string"
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "ru"
            ]
          },
          "src": {
            "type": "string"
          },
          "fields": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "id",
          "ts",
          "name",
          "contact",
          "goal",
          "lang",
          "src"
        ]
      },
      "LeadCreateResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "id"
        ],
        "additionalProperties": false
      },
      "LeadsResponse": {
        "type": "object",
        "properties": {
          "leads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lead"
            }
          }
        },
        "required": [
          "leads"
        ],
        "additionalProperties": false
      },
      "CourseProgressInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CourseEnrollInput"
          },
          {
            "$ref": "#/components/schemas/CourseLessonInput"
          }
        ]
      },
      "CourseStudent": {
        "type": "object",
        "properties": {
          "course": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedLessons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastActivityAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "course",
          "email",
          "name",
          "startedAt",
          "completedLessons"
        ]
      },
      "CourseProgressResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "enrolled": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "ok",
              "enrolled"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/OkResponse"
          }
        ]
      },
      "CourseStudentsResponse": {
        "type": "object",
        "properties": {
          "students": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourseStudent"
            }
          }
        },
        "required": [
          "students"
        ],
        "additionalProperties": false
      },
      "AnalyticsInput": {
        "type": "object",
        "description": "Only events with analyticsConsent:true are recorded; absent/false consent returns {ok:true,ignored:true}. Supported types are visit, click, and attention. Visits add aggregate source, country, device, browser, and platform counts; clicks add an item label, category, and coarse 5%-grid page coordinates; attention adds up to 15 active visible seconds. Raw IP addresses, full referrer URLs, and click URLs are not stored. Booking events are rejected because booking analytics are server-controlled.",
        "properties": {
          "analyticsConsent": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "visit",
              "click",
              "attention",
              "booking"
            ]
          },
          "item": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15
          },
          "eventId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": []
      },
      "AnalyticsDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "visits": {
            "type": "integer"
          },
          "clicks": {
            "type": "integer"
          },
          "bookings": {
            "type": "integer"
          },
          "revenue": {
            "type": "number"
          }
        },
        "required": [
          "date",
          "visits",
          "clicks",
          "bookings",
          "revenue"
        ],
        "additionalProperties": false
      },
      "AnalyticsTotal": {
        "type": "object",
        "properties": {
          "visits": {
            "type": "integer"
          },
          "clicks": {
            "type": "integer"
          },
          "bookings": {
            "type": "integer"
          },
          "revenue": {
            "type": "number"
          },
          "direct": {
            "type": "integer"
          },
          "attentionSeconds": {
            "type": "integer",
            "description": "Visible active seconds summed across consented visits."
          }
        }
      },
      "AnalyticsRow": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "count": {
            "type": "number"
          }
        }
      },
      "AnalyticsHeatPoint": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "count": {
            "type": "number"
          },
          "weight": {
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "count",
          "weight"
        ],
        "additionalProperties": false
      },
      "AnalyticsResponse": {
        "type": "object",
        "properties": {
          "range": {
            "type": "integer",
            "minimum": 7,
            "maximum": 90
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsDay"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/AnalyticsTotal"
          },
          "clicks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "clickTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "browsers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "heatmap": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsHeatPoint"
            }
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "range",
          "days",
          "totals",
          "clicks",
          "clickTypes",
          "sources",
          "countries",
          "devices",
          "browsers",
          "platforms",
          "heatmap",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "PaymentConfigResponse": {
        "type": "object",
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "stripeConnected": {
            "type": "boolean"
          },
          "stripeKeysConnected": {
            "type": "boolean"
          },
          "stripeWebhookConfigured": {
            "type": "boolean"
          },
          "stripePk": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "stripe"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "connected",
          "stripeConnected",
          "stripeKeysConnected",
          "stripeWebhookConfigured",
          "stripePk",
          "provider",
          "enabled"
        ],
        "additionalProperties": false
      },
      "PaymentConfigInput": {
        "type": "object",
        "description": "Compatibility request only. Credential properties secretKey, publishableKey, webhookSecret and shopId are rejected.",
        "not": {
          "anyOf": [
            {
              "required": [
                "secretKey"
              ]
            },
            {
              "required": [
                "publishableKey"
              ]
            },
            {
              "required": [
                "webhookSecret"
              ]
            },
            {
              "required": [
                "shopId"
              ]
            }
          ]
        },
        "additionalProperties": true
      },
      "PaymentConfigSaveResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "connected": {
            "type": "boolean"
          },
          "provider": {
            "type": "string",
            "enum": [
              "stripe"
            ]
          }
        },
        "required": [
          "ok",
          "connected",
          "provider"
        ],
        "additionalProperties": false
      },
      "PayCreateInput": {
        "type": "object",
        "description": "Booking: provide card (numeric index or \"fl\") or fl:true, plus date and slot. Product/course: provide card.index and kind=product or course. In every case name and mail are required.",
        "properties": {
          "slug": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "booking",
              "product",
              "course"
            ]
          },
          "product": {
            "type": "boolean",
            "description": "Legacy product selector."
          },
          "card": {
            "type": "object",
            "properties": {
              "index": {
                "type": "number"
              }
            },
            "required": [
              "index"
            ],
            "additionalProperties": false
          },
          "fl": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "slot": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "mail": {
            "type": "string",
            "format": "email"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "paymentPlan": {
            "type": "boolean"
          },
          "level": {
            "type": "string"
          },
          "levelSource": {
            "type": "string",
            "enum": [
              "quiz",
              "self"
            ]
          },
          "checkoutAttemptId": {
            "type": "string",
            "format": "uuid"
          },
          "ret": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "mail"
        ],
        "additionalProperties": true
      },
      "PayCreateResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "paymentId": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "provider": {
            "type": "string",
            "enum": [
              "stripe"
            ]
          }
        },
        "required": [
          "url",
          "paymentId",
          "amount",
          "currency",
          "provider"
        ],
        "additionalProperties": false
      },
      "PaymentStatusResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "free"
                ]
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "hold",
                  "paid"
                ]
              },
              "deliveryUrl": {
                "type": "string"
              },
              "accessLabel": {
                "type": "string"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DomainSearchResult": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "renew": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "string",
                "nullable": true
              }
            ]
          },
          "available": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "label",
          "domain",
          "price",
          "available"
        ]
      },
      "DomainSearchResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "q": {
                "type": "string"
              },
              "tld": {
                "type": "string",
                "enum": [
                  ".top"
                ]
              },
              "results": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DomainSearchResult"
                }
              }
            },
            "required": [
              "ok",
              "q",
              "tld",
              "results"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "enum": [
                  false
                ]
              },
              "error": {
                "type": "string"
              }
            },
            "required": [
              "ok",
              "error"
            ],
            "additionalProperties": false
          }
        ]
      },
      "PageSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "avatar": {
            "type": "string"
          },
          "cards": {
            "type": "integer"
          },
          "domain": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "visits": {
            "type": "number"
          },
          "clicks": {
            "type": "number"
          },
          "bookings": {
            "type": "number"
          },
          "revenue": {
            "type": "number"
          }
        },
        "required": [
          "slug",
          "name",
          "brand",
          "avatar",
          "cards",
          "domain",
          "path",
          "url",
          "visits",
          "clicks",
          "bookings",
          "revenue"
        ],
        "additionalProperties": false
      },
      "PagesOverviewResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "range": {
            "type": "integer",
            "enum": [
              7,
              30,
              90
            ]
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageSummary"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/PageTotals"
          },
          "plan": {
            "type": "string"
          },
          "planStatus": {
            "type": "string"
          },
          "pro": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "canCreate": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "range",
          "pages",
          "totals",
          "plan",
          "planStatus",
          "pro",
          "limit",
          "canCreate"
        ],
        "additionalProperties": false
      },
      "CreatePageInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])?$"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          }
        },
        "required": [
          "slug"
        ],
        "additionalProperties": false
      },
      "CreatePageResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "redirect": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "slug",
          "name",
          "redirect"
        ],
        "additionalProperties": false
      },
      "GitHubProfilePreview": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "org"
            ]
          },
          "login": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "bio": {
            "type": "string"
          },
          "blog": {
            "type": "string"
          },
          "avatar": {
            "type": "string"
          },
          "repos": {
            "type": "integer"
          },
          "followers": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "kind",
          "login",
          "name",
          "bio",
          "blog",
          "avatar",
          "repos",
          "followers",
          "url",
          "at",
          "stale"
        ],
        "additionalProperties": false
      },
      "GitHubRepoPreview": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "repo"
            ]
          },
          "fullName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "stars": {
            "type": "integer"
          },
          "forks": {
            "type": "integer"
          },
          "avatar": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "homepage": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "kind",
          "fullName",
          "description",
          "language",
          "stars",
          "forks",
          "avatar",
          "owner",
          "url",
          "homepage",
          "at",
          "stale"
        ],
        "additionalProperties": false
      },
      "GitHubPreviewResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/GitHubProfilePreview"
          },
          {
            "$ref": "#/components/schemas/GitHubRepoPreview"
          }
        ]
      },
      "LinkMetaResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "host": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "image": {
            "type": "string"
          },
          "profileImage": {
            "type": "string",
            "description": "Extracted Instagram or LinkedIn profile image; absent when the target is not a supported profile page or no image was found."
          },
          "favicon": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          },
          "myreach": {
            "type": "boolean",
            "description": "True when metadata came from a published MyReach page."
          }
        },
        "required": [
          "ok",
          "url",
          "host",
          "title",
          "description",
          "image",
          "favicon"
        ],
        "additionalProperties": false
      },
      "PageTotals": {
        "type": "object",
        "properties": {
          "visits": {
            "type": "number"
          },
          "clicks": {
            "type": "number"
          },
          "bookings": {
            "type": "number"
          },
          "revenue": {
            "type": "number"
          }
        },
        "required": [
          "visits",
          "clicks",
          "bookings",
          "revenue"
        ],
        "additionalProperties": false
      },
      "CourseEnrollInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "idx": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string"
              }
            ]
          },
          "event": {
            "type": "string",
            "enum": [
              "enroll"
            ]
          },
          "paymentId": {
            "type": "string"
          },
          "mail": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "idx",
          "event",
          "paymentId",
          "mail"
        ],
        "additionalProperties": true
      },
      "CourseLessonInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "idx": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string"
              }
            ]
          },
          "event": {
            "type": "string",
            "enum": [
              "complete",
              "uncomplete"
            ]
          },
          "mail": {
            "type": "string",
            "format": "email"
          },
          "lessonId": {
            "type": "string"
          }
        },
        "required": [
          "idx",
          "event"
        ],
        "additionalProperties": true
      },
      "AuthProvidersResponse": {
        "type": "object",
        "properties": {
          "providers": {
            "$ref": "#/components/schemas/AuthProviderStatus"
          }
        },
        "required": [
          "providers"
        ],
        "additionalProperties": false
      },
      "BlogDiscoverInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "description": "Public http(s) blog, article, RSS, Atom, or JSON Feed URL."
          }
        }
      },
      "BlogEntry": {
        "type": "object",
        "required": [
          "href",
          "title"
        ],
        "properties": {
          "href": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 600
          },
          "image": {
            "type": "string",
            "description": "Preview image URL when available; may be an empty string."
          },
          "publishedAt": {
            "type": "string",
            "maxLength": 80
          }
        }
      },
      "BlogDiscoverResponse": {
        "type": "object",
        "required": [
          "ok",
          "sourceUrl",
          "feedUrl",
          "platform",
          "strategy",
          "siteTitle",
          "items"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "feedUrl": {
            "type": "string",
            "description": "Empty when the page-preview fallback was used."
          },
          "platform": {
            "type": "string",
            "enum": [
              "rss",
              "wordpress",
              "substack",
              "website"
            ]
          },
          "strategy": {
            "type": "string",
            "enum": [
              "feed",
              "page"
            ]
          },
          "siteTitle": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/BlogEntry"
            }
          }
        }
      },
      "OtpRequestInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "redir": {
            "type": "string",
            "description": "Local return path. The claim browser sets /login?claim=TOKEN&account=new when the owner chooses Create account and claim; existing accounts use account=existing. New claim accounts skip page creation onboarding."
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "OtpRequestResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "sent": {
            "type": "boolean",
            "description": "False only when a development code is returned."
          },
          "devCode": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "Only returned by explicitly enabled development auth."
          }
        },
        "required": [
          "ok",
          "sent"
        ],
        "additionalProperties": false
      },
      "OtpVerifyInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "email",
          "code"
        ],
        "additionalProperties": false
      },
      "CalendarProvider": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "connected": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "configured",
          "connected"
        ]
      },
      "CalendarProvidersResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "google": {
            "$ref": "#/components/schemas/CalendarProvider"
          },
          "microsoft": {
            "$ref": "#/components/schemas/CalendarProvider"
          },
          "calendly": {
            "$ref": "#/components/schemas/CalendarProvider"
          }
        },
        "required": [
          "google",
          "microsoft",
          "calendly"
        ]
      },
      "CalendarDisconnectResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "disconnected": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "ok",
          "disconnected"
        ]
      },
      "CalendarBookingLink": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "builtin",
              "google",
              "microsoft",
              "calendly"
            ]
          },
          "connected": {
            "type": "boolean"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "provider",
          "connected"
        ]
      },
      "StripeConnectRequirements": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "currentlyDue": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pastDue": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "currentlyDue",
          "pastDue"
        ]
      },
      "StripeConnectStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "linked": {
            "type": "boolean"
          },
          "accountId": {
            "type": "string"
          },
          "ready": {
            "type": "boolean"
          },
          "chargesEnabled": {
            "type": "boolean"
          },
          "payoutsEnabled": {
            "type": "boolean"
          },
          "transfersEnabled": {
            "type": "boolean"
          },
          "detailsSubmitted": {
            "type": "boolean"
          },
          "requirements": {
            "$ref": "#/components/schemas/StripeConnectRequirements"
          }
        },
        "required": [
          "configured",
          "linked",
          "accountId",
          "ready",
          "chargesEnabled",
          "payoutsEnabled",
          "transfersEnabled",
          "detailsSubmitted",
          "requirements"
        ]
      },
      "StripeConnectStartResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "accountId": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "url",
          "accountId"
        ]
      },
      "StripeConnectLinkInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9]+$"
          },
          "stripeConnectAccountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9]+$"
          }
        },
        "anyOf": [
          {
            "required": [
              "accountId"
            ]
          },
          {
            "required": [
              "stripeConnectAccountId"
            ]
          }
        ]
      },
      "BookingAvailabilitySettings": {
        "type": "object",
        "description": "Weekly availability for one booking offer, not continuous opening hours. Weekday values use JavaScript numbering: Sunday 0 through Saturday 6. Times are local start times in HH:mm format and use the page calendar time zone.",
        "properties": {
          "weekdays": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "uniqueItems": true
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
            },
            "uniqueItems": true
          }
        },
        "additionalProperties": true
      },
      "StoreSocial": {
        "type": "object",
        "description": "A social profile link. iconStyle selects the MyReach SVG glyph or original network logo wherever this social appears.",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "href": {
            "type": "string",
            "format": "uri-reference"
          },
          "visible": {
            "type": "boolean"
          },
          "iconStyle": {
            "type": "string",
            "enum": [
              "svg",
              "logo"
            ],
            "description": "svg uses the MyReach glyph in the page text color; logo uses the original network mark when available."
          }
        },
        "additionalProperties": true
      },
      "StoreDesign": {
        "type": "object",
        "description": "Saved page presentation. Freestyle controls include layout, palette, background, outline, type, icon/header shape, desktop presentation, and per-layout button/card radii. Frozen theme presets supply and lock their own visual tokens. Custom pageBackground and outlineColor apply to freestyle layouts except Midnight. Cookie-consent and waitlist dialogs inherit the page theme; they have no separate design fields.",
        "properties": {
          "layout": {
            "type": "string",
            "enum": [
              "cover",
              "links",
              "boutique",
              "midnight",
              "magazine",
              "windows8"
            ],
            "description": "Freestyle structural layout. windows8 is theme-driven; its frozen theme sets this layout automatically."
          },
          "theme": {
            "type": "string",
            "nullable": true,
            "description": "Frozen theme preset identifier, or null for freestyle. GitHub and GitLab are available to human pages; all nine presets are available to agent and business pages.",
            "enum": [
              "github",
              "gitlab",
              "openclaw",
              "hermes",
              "gitlawb",
              "mistral",
              "openai",
              "claude",
              "windows8"
            ]
          },
          "accent": {
            "type": "string",
            "description": "Named palette (green, teal, cyan, blue, indigo, navy, purple, pink, red, orange, amber, lime, terracotta, yaksebe, slate, black) or custom."
          },
          "primary": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Custom main accent color."
          },
          "secondary": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Optional custom secondary accent color."
          },
          "pageBackground": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Optional custom page and surface background color."
          },
          "outlineColor": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Optional custom border and outline color."
          },
          "desktopMode": {
            "type": "string",
            "enum": [
              "desktop",
              "mobile-first"
            ],
            "description": "desktop uses the wider desktop page presentation; mobile-first keeps the narrow mobile page column centered on desktop."
          },
          "headerMode": {
            "type": "string",
            "enum": [
              "circle",
              "background"
            ],
            "description": "Freestyle profile header treatment."
          },
          "iconShape": {
            "type": "string",
            "enum": [
              "rounded",
              "circle"
            ],
            "description": "Rounded-square or circle icon tiles."
          },
          "font": {
            "type": "string",
            "enum": [
              "inter",
              "dm-sans",
              "jakarta",
              "manrope",
              "mono",
              "sans",
              "serif",
              "mona",
              "gitlab-sans",
              "geist-mono",
              "switzer"
            ],
            "description": "Freestyle font choices are inter, dm-sans, jakarta, and manrope. Other values are used by frozen themes or legacy snapshots."
          },
          "radiusCover": {
            "$ref": "#/components/schemas/DesignRadii"
          },
          "radiusLinks": {
            "$ref": "#/components/schemas/DesignRadii"
          },
          "radiusBoutique": {
            "$ref": "#/components/schemas/DesignRadii"
          },
          "radiusMidnight": {
            "$ref": "#/components/schemas/DesignRadii"
          },
          "radiusMagazine": {
            "$ref": "#/components/schemas/DesignRadii"
          },
          "buttonRadius": {
            "type": "integer",
            "minimum": 6,
            "maximum": 32,
            "description": "Legacy shared button radius; per-layout radius settings take precedence."
          },
          "cardRadius": {
            "type": "integer",
            "minimum": 6,
            "maximum": 40,
            "description": "Legacy shared card radius; per-layout radius settings take precedence."
          },
          "priceFont": {
            "type": "string",
            "enum": [
              "mona"
            ],
            "description": "Optional alternate price font."
          }
        },
        "additionalProperties": true
      },
      "CalendarAvailabilityResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "builtin",
              "google",
              "microsoft",
              "calendly"
            ]
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
            },
            "description": "Available local start times for the requested date."
          }
        },
        "required": [
          "ok",
          "provider",
          "slots"
        ],
        "additionalProperties": false
      },
      "DesignRadii": {
        "type": "object",
        "description": "Per-layout radius overrides in pixels. Button values are 6\u201332; card values are 6\u201340.",
        "properties": {
          "button": {
            "type": "integer",
            "minimum": 6,
            "maximum": 32
          },
          "card": {
            "type": "integer",
            "minimum": 6,
            "maximum": 40
          }
        },
        "additionalProperties": false
      },
      "StoreSection": {
        "type": "object",
        "description": "A visible page section. Carousel presentation is shared across card, blog/article-feed, and testimonial carousels: the centered item is emphasized and neighboring items are dimmed.",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "cards",
              "carousel",
              "testimonials"
            ]
          },
          "title": {
            "type": "string"
          },
          "translations": {
            "type": "object",
            "description": "Localized section titles keyed by BCP 47 language code.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "itemIndexes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "uniqueItems": true,
            "description": "Indexes into the Store items array; used by cards and carousel sections."
          },
          "testimonialIndexes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "uniqueItems": true,
            "description": "Indexes into the testimonials array."
          },
          "carouselLayout": {
            "type": "string",
            "enum": [
              "square",
              "wide"
            ],
            "description": "Carousel card shape."
          }
        },
        "additionalProperties": true
      },
      "BlogFeedSnapshot": {
        "type": "object",
        "description": "Saved public-feed discovery result and display controls for a blog card. Public URLs only; at most ten entries.",
        "properties": {
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "requestUrl": {
            "type": "string",
            "format": "uri"
          },
          "verifiedRequestUrl": {
            "type": "string",
            "format": "uri"
          },
          "feedUrl": {
            "type": "string",
            "format": "uri"
          },
          "siteTitle": {
            "type": "string",
            "maxLength": 120
          },
          "platform": {
            "type": "string",
            "enum": [
              "wordpress",
              "substack",
              "rss",
              "website"
            ]
          },
          "strategy": {
            "type": "string",
            "enum": [
              "feed",
              "page"
            ]
          },
          "fetchedAt": {
            "type": "string"
          },
          "display": {
            "type": "object",
            "properties": {
              "showImage": {
                "type": "boolean"
              },
              "showTitle": {
                "type": "boolean"
              },
              "showDescription": {
                "type": "boolean"
              },
              "titleLimit": {
                "type": "integer",
                "minimum": 30,
                "maximum": 120
              },
              "descriptionLimit": {
                "type": "integer",
                "minimum": 60,
                "maximum": 240
              },
              "imageRatio": {
                "type": "string",
                "enum": [
                  "square",
                  "landscape",
                  "portrait"
                ]
              }
            },
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/BlogEntry"
            }
          }
        },
        "additionalProperties": true
      },
      "DesktopBackground": {
        "type": "object",
        "description": "Optional desktop/tablet backdrop displayed outside the page sheet.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          },
          "wash": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "transparentSheet": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "AgentPageCreate": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])?$",
            "example": "your-project"
          },
          "ownerEmail": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string",
            "maxLength": 80
          }
        },
        "required": [
          "slug",
          "ownerEmail"
        ]
      },
      "AgentPageCreated": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "key": {
            "type": "string",
            "description": "Temporary page-scoped bearer key, shown only once. Store securely. Revoked on owner confirmation."
          },
          "claimUrl": {
            "type": "string",
            "format": "uri",
            "description": "Open in the intended owner browser. It is not a login session and cannot prove ownership by itself."
          },
          "expiresAt": {
            "type": "integer",
            "description": "Unix seconds. Unclaimed page, claim URL and builder key expire at this time."
          },
          "ownership": {
            "type": "string",
            "enum": [
              "pending"
            ]
          },
          "note": {
            "type": "string"
          },
          "previewUrl": {
            "type": "string",
            "description": "Private no-store preview. Public page returns 404 before claim."
          },
          "revision": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "slug",
          "url",
          "key",
          "claimUrl",
          "expiresAt",
          "ownership"
        ]
      },
      "AgentClaimStatus": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "slug": {
            "type": "string"
          },
          "ownerEmail": {
            "type": "string",
            "format": "email"
          },
          "claimed": {
            "type": "boolean"
          },
          "expiresAt": {
            "type": "integer"
          },
          "revision": {
            "type": "string"
          },
          "previewUrl": {
            "type": "string",
            "description": "Private preview pinned to this revision. Unavailable after claim."
          }
        },
        "required": [
          "ok",
          "slug",
          "ownerEmail",
          "claimed",
          "expiresAt"
        ]
      },
      "AgentClaimConfirmed": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "slug": {
            "type": "string"
          },
          "claimed": {
            "type": "boolean"
          },
          "provisioningKeyRevoked": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "slug",
          "claimed"
        ]
      }
    }
  }
}
