Console API
Website preview
13 endpoints.
/api/v1/admin/businesses/{business_id}/website-previewGet the business's website preview, chat, and draft URL
Preview + revisions[] (the chat) + the draft URL.
Every revision carries its OWN ``preview_url`` (the Worker version uploaded for its checkpoint sha), and the top-level ``preview_url`` is the current revision's — a new build means a NEW URL, so the console no longer has to cache-bust a reused host, and past revisions stay viewable (History). Both are None until the version lands, a minute or two after the revision goes ready.
``live`` is the edit-pool slot serving this preview (live edits), which the console frames instead while it is set; ``session_enabled`` whether this preview's edits run live at all.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_WebsitePreviewGetResponse_| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
success | true | default true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
datarequired | WebsitePreviewGetResponse | WebsitePreviewGetResponse fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
metadata | ResponseMetadata | null | ResponseMetadata fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
meta | ResponseMeta | null | ResponseMeta fields
|
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/businesses/{business_id}/website-previewCreate (or start over) the business's website preview
202: rows are committed and revision 0's generation is spawned; poll GET.
Also the "start over" path — an existing (unconfirmed, not in-flight) preview is replaced with a fresh one on the same repo/worker, and the onboarding website stage the replaced draft's failure left ``failed`` runs again with the new one (``reopen_onboarding``: an owner's start-over, which auto-onboarding's own re-entry is not).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
authorization | header | string | null |
Request body
application/jsonWebsitePreviewCreateBody | null| Field | Type | Description |
|---|---|---|
user_prompt | string | null |
Responses
202Successful Responseapplication/jsonSuccessResponse_WebsitePreviewCreateResponse_| Field | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||
success | true | default true | ||||||
datarequired | WebsitePreviewCreateResponse | WebsitePreviewCreateResponse fields
| ||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | ||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/businesses/{business_id}/website-preview/progress-streamStream the live preview edit's activity (SSE)
The preview's live run as SSE, in website-mod's frame shape: its events after ``after_seq``, ``reset`` when the run changes, ``done`` when it ends. The console opens it when an edit is sent.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
after_seq | query | integer | default 0 |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonany400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/businesses/{business_id}/website-preview/runsThe preview's past revisions, each with its activity trail
What the agent did for each past chat turn, and for the full build once it has run, so the account of the work survives a page reload and outlives the stream (which only ever narrates the one live run).
Joined to the chat by ``revision``; the prompts, replies and timings come from the preview read, which the console already has. ``build`` is the launch's own account, filed under the confirm.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_WebsitePreviewRunsResponse_| Field | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||||||||||||||||||||
success | true | default true | ||||||||||||||||||||||||
datarequired | WebsitePreviewRunsResponse | WebsitePreviewRunsResponse fields
| ||||||||||||||||||||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | ||||||||||||||||||||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/businesses/{business_id}/website-preview/session/heartbeatKeep the preview's live edit session leased while the chat is open
Every 60 s while the preview chat is open: a lease nobody extends lapses and the slot returns to the warm floor. ``live: null`` when the preview holds no lease (pre-warm is what claims). 404 when edits do not run live.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_WebsitePreviewSessionResponse_| Field | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | ||||||||||
success | true | default true | |||||||||
datarequired | WebsitePreviewSessionResponse | WebsitePreviewSessionResponse fields
| |||||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | |||||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/businesses/{business_id}/website-preview/session/prewarmPre-warm the preview's live edit session
Called once when the preview chat opens, so the slot has cloned, installed and booted the draft before the first edit. Idempotent: a slot already serving the current draft is left alone, and a run in flight keeps what it serves. Nothing to warm (no ready draft yet, or the chat is closed) answers ``live: null``. 404 when the preview's edits do not run live.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_WebsitePreviewSessionResponse_| Field | Type | Description |
|---|---|---|
request_idrequired | string | |
success | true | default true |
datarequired | WebsitePreviewSessionResponse | WebsitePreviewSessionResponse fieldsWebsitePreviewSessionResponse, expanded above. |
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. |
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/check/overrideLet a draft its browser check holds back be finished (Keystone staff)
Keystone staff only: the reason and what the check had found are kept in ``website_check_overrides``. 409 when nothing is held back.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Request bodyrequired
application/jsonBrowserCheckOverrideBody| Field | Type | Description |
|---|---|---|
reasonrequired | string | min length 10 · max length 1000 |
Responses
200Successful Responseapplication/jsonSuccessResponse_BrowserCheckView_| Field | Type | Description |
|---|---|---|
request_idrequired | string | |
success | true | default true |
datarequired | BrowserCheckView | BrowserCheckView fieldsBrowserCheckView, expanded above. |
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. |
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/check/recheckLook at the draft's pages in a browser again
202: the edit slot looks again, without the site agent, at the pages a check that never reached the browser was to look at. The read shows ``rechecking`` until the new check lands. 409 while a revision generates, without live edits, or for a check a look cannot settle.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
202Successful Responseapplication/jsonSuccessResponse_BrowserCheckView_| Field | Type | Description |
|---|---|---|
request_idrequired | string | |
success | true | default true |
datarequired | BrowserCheckView | BrowserCheckView fieldsBrowserCheckView, expanded above. |
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. |
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/confirmConfirm the website preview and start the full build
202: preview → confirmed, draft PR closed (never merged), seeded full build fired after commit. Only a ready preview confirms (409 otherwise).
The body is optional and additive: ``{"text": ...}`` persists the customer's confirming chat message on the preview as ``confirm_text`` (it IS the confirmation, in the prototype's conversational shape); no body keeps the original behaviour exactly.
With ``website_preview_engine_enabled``, a confirm while a revision is generating answers 202 with ``queued: true`` instead of 409: it runs when that revision settles ``ready``/``no_change``.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Request body
application/jsonWebsitePreviewConfirmBody | null| Field | Type | Description |
|---|---|---|
text | string | null |
Responses
202Successful Responseapplication/jsonSuccessResponse_WebsitePreviewConfirmResponse_| Field | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | ||||||||||
success | true | default true | |||||||||
datarequired | WebsitePreviewConfirmResponse | WebsitePreviewConfirmResponse fields
| |||||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | |||||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/editsSend a chat edit to the website preview
202 with revision n+1 spawned; 409 while any revision is generating.
The message's INTENT is decided server-side first (see ``website_preview.intent``): a message that reads as approval ("looks good, ship it", "finish my website") runs the SAME confirm flow the dedicated /confirm route runs — the service function is reused, never duplicated — and answers with ``intent: "confirm"`` and no revision. Any other message runs the edit flow exactly as before, with ``intent: "edit"``. The /confirm route itself is untouched (the console chip may still call it directly).
A confirm-labelled message the preview cannot confirm (409: not ready, nothing built yet) FALLS THROUGH to the edit flow instead of erroring: the label was the classifier's guess, and dropping the customer's words on the floor because the guess outran the preview's state was a real lost-message bug. The dedicated /confirm route keeps its honest 409 — there the caller SAID confirm.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Request bodyrequired
application/jsonWebsitePreviewEditBody| Field | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
textrequired | string | null | ||||||||||
model_id | string | null | ||||||||||
attachments | WebsiteAgentAttachmentRef[] | max items 10WebsiteAgentAttachmentRef[] fields
| |||||||||
client_message_id | string | null | ||||||||||
delivery | enum | null |
Responses
202Successful Responseapplication/jsonSuccessResponse_WebsitePreviewEditResponse_| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
success | true | default true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
datarequired | WebsitePreviewEditResponse | WebsitePreviewEditResponse fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/queue/{item_id}Take back a queued draft edit before it goes
Idempotent: a request no longer queued answers ``removed: false``.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
item_idrequired | path | string | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_EditorQueueRemoveResponse_| Field | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||
success | true | default true | ||||||
datarequired | EditorQueueRemoveResponse | EditorQueueRemoveResponse fields
| ||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | ||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/stopStop the draft edit being made, keeping what the site agent has done
The owner's Stop: the site agent's turn ends at its next step, and what it changed so far settles as the revision (nothing changed: no change). 409 when no edit is being made on a session pod (the job cannot be stopped) or the pod cannot be reached; an edit still on its way to its pod is stopped once it gets there. ``revision`` names the edit the Stop is for: a late Stop, once that edit settled, never stops the queued one.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Request body
application/jsonWebsitePreviewStopBody | null| Field | Type | Description |
|---|---|---|
revision | integer | null |
Responses
202Successful Responseapplication/jsonSuccessResponse_WebsiteEditorStopResponse_| Field | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
request_idrequired | string | |||||||
success | true | default true | ||||||
datarequired | WebsiteEditorStopResponse | WebsiteEditorStopResponse fields
| ||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | ||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.
/api/v1/admin/website-previews/{preview_id}/undoTake back the draft's newest edit
The owner's Undo: the draft goes back to the edit before the current one (the first draft at the earliest), and the next edit builds on it. 409 while an edit is being made or a finish is queued, and with nothing to undo.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
preview_idrequired | path | string (uuid) | |
authorization | header | string | null |
Responses
200Successful Responseapplication/jsonSuccessResponse_WebsitePreviewUndoResponse_| Field | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
request_idrequired | string | ||||||||||
success | true | default true | |||||||||
datarequired | WebsitePreviewUndoResponse | WebsitePreviewUndoResponse fields
| |||||||||
metadata | ResponseMetadata | null | ResponseMetadata fieldsResponseMetadata, expanded above. | |||||||||
meta | ResponseMeta | null | ResponseMeta fieldsResponseMeta, expanded above. |
400Bad request401Unauthorized403Forbidden404Not found422Validation error500Internal server error503Service unavailable
Error bodies: ErrorResponse. See Errors.