Project API

Integration contracts and server-owned route posture.

Integration-facing view for read contracts, guarded mutations, and broader platform-edge routes.

Live publishingRefine migration activeCadence: Monthly issue cycleRead-only previewUpdated Apr 5, 2026, 8:29 AM UTC12 read contracts

Refine runtime

The API lane now turns the workbench into a clearer SaaS platform, not only an internal UI shell.

Instead of hiding contracts in route files and release notes, the project now exposes its read surface, guarded mutation inventory, and platform-edge posture inside one server-backed integration desk.

Server baseline ready12 read contracts9 guarded writesBaseline Apr 5, 2026, 8:29 AM UTCWaiting for live sync
Read contracts12

Project-scoped GET routes that currently power the live Refine workbench.

Collection routes3

List endpoints with Refine-friendly pagination and richer project metadata.

Detail routes9

Stable server-baseline resources for project-specific SaaS posture and contracts.

Guarded writes9

Operator-only mutations kept behind the server-side auth boundary.

Platform edges4

Health, commerce, and webhook routes living outside the project UI shell.

Auth modes5

Distinct read, operator, public-commerce, and verified-callback postures.

Recent governance events0

Latest guarded workbench actions now leave a visible audit trail.

Latest governed actionNo recent event

The audit trail stays project-scoped so route governance can be checked quickly.

Auth modes

Each API path now has a clearer audience and trust rule.

  • Project preview: Anonymous or non-operator viewers can read project-scoped workbench resources, but they cannot trigger side effects.
  • Owner read lane: A signed owner session can keep project reads and operator-facing runtime views available without immediately widening into a heavier account-center model.
  • Fresh owner write lane: Guarded project mutations now require a fresher owner-bound session, so compile, review, delivery, governed settings, and demand, telemetry, or usage intervention writes do not ride indefinitely on an older read cookie.
  • Public commerce edge: Checkout creation and status lookup stay public-facing, but they still resolve through validated server handlers.
  • Verified callback: Provider-originated webhook traffic is signature-verified before it can affect billing or activation state.

Operator ledger

Guarded writes now leave a visible audit trail instead of disappearing into private memory.

Recent guarded actions will appear here after the next operator write or pipeline run.

Response shapes

The route family is more useful when the browser and the server agree on one contract language.

ShapeContractDetail
List response{ data, total, page, pageSize, ...summary }Collection routes keep Refine-friendly pagination while still returning project-specific metadata such as summaries and warnings.
Detail response{ data }Project detail resources stay calm and stable on first paint because the server baseline and client hydration share the same shape.
Mutation success{ data } or action-state payloadOperator routes return a machine-readable success shape while still supporting redirect-based flows for form posts.
Error response{ error, code, fieldErrors? }Contract errors are normalized so browser runtime panels can surface safe messages without leaking service internals.

Project read contracts

The resource family now has a visible read map instead of an implied one.

ResourceMethodAccessContract
Overview

/api/workbench/project/core-publication/overview

GETprojectDetail resource with project-scoped summary data for the workbench.
Automation

/api/workbench/project/core-publication/automation

GETprojectDetail resource with compile readiness, downstream lane posture, and protected operator compile actions.
Issues

/api/workbench/project/core-publication/issues

GETprojectCollection resource with refine-friendly pagination and normalized list shape.
Reviews

/api/workbench/project/core-publication/reviews

GETprojectCollection resource with refine-friendly pagination and normalized list shape.
Delivery

/api/workbench/project/core-publication/delivery

GETprojectCollection resource with refine-friendly pagination and normalized list shape.
Audience

/api/workbench/project/core-publication/audience

GETprojectDetail resource with aggregate demand posture, operator-safe watch controls, and no contact-level lead exposure.
Usage

/api/workbench/project/core-publication/usage

GETprojectDetail resource with project-scoped usage throughput, intervention controls, and lane-utilization signals.
API

/api/workbench/project/core-publication/api

GETprojectDetail resource with integration contracts, guarded mutation inventory, and platform edge coverage.
Billing

/api/workbench/project/core-publication/billing

