Keystone Developers
Open Keystone
API reference

Console API

Website modifications

6 endpoints.

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

Read the business's draft website change, its preview and gates

The Website page's whole read, in one call (:func:`commands.state`).

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_WebsiteModStateResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteModStateResponse
WebsiteModStateResponse fields
FieldTypeDescription
website_idrequiredstring
pending_changeWebsiteModPendingChange | null
WebsiteModPendingChange fields
FieldTypeDescription
website_idrequiredstring
business_idrequiredstring
change_idrequiredstring
summaryrequiredstring
staterequiredstring
branchstring | null
pull_request_numberinteger | null
registered_atnumber | null
saved_atnumber | null
savesintegerdefault 0
publishWebsiteModPublish | null
WebsiteModPublish fields
FieldTypeDescription
change_idrequiredstring
summarystringdefault ""
statusrequiredenumone of "publishing", "published", "failed"
merge_shastring | null
pull_request_numberinteger | null
started_atnumber | null
settled_atnumber | null
conclusionstring | null
actions_urlstring | null
failure_messagestring | null
merge_conflictWebsiteModMergeConflict | null
WebsiteModMergeConflict fields
FieldTypeDescription
summaryrequiredstring
changestringdefault ""
rebuild_requeststringdefault ""
declinedbooleandefault false
preview_urlstring | null
preview_head_shastring | null
preview_frame_shastring | null
livebooleandefault false
session_enabledbooleandefault false
scaffoldedboolean | null
homeboolean | null
workingbooleandefault false
working_run_idstring | null
publishablebooleandefault 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
publish_buildWebsiteModPublishBuild | null
WebsiteModPublishBuild fields
FieldTypeDescription
statusrequiredenumone of "building", "failed"
outputstring | null
atnumber | null
versionsWebsiteModVersion[]default []
WebsiteModVersion[] fields

WebsiteModVersion (not expanded)

undone_versionsWebsiteModVersion[]default []
WebsiteModVersion[] fields

WebsiteModVersion (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
allintegerdefault 0
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.

GET/api/v1/admin/businesses/{business_id}/website-mod/revision

Where the business's website change stands, to tell when to read it again

A token that moves whenever the change does (``website_mod_events``): one database read for the website and one Redis read, no GitHub and no session pool, unlike the whole read.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_WebsiteModRevision_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteModRevision
WebsiteModRevision fields
FieldTypeDescription
revisionrequiredstring
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-mod/session

Read the website's live-preview session

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_WebsiteModSessionResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteModSessionResponse
WebsiteModSessionResponse fields
FieldTypeDescription
website_idrequiredstring
enabledrequiredboolean
statusstring | null
repostring | null
base_shastring | null
preview_urlstring | null
timings_sobjectdefault {}
object fields

Map of string to number

slotstring | null
expires_atnumber | null
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-mod/session/heartbeat

Keep the website's live-preview session leased while the page is open

The console calls this every minute or so while the Website page is open. A slot whose lease nobody extends lapses (the pool's LEASE_TTL) and the pod goes back to the warm floor — so tabs are viewers, and closing the last one is what frees the slot, never a client-side beforeunload. A website holding no lease gets the plain "enabled, nothing serving" response (pre-warm is what claims).

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_WebsiteModSessionResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteModSessionResponse
WebsiteModSessionResponse fields

WebsiteModSessionResponse, 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-mod/session/prewarm

Pre-warm the website's live-preview session

Called by the console when the Website page opens, so the pod has cloned, installed and booted ``next dev`` before the chat's first edit. Idempotent: a pod already serving this site at the right commit is left alone, and one whose tree holds work sor has not committed (a turn of the chat at work) is never re-claimed.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_WebsiteModSessionResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteModSessionResponse
WebsiteModSessionResponse fields

WebsiteModSessionResponse, 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-mod/sketch

Read the first sketch of a new site's home page

The sketch the chat wrote of a new site's home page (``website_sketch``); null when none.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_Union_WebsiteSketch__NoneType__
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredWebsiteSketch | null
WebsiteSketch fields
FieldTypeDescription
htmlrequiredstring
updated_atrequiredstring
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.