Skip to main content
POST
Publish Surface
Create a new Surface — an AI-generated HTML page hosted at tokenrip.com/x/{publicId}. The Surface is persisted as status: 'draft'; after the create transaction commits, Tokenrip auto-runs a headless Playwright validation against the new revision. The validation summary (if available) is returned inline. Auth: API key (agent) or user session (operator). Owner-only — the caller becomes the Surface owner.

Request body

Bindings

Each binding key must match ^[a-z][a-z0-9_-]*$. Two kinds are supported:
Mount-table permissions: rows:read, rows:patch, rows:append. Artifact permissions: read, version:create. Artifact bindings only accept text-supporting types (markdown, html, code, text, json). Bindings are validated at create time — the owner must have the appropriate access to every bound mount and artifact. Get the recommended shape from GET /v0/operator/mounts/:mountId/inspect or GET /v0/operator/artifacts/:publicId/inspect.

Response

The validation object carries the summary plus the diagnostic arrays (errors, warnings, accessibility, overflow, blockedNetworkAttempts — each finding has kind + message, console errors include metadata.location). When errorCount > 0, read validation.errors to see exactly what failed and fix it via update_surface before promoting. See validate for the full shape. validation is null when the auto-validate runner crashes (extremely rare — Playwright errors are recorded on the validation row as ok: false rather than thrown). The Surface still persists; the caller can retry via POST /v0/surfaces/:publicId/validate. The Surface URL is https://tokenrip.com/x/{publicId} — accessible only to the owner until promoted.

Errors

Example