Update a site

Update one site’s settings, protection included. Only the fields you send are changed; the rest are left alone.

PATCH https://sitepaste.com/api/v1/public/sites/{siteId}

Requires the settings scope.

siteId also accepts the literal default, which resolves to the workspace’s default site, so PATCH /sites/default updates it without a lookup first.

Usage

curl -X PATCH "https://sitepaste.com/api/v1/public/sites/s7k2m0dq1p3z" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Renamed Site" }'

Authorizations

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

Site protection

FieldTypeDescription
protectionTypestringpublic, password, or workspace. See Protection.
pagesPasswordstringThe site password for password protection. Empty string clears it, which is only allowed when the site is not left in password protection.

A site in password protection always holds a password. Switching to password requires one: send pagesPassword in the same request, unless one is already stored from before. Clearing the password while the site stays in password protection is refused with 422 and fields.pagesPassword; send protectionType alongside to leave it. Switching away keeps the stored password, so you can switch back without resending it.

General

FieldTypeDescription
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 color in the form #RRGGBB, like #336699.
primaryColorDarkstringHex color in the form #RRGGBB, used while the site is shown in dark mode. Blank uses primaryColor in both modes.
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.
codeThemeLightstringSyntax highlighting style for light mode, such as github or catppuccin-latte. The Theme page in the dashboard lists every style by name.
codeThemeDarkstringSyntax highlighting style for dark mode, such as dracula or nord. The Theme page in the dashboard lists every style by name.
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.
preventOrphansbooleanKeeps a short last word of a paragraph, heading, list item, or card on the same line as the word before it. On by default.

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, which serves the gallery as a ZIP.
galleryDownloadPositionWhere the “Download all” button appears: top (under the page title, the default) or footer.
showGalleryItemDownloadDownload buttons on individual gallery photos and videos, in the grid and the lightbox.
FieldTypeDescription
navLinksarrayUp to 10 {label, url} links in the top navigation.
navCtaLabelstringCall-to-action button label, up to 50 characters.
navCtaUrlstringCall-to-action button URL.
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}.
footerLabelstringThe line printed at the foot of every page, up to 200 characters. Blank restores the built-in copyright line. Shown only while showFooter is true.

The CTA button renders only when both navCtaLabel and navCtaUrl are stored. Sending both with either one blank clears both, with no error. Sending one on its own writes that one field alone, so a label with no stored URL is accepted and stored but shows nothing until the URL arrives; to remove the button, send both as empty strings.

Plan requirements

Site protection (protectionType other than public), pagesPassword, and showNewsletterCta: true require the Pro plan, and theme changes require a paid plan. Since API tokens require Pro, these are normally already satisfied.

Response

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

400 when {siteId} is malformed, and 404 when it is well formed but names no site in your workspace.

Field validation errors return 422, with the offending fields named:

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