Skip to content

Built-in Site Endpoints ​

Every Based Page deployment includes two built-in endpoints you can use directly from your site's HTML and JavaScript. No backend required.

Form Submissions ​

POST /_submit ​

Accepts form submissions from your deployed page and stores them securely. Only the site owner can read submissions.

Use from HTML:

html
<form action="/_submit" method="POST">
  <input name="email" type="email" required />
  <input name="name" type="text" />
  <button type="submit">Subscribe</button>
</form>

Use from JavaScript:

javascript
await fetch('/_submit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: 'user@example.com', name: 'Alice' })
});

Limits:

TierDaily submissionsMax stored
Agent (no account)50/day200
Free250/day500
Pro1,000/day10,000
  • Maximum payload size: 10 KB
  • Oldest submissions are pruned automatically when the stored limit is reached
  • Rate limited: 10 submissions per minute per IP
  • Honeypot field: include a hidden <input name="_hp" /> to filter bots (any non-empty value is rejected)

Reading submissions:

Use the get_submissions MCP tool, the API (GET /deploy/:id/submissions), or the dashboard. Submissions are never readable publicly.


Counters ​

Counters are simple named integers you can increment from your site. Useful for tracking clicks, votes, signups, or any event you want to count.

GET /_counter/:name ​

Read the current value of a counter.

javascript
const res = await fetch('/_counter/signup-clicks');
const { value } = await res.json();
// { name: "signup-clicks", value: 142, slug: "my-site" }

Response is cached for 10 seconds (Cache-Control: public, max-age=10).

POST /_counter/:name/increment ​

Increment a counter by 1.

javascript
await fetch('/_counter/signup-clicks/increment', { method: 'POST' });

Limits:

  • Counters per deployment: 10 (Agent), 50 (Free), 100 (Pro)
  • Rate limited: 60 increments per minute per IP
  • Counter names: alphanumeric, hyphens, underscores only

Example - track button clicks:

html
<button onclick="fetch('/_counter/cta-clicks/increment', { method: 'POST' })">
  Get Started
</button>

Reading counters:

Use the list_counters MCP tool or GET /deploy/:id/counters API endpoint.


When to use what ​

NeedUse
Collect form data (emails, messages, etc.)/_submit
Track events or counts/_counter/:name/increment
Complex queries, user auth, relationshipsExternal service (Supabase, PlanetScale)
Real-time dataExternal service

Deploy apps from conversation.