
## Update a page

`PATCH /v1/pages/:id`

Updates the fields of an existing page. Pass only the fields you want to change, flat at the root of the JSON — without a `fields` wrapper. Fields that are not passed keep their current values.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Page identifier. List: [`GET /v1/pages`](/docs/entities/pages/list) |

## Fields to update (body)

| Field | Type | Description |
|------|-----|---------|
| `title` | string | Page title, up to 255 characters |
| `code` | string | Symbolic code of the page. Must not contain `/`. If the code is already taken on the site, a numeric suffix is added |
| `description` | string | Arbitrary description |
| `siteId` | number | Owner site ID. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `public` | string | Public flag (`Y`/`N`) |
| `sitemap` | string | Include in the sitemap (`Y`/`N`) |
| `xmlId` | string | External code |
| `folderId` | number | ID of the site's section folder |
| `tplId` | number | Template ID |

**The `active` field is not accepted in the body.** A request carrying it is rejected as a whole — the response is `400 READONLY_FIELD`, and the remaining body fields are not applied. Publishing and unpublishing are separate calls: `POST /v1/pages/:id/publication` and `POST /v1/pages/:id/unpublish`.

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/pages/2295" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Spring sale — updated",
    "description": "Discounts up to 50%"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/pages/2295" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Spring sale — updated",
    "description": "Discounts up to 50%"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/pages/2295', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Spring sale — updated',
    description: 'Discounts up to 50%',
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/pages/2295', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Spring sale — updated',
    description: 'Discounts up to 50%',
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The page after the update |
| `data.id` | number | Page identifier |
| `data.title` | string | Page title |
| `data.code` | string | Symbolic code of the page |
| `data.siteId` | number | Site identifier |
| `data.active` | boolean | Whether the page is active |
| `data.description` | string \| null | Page description |
| `data.createdById` | number | Identifier of the employee who created the page. List: [`GET /v1/users`](/docs/entities/users/list) |
| `data.dateCreate` | datetime | Creation date. A string in the account locale format, not ISO 8601 |
| `data.dateModify` | datetime | Last modification date, after the update |

The main fields are shown. Full list: [Field reference](/docs/entities/pages/fields).
> **Date format.** `dateCreate` and `dateModify` are strings in the account locale format, **not** ISO 8601 (`30.12.2021 12:30:52` in the RU locale, `12/30/2021 12:30:52 pm` in the EN locale). The format is the same in the list and in the card. Do not rely on `new Date()` to parse such a value. Details: [Field reference](/docs/entities/pages/fields).


## Response example

```json
{
  "success": true,
  "data": {
    "id": 2295,
    "title": "Spring sale — updated",
    "code": "spring-sale",
    "siteId": 3,
    "active": false,
    "description": "Discounts up to 50%",
    "createdById": 1,
    "dateCreate": "08.05.2026 11:49:33",
    "dateModify": "08.05.2026 12:14:08"
  }
}
```

## Error response example

422 — a slash in `code`:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Slash is forbidden in the landing address."
  }
}
```

## Errors

| HTTP | `error.code` | Marker in `error.message` | Description |
|------|--------------|--------------------------|---------|
| 400 | `READONLY_FIELD` | — | A read-only field was passed in the body — for example `active`. The body is not applied at all |
| 401 | `TOKEN_MISSING` | — | The API key has no configured tokens |
| 403 | `BITRIX_ACCESS_DENIED` | — | The user does not have permission to change this page |
| 403 | `SCOPE_DENIED` | — | The API key does not have the `landing` scope |
| 404 | `ENTITY_NOT_FOUND` | — | A page with this `id` was not found or has been deleted |
| 422 | `BITRIX_ERROR` | `Slash is forbidden in the landing address` | A `/` character was passed in `code` |
| 422 | `BITRIX_ERROR` | `Page address cannot be empty` | An empty string was passed in `code` |
| 422 | `BITRIX_ERROR` | `Invalid page address` | A value in the `__` format was passed in `code` |

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

## See also

- [Get a page](/docs/entities/pages/get)
- [List pages](/docs/entities/pages/list)
- [Create a page](/docs/entities/pages/create)
- [Delete a page](/docs/entities/pages/delete)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
