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
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication. |
Site protection
| Field | Type | Description |
|---|---|---|
| protectionType | string | public, password, or workspace. See Protection. |
| pagesPassword | string | The 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
| Field | Type | Description |
|---|---|---|
| name | string | Site name. |
| displayName | string | Display name shown on the site, when different from name. |
| description | string | Site description (max 500 chars). |
| logoUrl | string | Logo image URL. |
| iconUrl | string | Site icon (favicon) URL. |
| ogImageUrl | string | Default social preview image URL. |
| logoDisplayPreference | string | next-to-name, instead-of-name, or hide. |
| language | string | Site language tag, like en. |
| docsEnabled | boolean | Whether the /docs/ section exists. |
| previewEnabled | boolean | Whether the draft preview site is enabled. |
Theme and layout
| Field | Type | Description |
|---|---|---|
| theme | string | Theme name. |
| primaryColor | string | Hex color in the form #RRGGBB, like #336699. |
| primaryColorDark | string | Hex color in the form #RRGGBB, used while the site is shown in dark mode. Blank uses primaryColor in both modes. |
| fontSize | string | compact, comfortable, or large. |
| contentWidth | string | narrow, medium, wide, or full. |
| sidebarPosition | string | left, right, top, or none. |
| sidebarContent | string | Which lists the sidebar shows: all, pages-only, or tags-only. |
| stickyHeader | boolean | Pin the header while scrolling. |
| stickySidebar | boolean | Pin the sidebar while scrolling. |
| codeTheme | string | auto, light, or dark. |
| codeThemeLight | string | Syntax highlighting style for light mode, such as github or catppuccin-latte. The Theme page in the dashboard lists every style by name. |
| codeThemeDark | string | Syntax highlighting style for dark mode, such as dracula or nord. The Theme page in the dashboard lists every style by name. |
| darkModeDefault | string | system, light, or dark. |
| darkModeStyle | string | lights-out, soft, or blue. |
| showDarkToggle | boolean | Dark mode toggle button. |
| headingFont | string | system-sans or serif. |
| bodyFont | string | system-sans or serif. |
| headingBorders | string | none or bottom. |
| textAlign | string | left or justify. |
| antialiasText | boolean | Antialiased text rendering. |
| preventOrphans | boolean | Keeps 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.
| Field | Description |
|---|---|
| showTags | Tag chips on pages and listings. |
| showDates | Publish dates. |
| showAuthor | Author byline. |
| showReadingTime | Reading time estimate. |
| showToc | Table of contents. |
| showBreadcrumbs | Breadcrumbs. |
| showNextPrev | Next/previous page navigation. |
| showSearch | Search bar. |
| showFooter | Site footer. |
| showSocialShare | Social share buttons. |
| showComments | Comments. |
| showNewsletterCta | Newsletter signup CTA. Pro plan only. |
| showCopyMarkdownDocs | Copy-as-Markdown button on docs pages. |
| showCopyMarkdownBlog | Copy-as-Markdown button on blog posts. |
| showCopyMarkdownStandalone | Copy-as-Markdown button on standalone pages. |
| preserveAspectRatio | Keep gallery images at their own aspect ratio instead of cropping to squares. |
| fullWidthGallery | Gallery grid spans the full screen width. |
| masonryGallery | Masonry gallery grid, packed with no gaps. |
| showGalleryDownload | Gallery “Download all” button, which serves the gallery as a ZIP. |
| galleryDownloadPosition | Where the “Download all” button appears: top (under the page title, the default) or footer. |
| showGalleryItemDownload | Download buttons on individual gallery photos and videos, in the grid and the lightbox. |
Navigation, sidebar, and footer
| Field | Type | Description |
|---|---|---|
| navLinks | array | Up to 10 {label, url} links in the top navigation. |
| navCtaLabel | string | Call-to-action button label, up to 50 characters. |
| navCtaUrl | string | Call-to-action button URL. |
| sidebarSectionsDisplay | string | nested or flat. |
| sidebarItemsPerPage | number | Any number from 1 to 100. |
| sidebarShowMore | boolean | Show a “show more” control when a sidebar group has more entries than sidebarItemsPerPage. |
| sidebarShowViewAll | boolean | Show a “view all” link to the section index at the end of a sidebar group. |
| sidebarItems | array | Sidebar 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. |
| footerSections | array | Up to 5 sections: {title, type: "links", links: [{label, url}]} or {title, type: "markdown", content}. |
| footerLabel | string | The 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" }
}