Update site settings

Change a site’s settings. Every setting the dashboard’s site settings pages can change is settable here, under the same rules. All fields are optional; omitted fields keep their existing values.

PATCH https://sitepaste.com/api/v1/public/site

Settings take effect on the site’s next deploy, exactly as when changed in the dashboard.

Usage

curl -X PATCH https://sitepaste.com/api/v1/public/site \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"protectionType": "password", "pagesPassword": "share-with-team"}'

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Site protection

FieldTypeDescription
protectionTypestringpublic, password, or workspace. See Password protection.
pagesPasswordstringThe site password for password protection. Empty string clears it.

Switching to password requires a password: send pagesPassword in the same request, unless one is already stored from before. Switching away keeps the stored password, so you can switch back without resending it.

General

FieldTypeDescription
siteIdstringTarget site ID. Defaults to your default site. Also accepted as a ?siteId= query parameter, which takes precedence over the body field.
namestringSite name.
displayNamestringDisplay name shown on the site, when different from name.
descriptionstringSite description (max 500 chars).
logoUrlstringLogo image URL.
iconUrlstringSite icon (favicon) URL.
ogImageUrlstringDefault social preview image URL.
logoDisplayPreferencestringnext-to-name, instead-of-name, or hide.
languagestringSite language tag, like en.
docsEnabledbooleanWhether the /docs/ section exists.
previewEnabledbooleanWhether the draft preview site is enabled.

Theme and layout

FieldTypeDescription
themestringTheme name.
primaryColorstringHex (#336699) or named color.
fontSizestringcompact, comfortable, or large.
contentWidthstringnarrow, medium, wide, or full.
sidebarPositionstringleft, right, top, or none.
sidebarContentstringWhich lists the sidebar shows: all, pages-only, or tags-only.
stickyHeaderbooleanPin the header while scrolling.
stickySidebarbooleanPin the sidebar while scrolling.
codeThemestringauto, light, or dark.
codeThemeLightstringChroma style name for light mode.
codeThemeDarkstringChroma style name for dark mode.
darkModeDefaultstringsystem, light, or dark.
darkModeStylestringlights-out, soft, or blue.
showDarkTogglebooleanDark mode toggle button.
headingFontstringsystem-sans or serif.
bodyFontstringsystem-sans or serif.
headingBordersstringnone or bottom.
textAlignstringleft or justify.
antialiasTextbooleanAntialiased text rendering.

Feature toggles

Site-wide defaults; several have per-page overrides.

FieldDescription
showTagsTag chips on pages and listings.
showDatesPublish dates.
showAuthorAuthor byline.
showReadingTimeReading time estimate.
showTocTable of contents.
showBreadcrumbsBreadcrumbs.
showNextPrevNext/previous page navigation.
showSearchSearch bar.
showFooterSite footer.
showSocialShareSocial share buttons.
showCommentsComments.
showNewsletterCtaNewsletter signup CTA. Pro plan only.
showCopyMarkdownDocsCopy-as-Markdown button on docs pages.
showCopyMarkdownBlogCopy-as-Markdown button on blog posts.
showCopyMarkdownStandaloneCopy-as-Markdown button on standalone pages.
preserveAspectRatioKeep gallery images at their own aspect ratio instead of cropping to squares.
fullWidthGalleryGallery grid spans the full screen width.
masonryGalleryMasonry gallery grid, packed with no gaps.
showGalleryDownloadGallery “Download all” button.
FieldTypeDescription
navLinksarrayUp to 10 {label, url} links in the top navigation.
navCtaLabelstringCall-to-action button label. Required together with navCtaUrl.
navCtaUrlstringCall-to-action button URL. Required together with navCtaLabel.
sidebarSectionsDisplaystringnested or flat.
sidebarItemsPerPagenumberAny number from 1 to 100.
sidebarShowMorebooleanShow a “show more” control when a sidebar group has more entries than sidebarItemsPerPage.
sidebarShowViewAllbooleanShow a “view all” link to the section index at the end of a sidebar group.
sidebarItemsarraySidebar entries: {type: "section", contentType, key} or {type: "link", contentType, label, url}, where contentType is docs, blog, or a standalone section name. Max 100 total, 20 per group.
footerSectionsarrayUp to 5 sections: {title, type: "links", links: [{label, url}]} or {title, type: "markdown", content}.

Plan requirements

Site protection (protectionType other than public), pagesPassword, and showNewsletterCta: true require the Pro plan; theme changes require a paid plan. These are the same rules the dashboard enforces, and since API tokens themselves require Pro, they are normally already satisfied.

Response

200 OK with the updated settings document, in the same shape as get site settings.

Field validation errors return 400:

{
  "error": "validation failed",
  "fields": { "contentWidth": "contentWidth must be one of: narrow, medium, wide, full" }
}