Appearance
Publish site content
Prerequisites: the matching site/content permissions and apiRequest. Settings writes accept one of site.write, billing.write, or settings.write; page editing/publishing has its own permissions in the reference.
Draft and publish settings
Read the current section before replacing its draft. saveSiteSettingsDraft stores an object without publishing it; publishSiteSettingsSection publishes it and returns the new version.
ts
await apiRequest("/v1/admin/site/settings/branding", {
method: "PUT", body: JSON.stringify({ draft: brandingDraft }),
});
const published = await apiRequest("/v1/admin/site/settings/branding/publish", {
method: "POST", body: JSON.stringify({ note: "Reviewed branding update" }),
});
console.log(published.version);brandingDraft is the complete deployment-specific section object read/edited by your application. The current section schema is permissive; it does not prove arbitrary keys will affect the UI. Inspect existing settings and consumers rather than inventing a new section format.
Create and publish a page version
ts
const page = await apiRequest("/v1/admin/site/pages", {
method: "PUT", body: JSON.stringify({ slug: "getting-started", title: "Getting started", kind: "page" }),
});
const version = await apiRequest(`/v1/admin/site/pages/${page.id}/versions`, {
method: "POST", body: JSON.stringify({ markdown: "# Getting started\n\nWelcome." }),
});
await apiRequest(`/v1/admin/site/pages/${page.id}/publish`, {
method: "POST", body: JSON.stringify({ version: Number(version.version) }),
});The sequence is upsertSitePage, saveSitePageVersion, then publishSitePageVersion. Creating metadata or saving a version alone does not publish it.
Visibility and rollback
Navigation/content blocks choose landing or portal; announcements also have surfaces, audience and start/end times. Use the appropriate status transition instead of assuming a saved draft is public. getPublicSite returns only the anonymous published subset, including resolved feature flags rather than private rollout/audience rules. Its surface filter narrows blocks/navigation.
Inspect listSiteSettingsVersions and use rollbackSiteSettingsSection with a known version when recovering settings. Page publishing can select an earlier stored version. A 204 means no body; permission failures need the operation-specific key, and invalid section/slug/version values return validation errors. Keep legal reacceptance behavior explicit when changing legal content.