
# Set section metadata

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

```sh
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](/api/sections/patch-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:

| URL | Names |
|-----|-------|
| `/sections/docs` | The `docs` nav group itself |
| `/sections/docs/setup` | The `setup` section inside `docs` |
| `/sections/standalone/api/builds` | The 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](/api/pages/get-pages-path) use for a page's section. A path deeper than a section can be is a 400 saying so.

## Usage

```bash
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

| Header | Type | Required | Description |
|--------|------|----------|-------------|
| Authorization | string | Yes | Bearer token (`Authorization: Bearer sp_...`). Created in the dashboard under Account > Tokens. See [authentication](/api/authentication). |



## Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| title | string | No | Display 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. |
| description | string | No | Landing/sidebar description (max 200 chars). |
| position | integer | No | Nav 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.

```json
{
  "contentType": "docs",
  "slug": "setup",
  "title": "Setup & Install",
  "description": "Getting started",
  "position": null,
  "pageCount": 4
}
```

| Field | Type | Description |
|-------|------|-------------|
| contentType | string | The content type the section sits under. |
| slug | string | The section's path under that type. |
| title | string | Display title, empty when the section has none. |
| description | string | Description, empty when the section has none. |
| position | number | Nav order, `null` on a section that is not a nav group, as here, where `docs/setup` sits inside the `docs` group. |
| pageCount | number | How 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.