R
registermysite.com

API Reference

Endpoints powering authentication, domain workflows, subscriptions, and account data on RegisterMySite. Base URL depends on your deployment host.

Base URL
https://registermysite.com
Format

JSON request & response bodies

Auth

Session cookie or Bearer token where noted

Authentication

GET /api/auth/google

Start Google OAuth. Redirects the browser to Google, then back to the callback.

No body. Sets short-lived OAuth state in KV.

GET /api/auth/github

Start GitHub OAuth. Same pattern as Google with GitHub authorize URL.

GET /api/auth/callback/google

OAuth callback. Query: code, state. Creates/finds user in D1, opens Durable Object session, sets session cookie, redirects to /dashboard.

GET /api/auth/callback/github

GitHub OAuth callback — same session flow as Google.

GET /api/auth/me

Current user from session cookie. 401 if logged out.

{
  "user": {
    "id": "uuid",
    "email": "[email protected]",
    "name": "Jane Doe",
    "avatar_url": "https://…",
    "provider": "google"
  }
}
POST /api/auth/logout

Destroys Durable Object session and clears the session cookie.

Dashboard

GET /api/dashboard

Protected. Requires valid session. Returns welcome payload and user profile for the dashboard UI.

{
  "message": "Welcome back, Jane!",
  "user": { "id": "…", "email": "…", "name": "…", "provider": "github" }
}

Checkout & billing

POST /api/checkout/create-subscription

Creates a subscription for a pricing plan. Body fields from the checkout form. Integrate with Stripe (or similar) on the server; return clientSecret or redirectUrl.

Request body

{
  "plan": "starter" | "growth" | "pro",
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "[email protected]",
  "company": "Acme" | null,
  "country": "US",
  "postal": "90210"
}

Plans

starter — $49/mo
growth — $129/mo
pro — $299/mo

Domain & tools

Interactive domain search and WHOIS-style checks are primarily implemented in the Domain Search UI (including client-side availability checks). Server-side registration handoff can target:

GET /register?domain={name}

Additional tool pages (QR, TLD search, payments demos) are served as static/app routes under /tools/…. Extend this reference as you expose dedicated JSON endpoints for those tools.

System

GET /api/health

Liveness check for monitoring and deploy verification.

{
  "ok": true,
  "timestamp": "2026-07-26T11:00:00.000Z"
}

Errors

Status Meaning
400Missing or invalid parameters
401Not authenticated / invalid session
403Authenticated but not allowed
404Route or resource not found
500Server error (check Worker logs)

Error bodies typically include {"message": "…"}.

Infrastructure

APIs run on Cloudflare Workers with D1 (users), KV (OAuth state), and Durable Objects (sessions). Deploy and manage with wrangler. You own the project code and data bindings in your account.

Building on RegisterMySite?

Need a custom endpoint for domains, billing webhooks, or your client dashboard? We implement APIs in-house and hand off the source.