GETprojectDetail resource with commercial readiness, project-owned billing controls, and safe operator-only writes.
Events

/api/workbench/project/core-publication/events

GETprojectDetail resource with telemetry posture, operator-safe watch controls, and no raw event-row exposure.
Settings

/api/workbench/project/core-publication/settings

GETprojectDetail resource with governed project settings reads and safe operator-only writes.
Guide

/api/workbench/project/core-publication/guide

GETprojectDetail resource with runbooks, release references, route maps, and durable operator memory for the live project.

Writes and platform edges

The broader SaaS feel comes from exposing the real boundaries, not by pretending every route is the same.

MutationMethodAccessDetail
Audience watch update

/api/workbench/project/core-publication/audience

PATCHoperatorSaves aggregate-only audience focus, watch window, and operator note without exposing contact-level lead rows.
Usage intervention update

/api/workbench/project/core-publication/usage

PATCHoperatorSaves project usage focus, intervention mode, target lane, and operator note without exposing billing or recipient-level internals.
Compile cycle

/api/workbench/project/core-publication/automation/compile

POSToperatorTriggers the guarded compile lane while the service layer keeps issue materialization and downstream invalidation server-owned.
Review run

/api/workbench/project/core-publication/reviews/run

POSToperatorRuns quality review for one issue slug through the protected operator lane instead of trusting browser access alone.
Review sweep

/api/workbench/project/core-publication/reviews/sweep

POSToperatorExecutes the full project review sweep to refresh gate posture across the current issue ledger.
Delivery run

/api/workbench/project/core-publication/delivery/run

POSToperatorRuns the latest delivery candidate without exposing recipient-side side effects directly to the browser.
Governance update

/api/workbench/project/core-publication/settings

PATCHoperatorSaves safe project-owned settings while provider secrets, billing authority, and execution control remain outside this route.
Billing controls update

/api/workbench/project/core-publication/billing

PATCHoperatorSaves safe project-owned billing focus, primary public billing surface, and operator notes without exposing merchant secrets or buyer records.
Telemetry watch update

/api/workbench/project/core-publication/events

PATCHoperatorSaves project telemetry focus, watch window, and operator note without exposing raw event rows or callback internals.
Edge routeMethodAccessDetail
Health check

/api/health

GETpublicRelease-proof and uptime route for validating the live worker without opening a protected operator screen.
Checkout create

/api/billing/checkout

POSTpublicStarts commerce from the public product surface while billing services keep provider credentials and validation server-side.
Checkout status

/api/billing/status/[sessionId]

GETpublicLets the member desk and recovery paths resolve billing state without forcing a heavyweight account system.
Paddle webhook

/api/webhooks/paddle

POSTcallbackReceives signed provider callbacks and turns them into billing proof inside the server boundary.

Provider boundaries

The UI feels more mature when contract ownership is obvious.

  • dataProvider: Builds project-scoped API URLs, pagination, and response normalization for Refine without owning security or business policy.
  • accessControlProvider: Controls preview and operator affordances in the browser, but it is not treated as the final permission layer.
  • Next.js route handlers: Remain the first enforcement boundary for auth, payload validation, and the public-versus-operator API split.
  • Services and stores: Own D1 access, fallback behavior, and real side effects so the workbench can widen without coupling the UI to persistence.

Live notes

The integration desk should stay tied to current runtime truth, not only theory.

  • Current compile posture: Automation currently resolves through the openai compile provider while the server keeps prompt and side-effect authority.
  • Current billing environment: Commerce edges are running against the live billing environment with checkout enabled.
  • Resource coverage: 12 project read contracts now exist across overview, execution, audience, usage, API, billing, events, settings, and guide lanes.
  • Guarded write coverage: 9 operator mutation routes are mapped explicitly so broader SaaS posture does not weaken server ownership.
  • Owner session posture: Protected ops and workbench writes now bind new sessions to a reserved owner email and require a fresher session window before sensitive mutations can proceed.
  • Operator audit trail: Guarded workbench actions now emit a project-scoped audit trail, but no recent entries have landed for this project yet.