Keystone Developers
Open Keystone
API reference

Console API

Website preview

13 endpoints.

GET/api/v1/admin/businesses/{business_id}/website-preview

Get 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

NameInTypeDescription
business_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_WebsitePreviewGetResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewGetResponse
WebsitePreviewGetResponse fields
FieldTypeDescription
previewrequiredWebsitePreviewData
WebsitePreviewData fields
FieldTypeDescription
idrequiredstring (uuid)
business_idrequiredstring (uuid)
website_idrequiredstring (uuid)
statusrequiredstring
current_revisionrequiredinteger
repo_full_namestring | null
confirm_textstring | null
confirm_sender_namestring | null
pending_confirm_textstring | null
pending_confirm_sender_namestring | null
pending_confirm_atstring (date-time) | null
queued_requestsEditorQueuedRequest[]default []
EditorQueuedRequest[] fields

Nested object (not expanded)

expires_atrequiredstring (date-time)
created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
revisionsrequiredWebsitePreviewRevisionData[]
WebsitePreviewRevisionData[] fields

WebsitePreviewRevisionData (not expanded)

preview_urlstring | null
liveWebsitePreviewLive | null
WebsitePreviewLive fields
FieldTypeDescription
preview_urlstring | null
frame_shastring | null
statusstring | null
session_enabledbooleandefault false
capabilitiesEditorCapabilities
EditorCapabilities fields
FieldTypeDescription
model_pickerbooleandefault false
default_model_idstring | null
attachmentsEditorAttachmentsCapability
EditorAttachmentsCapability fields

EditorAttachmentsCapability (not expanded)

stopbooleandefault false
undobooleandefault false
steeringbooleandefault false
browser_checkbooleandefault false
billingbooleandefault false
queuebooleandefault false
browser_checkBrowserCheckView | null
BrowserCheckView fields
FieldTypeDescription
idrequiredstring
statusrequiredstring
blockedrequiredboolean
problemsstring[]
string[] fields

Nested object (not expanded)

pagesBrowserCheckPage[]
BrowserCheckPage[] fields

Nested object (not expanded)

checked_atstring (date-time) | null
overriddenbooleandefault false
override_reasonstring | null
can_recheckbooleandefault false
recheckingbooleandefault false
queueEditorQueueState | null
EditorQueueState fields
FieldTypeDescription
statusenumone of "waiting", "sending", "held", "blocked", "idle" · default "waiting"
reasonstring | null
messagestring | null
batchEditorQueueBatch | null
EditorQueueBatch fields

EditorQueueBatch (not expanded)

deliveredEditorQueueDelivered | null
EditorQueueDelivered fields

EditorQueueDelivered (not expanded)

metadataResponseMetadata | null
ResponseMetadata fields
FieldTypeDescription
paginationPaginationMetadata | null
PaginationMetadata fields
FieldTypeDescription
limitrequiredinteger
next_cursorstring | null
prev_cursorstring | null
has_morerequiredboolean
has_prevbooleandefault false
total_countinteger | null
status_countsobject | null
object | null fields

Map of string to integer

lifecycle_countsLifecycleCounts | null
LifecycleCounts fields
FieldTypeDescription
leadintegerdefault 0
prospectintegerdefault 0
customerintegerdefault 0
former_customerintegerdefault 0
classification_countsClassificationCounts | null
ClassificationCounts fields
FieldTypeDescription
signalobject
object fields

Nested object (not expanded)

touchobject
object fields

Nested object (not expanded)

stageobject
object fields

Nested object (not expanded)

metaResponseMeta | null
ResponseMeta fields
FieldTypeDescription
totalinteger | null
total_countinteger | null
pageinteger | null
per_pageinteger | null
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/website-preview

