[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ffiles\u002Fsearch":3,"docs-tabs-entities\u002Ffiles\u002Fsearch":6},{"content":4,"lastmod":5},"## File search\n\n`POST \u002Fv1\u002Ffiles\u002Fsearch`\n\nReturns folder contents — the same as [`GET \u002Fv1\u002Ffiles`](.\u002Flist.md), except that the conditions are passed in the request body rather than in the query string. The folder ID goes in `filter.folderId` or in a top-level `folderId` field of the body.\n\nFor full-text search across all accessible files in Bitrix24 Drive, use [POST \u002Fv1\u002Ffiles\u002Ffulltext-search](\u002Fdocs\u002Fentities\u002Ffiles\u002Ffulltext-search), which accepts a query instead of filters for a single folder.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `filter` | object | no | Selection conditions. `folderId` — the ID of the folder whose contents are returned. Required here or at the top level of the body.\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `{\"folderId\":27,\"type\":\"file\"}` |\n| `folderId` | number | no | The folder ID at the top level of the body — instead of `filter.folderId`. If both are passed, this value is used. A single value only: arrays, objects and `null` are rejected |\n| `select` | array | no | List of returned fields. Example: `[\"id\",\"name\"]` |\n| `order` | object | no | Sort by field. Example: `{\"name\":\"asc\"}` |\n| `limit` | number | no | How many records to return. Default 50, maximum 5000 |\n| `offset` | number | no | Offset for pagination |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"filter\":{\"folderId\":27,\"type\":\"file\"},\"limit\":10}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"filter\":{\"folderId\":27,\"type\":\"file\"},\"limit\":10}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ filter: { folderId: 27, type: 'file' }, limit: 10 }),\n})\n\nconst { success, data, meta } = await res.json()\nconsole.log('Found:', data.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ filter: { folderId: 27, type: 'file' }, limit: 10 }),\n})\n\nconst { success, data, meta } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Array of records — subfolders and files. All fields — see [File fields](.\u002Ffields.md) |\n| `data[].type` | string | Record type: `\"folder\"` or `\"file\"` |\n| `meta.total` | number | Number of records matching the filter |\n| `meta.hasMore` | boolean | Whether more records exist beyond `limit` |\n| `meta.durationMs` | number | Request duration in milliseconds |\n\nThe `meta` fields sit next to `data`, not inside it. Paginate using `meta.hasMore`: a `data` length equal to `limit` does not rule out the last page.\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 205,\n      \"name\": \"presentation_q1.pdf\",\n      \"code\": null,\n      \"storageId\": 1,\n      \"type\": \"file\",\n      \"folderId\": 27,\n      \"size\": 31232,\n      \"fileId\": 363,\n      \"globalContentVersion\": 1,\n      \"downloadUrl\": \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F205\u002Fdownload\",\n      \"deletedType\": 0,\n      \"createdBy\": 5,\n      \"updatedBy\": 5,\n      \"deletedBy\": null,\n      \"createdAt\": \"2023-03-15T09:29:09.000Z\",\n      \"updatedAt\": \"2023-03-15T09:29:09.000Z\",\n      \"deletedAt\": null,\n      \"detailUrl\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fdocs\u002Fpath\u002Fto\u002Ffile\u002F\"\n    }\n  ],\n  \"meta\": { \"total\": 1, \"hasMore\": false, \"durationMs\": 206 }\n}\n```\n\n## Error response example\n\n403 — no `disk` scope:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SCOPE_DENIED\",\n    \"message\": \"This endpoint requires 'disk' scope\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_PARAMS` | The folder ID is passed in neither `filter.folderId` nor `folderId`. Arrays, objects and `null` are treated as missing. The same code is returned when one of the fields is an empty string, even if the other one carries an ID. `message` lists the missing fields |\n| 400 | `INVALID_FILTER_OPERATOR` | One of `folderId` and `filter.folderId` holds a single ID, and the other holds an array, an object or `null`. The request is rejected before Bitrix24 Drive is called |\n| 403 | `SCOPE_DENIED` | The API key does not have the `disk` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured portal tokens |\n| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |\n\nFor the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\nSearch is limited to a single folder specified in `folderId` and does not span the whole storage. The same result is returned by [`GET \u002Fv1\u002Ffiles`](.\u002Flist.md) with parameters in the query string.\n\nThe response contains both folders (`type: \"folder\"`) and files (`type: \"file\"`) — distinguish them by the `type` field. Folders have a `realObjectId` field; files do not. The `contentProvider` field is not returned for files on Bitrix24 Drive.\n\n## See also\n\n- [List folder files](\u002Fdocs\u002Fentities\u002Ffiles\u002Flist)\n- [File fields](\u002Fdocs\u002Fentities\u002Ffiles\u002Ffields)\n- [Files](\u002Fdocs\u002Fentities\u002Ffiles)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n","2026-10-23",{},1794739377471]