
## Update section

`PATCH /v1/product-sections/:id`

Updates an existing product catalog section. Only the fields being changed are passed in the body. Fields are passed flat at the root of the JSON, without a `fields` wrapper.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Section identifier |

## Request fields (body)

| Field | Bitrix24 | Type | Required | Description |
|------|----------|-----|:-----:|---------|
| `name` | `NAME` | string | no | Section name |
| `catalogId` | `CATALOG_ID` | number | no | Catalog identifier. List: `GET /v1/catalogs` |
| `sectionId` | `SECTION_ID` | number | no | Parent section identifier for nesting. `null` for a top-level section |
| `code` | `CODE` | string | no | Section symbolic code |
| `xmlId` | `XML_ID` | string | no | External identifier |
| `sort` | `SORT` | number | no | Sort index |
| `id` | `ID` | number | RO | Section identifier. Filled in by the system |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/product-sections/197" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Outerwear"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/product-sections/197" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Outerwear"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/197', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Outerwear',
  }),
})

const { success, data } = await res.json()
console.log('Updated name:', data.name)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/197', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Outerwear',
  }),
})

const { success, data } = await res.json()
```

## Response fields

The full section object after the update is returned.

| Field | Type | Description |
|------|-----|---------|
| `id` | number | Section identifier |
| `name` | string | Section name |
| `catalogId` | number | Catalog identifier |
| `sectionId` | number | Parent section identifier or `null` |
| `xmlId` | string | External identifier or `null` |
| `code` | string | Section symbolic code |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 197,
    "name": "Outerwear",
    "catalogId": 25,
    "sectionId": null,
    "xmlId": null,
    "code": "outerwear"
  }
}
```

## Error response example

404 — section not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Product section is not found."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | A section with the specified `id` does not exist |
| 400 | `READONLY_FIELD` | A read-only field was passed in the body — `id` |
| 403 | `SCOPE_DENIED` | Key is missing the `crm` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not provided |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Get section](/docs/entities/product-sections/get)
- [Create section](/docs/entities/product-sections/create)
- [Delete section](/docs/entities/product-sections/delete)
- [Catalogs](/docs/entities/catalogs)
- [Batch](/docs/batch)