Create (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

NameInTypeDescription
business_idrequiredpathstring (uuid)
authorizationheaderstring | null

Request body

application/jsonWebsitePreviewCreateBody | null
FieldTypeDescription
user_promptstring | null

Responses

202Successful Response
application/jsonSuccessResponse_WebsitePreviewCreateResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewCreateResponse
WebsitePreviewCreateResponse fields
FieldTypeDescription
previewrequiredWebsitePreviewData
WebsitePreviewData fields

WebsitePreviewData, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/admin/businesses/{business_id}/website-preview/progress-stream

Stream 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

NameInTypeDescription
business_idrequiredpathstring (uuid)
after_seqqueryintegerdefault 0
authorizationheaderstring | null

Responses

200Successful Response
application/jsonany
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/admin/businesses/{business_id}/website-preview/runs

The 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

NameInTypeDescription
business_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_WebsitePreviewRunsResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewRunsResponse
WebsitePreviewRunsResponse fields
FieldTypeDescription
preview_idrequiredstring (uuid)
runsWebsitePreviewRun[]default []
WebsitePreviewRun[] fields

WebsitePreviewRun (not expanded)

buildWebsitePreviewBuildRun | null
WebsitePreviewBuildRun fields
FieldTypeDescription
run_idrequiredstring
eventsWebsiteModProgressEvent[]default []
WebsiteModProgressEvent[] fields

Nested object (not expanded)

event_countintegerdefault 0
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/website-preview/session/heartbeat

Keep 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

NameInTypeDescription
business_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_WebsitePreviewSessionResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewSessionResponse
WebsitePreviewSessionResponse fields
FieldTypeDescription
session_enabledbooleandefault false
liveWebsitePreviewLive | null
WebsitePreviewLive fields

WebsitePreviewLive, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/website-preview/session/prewarm

Pre-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

NameInTypeDescription
business_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_WebsitePreviewSessionResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewSessionResponse
WebsitePreviewSessionResponse fields

WebsitePreviewSessionResponse, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/check/override

Let 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Request bodyrequired

application/jsonBrowserCheckOverrideBody
FieldTypeDescription
reasonrequiredstringmin length 10 · max length 1000

Responses

200Successful Response
application/jsonSuccessResponse_BrowserCheckView_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredBrowserCheckView
BrowserCheckView fields

BrowserCheckView, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/check/recheck

Look 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

202Successful Response
application/jsonSuccessResponse_BrowserCheckView_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredBrowserCheckView
BrowserCheckView fields

BrowserCheckView, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/confirm

Confirm 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Request body

application/jsonWebsitePreviewConfirmBody | null
FieldTypeDescription
textstring | null

Responses

202Successful Response
application/jsonSuccessResponse_WebsitePreviewConfirmResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewConfirmResponse
WebsitePreviewConfirmResponse fields
FieldTypeDescription
previewrequiredWebsitePreviewData
WebsitePreviewData fields

WebsitePreviewData, expanded above.

queuedbooleandefault false
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/edits

Send 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Request bodyrequired

application/jsonWebsitePreviewEditBody
FieldTypeDescription
textrequiredstring | null
model_idstring | null
attachmentsWebsiteAgentAttachmentRef[]max items 10
WebsiteAgentAttachmentRef[] fields
FieldTypeDescription
kindrequiredenumone of "photo", "document"
idrequiredstringmin length 1 · max length 64 · pattern ^[A-Za-z0-9-]+$
client_message_idstring | null
deliveryenum | null

Responses

202Successful Response
application/jsonSuccessResponse_WebsitePreviewEditResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewEditResponse
WebsitePreviewEditResponse fields
FieldTypeDescription
previewrequiredWebsitePreviewData
WebsitePreviewData fields

WebsitePreviewData, expanded above.

revisionWebsitePreviewRevisionData | null
WebsitePreviewRevisionData fields
FieldTypeDescription
idrequiredstring (uuid)
revisionrequiredinteger
triggerrequiredstring
prompt_textstring | null
sender_namestring | null
statusrequiredstring
checkpoint_shastring | null
run_idstring | null
agent_replystring | null
preview_urlstring | null
errorstring | null
created_atrequiredstring (date-time)
completed_atstring (date-time) | null
agent_model_idstring | null
attachmentsWebsiteAgentAttachmentView[] | null
WebsiteAgentAttachmentView[] | null fields

Nested object (not expanded)

notesWebsitePreviewNote[] | null
WebsitePreviewNote[] | null fields

Nested object (not expanded)

undone_atstring (date-time) | null
intentstringdefault "edit"
queuedbooleandefault false
steeredbooleandefault false
queued_request_idstring | null
note_refusedbooleandefault false
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

DELETE/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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
item_idrequiredpathstring
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_EditorQueueRemoveResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredEditorQueueRemoveResponse
EditorQueueRemoveResponse fields
FieldTypeDescription
removedrequiredboolean
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/stop

Stop 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Request body

application/jsonWebsitePreviewStopBody | null
FieldTypeDescription
revisioninteger | null

Responses

202Successful Response
application/jsonSuccessResponse_WebsiteEditorStopResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteEditorStopResponse
WebsiteEditorStopResponse fields
FieldTypeDescription
stoppingrequiredboolean
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/website-previews/{preview_id}/undo

Take 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

NameInTypeDescription
preview_idrequiredpathstring (uuid)
authorizationheaderstring | null

Responses

200Successful Response
application/jsonSuccessResponse_WebsitePreviewUndoResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsitePreviewUndoResponse
WebsitePreviewUndoResponse fields
FieldTypeDescription
previewrequiredWebsitePreviewData
WebsitePreviewData fields

WebsitePreviewData, expanded above.

undonerequiredWebsitePreviewRevisionData
WebsitePreviewRevisionData fields

WebsitePreviewRevisionData, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.