For AI agents: markdown of this page — /docs-content-en/entities/sites/search.md documentation index — /llms.txt
Search sites
POST /v1/sites/search
Searches for sites with filtering and auto-pagination. Equivalent to GET /v1/sites with filters, but via POST — more convenient for complex requests with many conditions.
Request fields (body)
| Parameter | Type | Default | Description |
|---|---|---|---|
Parameterfilter |
Typeobject | Default— | DescriptionFiltering by the fields from GET /v1/sites/fields.Filtering syntax |
Parameterlimit |
Typenumber | Default50 |
DescriptionNumber of records (up to 5000) |
Parameteroffset |
Typenumber | Default0 |
DescriptionSkip N records. Combined with a date-range filter longer than 14 days, the request is rejected — see UNSTABLE_OFFSET_PAGINATION in the "Errors" section |
Parameterselect |
Typestring[] | Default— | DescriptionField selection: ["id", "title", "type"] |
ParameterautoWindow |
Typeboolean | Defaulttrue |
DescriptionSplit the result set into weekly windows when filtering by a date range longer than 14 days. false disables splitting |
Parametersort |
Typestring | Defaultascending by id |
DescriptionSort field and direction: "-id" for descending, "id" for ascending. The parameter is also accepted under the name order |
Parameterscope |
Typestring | Default— | DescriptionInternal landing area: KNOWLEDGE / GROUP / MAINPAGE. Without the parameter, regular landing sites are returned. Accepted at the top level of the body ("scope": "KNOWLEDGE") or inside filter.scope — both forms produce the same request to Bitrix24 |
Type filter and area (
scope). Bitrix24 bindsfilter.typeto the current area — the default area exposes onlyPAGE/STORE/SMN/VIBE. If you filter by{"filter": {"type": "KNOWLEDGE"}}or"GROUP"and do not passscope, Vibecode supplies the matching area itself (type=KNOWLEDGE→scope=KNOWLEDGE), and the search returns exactly the knowledge bases / group pages. An explicitscopewins. If the type is specified using a list or operator ({"type": {"$in": ["KNOWLEDGE", "PAGE"]}}) and no single area can be determined,meta.warningsincludes a hint with the codeTYPE_REQUIRES_SCOPE.MAINPAGEis an area, not a site type (its sites have typeVIBE), so it is not derived from the filter.
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/sites/search" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": { "type": "PAGE", "active": true },
"limit": 10,
"select": ["id", "title", "type", "active"]
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/sites/search" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filter": { "type": "PAGE", "active": true },
"limit": 10,
"select": ["id", "title", "type", "active"]
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { type: 'PAGE', active: true },
limit: 10,
select: ['id', 'title', 'type', 'active'],
}),
})
const { success, data, meta } = await res.json()
console.log('Returned:', data.length)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { type: 'PAGE', active: true },
limit: 10,
select: ['id', 'title', 'type', 'active'],
}),
})
const { success, data, meta } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typearray | DescriptionArray of sites. All item fields — Site fields. With select, each item holds only the listed fields |
Fieldmeta.total |
Typenumber | DescriptionThe exact number of records matching the filter, when known. Omitted when the search across time windows is incomplete |
Fieldmeta.hasMore |
Typeboolean | DescriptionWhether there are more records beyond limit |
Fieldmeta.durationMs |
Typenumber | DescriptionRequest duration in milliseconds |
Fieldmeta.autoWindowed |
Typeboolean | Descriptiontrue if the result set was split into time windows |
Fieldmeta.windowCount |
Typenumber | DescriptionNumber of windows. Present with autoWindowed: true |
Fieldmeta.batchWaves |
Typenumber | DescriptionNumber of parallel request waves. Present with autoWindowed: true |
The meta fields sit next to data, not inside it. Use meta.hasMore to paginate: even when the length of data equals limit, this can be the last page.
Use a site's id from the data array in the following URL:
https://<portal>.bitrix24.com/sites/site/<id>/
<portal> is your Bitrix24 account domain. Access is restricted by the employee's permissions in Bitrix24.
Response example
{
"success": true,
"data": [
{
"id": 157,
"title": "Promo landing",
"code": "/promo/",
"type": "PAGE",
"active": true,
"domainId": 5,
"createdById": 1,
"dateCreate": "12.09.2024 10:23:14",
"dateModify": "04.11.2025 08:51:20"
}
],
"meta": {
"total": 10,
"hasMore": false,
"durationMs": 99
}
}
With a date-range filter longer than 14 days, meta also includes autoWindowed, windowCount, and batchWaves:
{
"success": true,
"data": [ /* ... */ ],
"meta": {
"total": 2,
"hasMore": false,
"autoWindowed": true,
"windowCount": 339,
"batchWaves": 4,
"durationMs": 3136
}
}
Error response example
403 — missing required scope:
{
"success": false,
"error": {
"code": "SCOPE_DENIED",
"message": "This endpoint requires 'landing' scope"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeUNSTABLE_OFFSET_PAGINATION |
Descriptionoffset greater than zero together with a date-range filter longer than 14 days. Two different retrieval algorithms produce inconsistent results, so the request is rejected. Fetch everything in a single request with limit up to 5000, or pass autoWindow: false with sorting by id, or split the date range into parts yourself |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the landing scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP409 | CodeLANDING_MODULE_NOT_ENABLED |
DescriptionThe Sites module is unavailable on this portal. Ask the portal administrator to enable it — requests will continue to return the same error until it is enabled |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRate limit exceeded: 300 requests per minute per portal. All API keys for the portal share this limit. The exact value is returned in the x-ratelimit-limit header. Retry after the delay specified in the Retry-After header |
For the full list of common API errors, see Errors.
Known specifics
Time-window splitting. A date-range filter longer than 14 days is automatically split into weekly windows executed in parallel waves, so the result set bypasses the ceiling of 5000 records per call. meta then includes autoWindowed: true, the number of windows windowCount, and the number of waves batchWaves. The autoWindow: false parameter disables splitting. While splitting is active, an offset greater than zero is rejected with UNSTABLE_OFFSET_PAGINATION.
Visibility by user permissions. The search returns only the sites the API key owner has "view" permission for. If a result is expected but data is empty, check the user's permissions.
Deleted sites. Excluded by default. To include them in the result, pass {"filter": {"deleted": "Y"}}. Values are Y or N.
Pagination via offset is supported. Vibecode returns the requested [offset, offset + limit) window. When present, meta.total is the exact number of records matching the filter. A search across time windows returns the count only after all windows have been read successfully and duplicates removed; the field is omitted when the search stops early at limit or a window returns an incomplete result. The API does not make additional requests solely to obtain a count. data.length is the number of returned records, and meta.hasMore shows whether there are records beyond the window.