
## List pages

`GET /v1/pages`

Returns a list of landing and online-store pages with support for filtering and auto-pagination. By default only non-deleted pages are returned.

The `domainId` (`DOMAIN_ID`) field is not requested by default. An explicit selection of this field is forwarded to Bitrix24 and can return `422 BITRIX_ERROR` with the Bitrix24 code `SYSTEM_ERROR`.

## Parameters

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `limit` | number | `50` | Number of records (up to 5000) |
| `offset` | number | `0` | Skip N records |
| `sort` | string | — | Sorting as a string: `?sort=-id` or `?sort=-siteId,id`. A minus before the field name sorts descending; without it, ascending. An unknown field name returns `422 BITRIX_ERROR` |
| `order` | object \| string | — | The same sorting in map form: `?order[id]=desc`. If `sort` is also passed, `sort` takes precedence. A direction other than `asc`, `desc`, `ASC`, or `DESC` returns `400 INVALID_SORT_DIRECTION`. The bracketless form `?order=desc` works only together with `sort`: fields that `sort` orders ascending switch to descending |
| `select` | string | — | Field selection: `?select=id,title,code,siteId,active`. Without `select`, page fields other than `domainId` are requested, in camelCase (as in the get-by-ID response) |
| `filter` | object | — | Filtering by the page's key fields.<br>[Filtering syntax](/docs/filtering). Example: `?filter[siteId]=3`. The boolean `active` is accepted as `true`/`false`, `1`/`0`, or `Y`/`N` |
| `withTotal` | string | — | Accepted but does not affect the response: `meta.total` is returned for any value and any `offset` |
| `scope` | string | — | Internal landing area. Allowed values: `KNOWLEDGE` (knowledge base pages), `GROUP` (workgroup pages), `MAINPAGE` (main pages). Without the parameter, pages of regular landing sites are returned. Accepted as `?scope=KNOWLEDGE` or `?filter[scope]=KNOWLEDGE` — both forms produce the same request to Bitrix24 |

## Examples

### curl — personal key

```bash
curl -g "https://vibecode.bitrix24.com/v1/pages?filter[siteId]=3&limit=10&select=id,title,code,siteId,active,dateCreate,dateModify" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -g "https://vibecode.bitrix24.com/v1/pages?filter[siteId]=3&limit=10&select=id,title,code,siteId,active,dateCreate,dateModify" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const params = new URLSearchParams({
  'filter[siteId]': '3',
  limit: '10',
  select: 'id,title,code,siteId,active,dateCreate,dateModify',
})

const res = await fetch(`https://vibecode.bitrix24.com/v1/pages?${params}`, {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} pages`)
```

### JavaScript — OAuth application

```javascript
const params = new URLSearchParams({
  'filter[siteId]': '3',
  limit: '10',
  select: 'id,title,code,siteId,active,dateCreate,dateModify',
})

const res = await fetch(`https://vibecode.bitrix24.com/v1/pages?${params}`, {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of pages |
| `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 | Arbitrary description |
| `data[].createdById` | number | Identifier of the employee who created it |
| `data[].dateCreate` | datetime | Creation date. A string in the account locale format, not ISO 8601 |
| `data[].dateModify` | datetime | Last modification date. Same format |
| `meta.total` | number | Total number of records matching the filter |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |

> **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 get-by-ID response; do not rely on `new Date()` to parse such a value. Details: [Field reference](/docs/entities/pages/fields).

The URL of any page from the `data` array is built from its `id` and `siteId`:

```
https://<portal>.bitrix24.com/sites/site/<siteId>/view/<id>/
```

`<siteId>` — ID of the site the page belongs to (the `siteId` field of each item). `<portal>` — the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 9,
      "title": "Page migration test",
      "code": "change1",
      "siteId": 3,
      "active": true,
      "description": null,
      "createdById": 1,
      "dateCreate": "26.05.2020 17:24:02",
      "dateModify": "10.10.2022 15:25:30"
    },
    {
      "id": 7,
      "title": "Test page",
      "code": "test",
      "siteId": 3,
      "active": true,
      "description": null,
      "createdById": 1,
      "dateCreate": "25.05.2020 17:34:17",
      "dateModify": "10.10.2022 15:25:30"
    }
  ],
  "meta": {
    "total": 13,
    "hasMore": true
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'landing' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_SORT_DIRECTION` | The direction in `order` is not `asc`, `desc`, `ASC`, or `DESC` |
| 422 | `BITRIX_ERROR` | Bitrix24 returned an error — see `error.message` |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal, shared by all API keys of the portal. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

**Pagination via `offset` is supported.** Vibecode returns the requested `[offset, offset + limit)` window. The `meta.total` value is the exact number of records matching the filter, and `meta.hasMore` shows whether there are records beyond the window.

**Default order is by site.** Without `sort` or `order`, pages are returned in ascending `siteId` order, and within a site in ascending `id` order. To order pages by `id` across all sites, use `sort=id`.

**Knowledge base and other internal areas.** The `scope` parameter switches the source: `KNOWLEDGE` — knowledge base pages, `GROUP` — workgroup pages, `MAINPAGE` — main pages. Without the parameter, pages of regular landing sites are returned (the default source). Example: `GET /v1/pages?scope=KNOWLEDGE` returns knowledge base pages.

## See also

- [Get a page](/docs/entities/pages/get)
- [Search pages](/docs/entities/pages/search)
- [Create a page](/docs/entities/pages/create)
- [Update a page](/docs/entities/pages/update)
- [Delete a page](/docs/entities/pages/delete)
- [Sites](/docs/entities/sites)
- [Filtering syntax](/docs/filtering)
- [Entity API](/docs/entity-api)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
