Set section metadata

Set the display metadata for one section. This route writes metadata only and does not move or create pages.

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

Requires the content scope.

Fields you omit keep their stored values, so setting a title never clears a description or a position. To set the order of the nav groups, use PATCH /sites/{siteId}/sections.

Addressing a section

A section is named by its content type and its path under that type. {sectionPath} is that whole path, so the URL takes one, two, or three segments depending on what you are naming:

URLNames
/sections/docsThe docs nav group itself
/sections/docs/setupThe setup section inside docs
/sections/standalone/api/buildsThe nested standalone section api/builds

Only docs and blog have a group root to name. Only standalone sections nest, and only one level deep.

This is the same path the page routes use for a page’s section. A path deeper than a section can be is a 400 saying so.

Usage

curl -X PATCH "https://sitepaste.com/api/v1/public/sites/default/sections/docs/setup" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Setup & Install", "description": "Getting started" }'

Authorizations

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

Body

FieldTypeRequiredDescription
titlestringNoDisplay name (max 50 chars). Omitted fields keep their stored values. Sending the default title, the one shown for the slug when none is set, leaves title empty.
descriptionstringNoLanding/sidebar description (max 200 chars).
positionintegerNoNav order, 0 to 9999 (422 outside it); settable only on nav groups (group roots and root standalone sections).

Response

200 OK with the section as it now stands.

{
  "contentType": "docs",
  "slug": "setup",
  "title": "Setup & Install",
  "description": "Getting started",
  "position": null,
  "pageCount": 4
}
FieldTypeDescription
contentTypestringThe content type the section sits under.
slugstringThe section’s path under that type.
titlestringDisplay title, empty when the section has none.
descriptionstringDescription, empty when the section has none.
positionnumberNav order, null on a section that is not a nav group, as here, where docs/setup sits inside the docs group.
pageCountnumberHow many pages are in the section.

Clearing the title and description returns a section to its defaults. A position cannot be cleared, so a nav group keeps its position.

A site may hold metadata for at most 100 sections. When other sections already fill the cap, the request is a 409. The same request succeeds once another section’s metadata is cleared.