## Remove a system page

`DELETE /v1/sites/:id/system-pages/:type`

Frees one system role of the site. The page that was assigned to it stays on the site, and the other roles do not change.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Site ID. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `type` (path) | string | yes | Role to free: `mainpage`, `catalog`, `personal`, `cart`, `order`, `payment`, `compare`, `feedback`. Roles currently in use: [`GET /v1/sites/:id/system-pages`](/docs/entities/sites/system-pages-list) |
| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` / `GROUP` / `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned. Omit it for an ordinary site |

No request body is needed: a body with any field returns `400 INVALID_PARAMS`.

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/223/system-pages/cart" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/223/system-pages/cart" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/223/system-pages/cart', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Roles left:', data.length)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/223/system-pages/cart', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

The method returns `200` with the site's remaining bindings.

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data` | array | The site's bindings after the role is freed. Empty if the freed role was the last one |
| `data[].type` | string | Role: `mainpage`, `catalog`, `personal`, `cart`, `order`, `payment`, `compare`, `feedback`. What each one means — [System pages](/docs/entities/sites/system-pages) |
| `data[].pageId` | number | ID of the page assigned to the role. Get the page: [`GET /v1/pages/:id`](/docs/entities/pages/get) |
| `data[].title` | string | Page title |
| `data[].deleted` | boolean | The page is in the trash |
| `data[].active` | boolean | The page is published |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "type": "personal",
      "pageId": 2373,
      "title": "Docs test personal",
      "deleted": false,
      "active": false
    }
  ]
}
```

## Error response example

404 — the role is already free:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "System-page binding not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | `System-page binding not found` — no page is assigned to the `type` role. Removing the same role again returns the same response |
| 404 | `ENTITY_NOT_FOUND` | `Entity not found or not visible` — a site with this ID was not found, is not accessible to the user or belongs to another scope |
| 400 | `INVALID_PARAMS` | `Unknown system-page type` — `type` is not in the list of roles |
| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |
| 400 | `INVALID_PARAMS` | `Unsupported body field` — the body contains a field the method does not accept |
| 400 | `INVALID_PARAMS` | `Body must be a JSON object` — the body is not a JSON object, for example an array was sent |
| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was sent |
| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |
| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |
| 422 | `BITRIX_ERROR` | `Bitrix24 did not save the binding change; site settings permission may be missing` — the role is still taken after the write. Check whether the user has permission to change site settings |
| 422 | `BITRIX_ERROR` | `Bitrix24 did not confirm the binding change` — Bitrix24 did not confirm the write |
| 422 | `BITRIX_ERROR` | `Bitrix24 returned invalid system pages` — Bitrix24 returned the list of bindings in an unexpected shape |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. The request is refused before any call to the Bitrix24 account |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [System pages](/docs/entities/sites/system-pages)
- [List site system pages](/docs/entities/sites/system-pages-list)
- [Assign a system page](/docs/entities/sites/system-pages-set)
- [Remove all site system pages](/docs/entities/sites/system-pages-delete)
