For AI agents: markdown of this page — /docs-content-en/entities/documents/list.md documentation index — /llms.txt

List documents

GET /v1/documents

Returns a list of documents with support for filtering, sorting, field selection, and automatic pagination.

Parameters

Parameter Type Default Description
Parameterlimit Typenumber Default50 DescriptionNumber of records (up to 5000). When limit > 50, Vibecode automatically requests several pages
Parameteroffset Typenumber Default0 DescriptionSkip N records. When offset ≥ 2500, limit ≤ 500 is recommended
Parameterselect Typestring Default— DescriptionSelects fields from GET /v1/documents/fields: ?select=id,title,number
Parametersort Typestring Default— DescriptionShorthand sorting: ?sort=-id. A minus sign indicates descending order. If the field is not in GET /v1/documents/fields, the request returns 400 UNKNOWN_SORT_FIELD
Parameterorder Typeobject Default— DescriptionSorting: ?order[id]=desc. Gives the same order as sort
Parameterfilter Typeobject Default— DescriptionFiltering by the fields from GET /v1/documents/fields.
Filtering syntax. Example: ?filter[templateId]=53, the template ID comes from GET /v1/doc-templates

Examples

curl — personal key

Terminal
curl -g "https://vibecode.bitrix24.com/v1/documents?limit=10&order[id]=desc&filter[templateId]=53" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -g "https://vibecode.bitrix24.com/v1/documents?limit=10&order[id]=desc&filter[templateId]=53" \
  -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/documents?limit=10&order[id]=desc&filter[templateId]=53', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/documents?limit=10&order[id]=desc&filter[templateId]=53', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionArray of documents (all item fields — see Document fields)
Fieldmeta.total Typenumber DescriptionNumber of records matching the filter
Fieldmeta.hasMore Typeboolean DescriptionWhether there are more records beyond limit

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 51,
      "title": "Supply contract 2026-001",
      "number": "2026-001",
      "templateId": 53,
      "provider": "Bitrix\\DocumentGenerator\\DataProvider\\Rest",
      "value": "ORDER-1024",
      "fileId": 241,
      "pdfId": 245,
      "imageId": 243,
      "createTime": "2026-03-18T17:27:48+00:00",
      "updateTime": "2026-03-18T17:27:48+00:00",
      "createdBy": 503,
      "updatedBy": null,
      "values": { "DocumentNumber": "2026-001" },
      "stampsEnabled": false,
      "downloadUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getfile&id=51",
      "pdfUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getpdf&id=51",
      "imageUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getimage&id=51"
    },
    {
      "id": 52,
      "title": "Supply contract 2026-002",
      "number": "2026-002",
      "templateId": 53,
      "provider": "Bitrix\\DocumentGenerator\\DataProvider\\Rest",
      "value": "ORDER-1025",
      "fileId": 248,
      "pdfId": 250,
      "imageId": 249,
      "createTime": "2026-03-19T10:12:03+00:00",
      "updateTime": "2026-03-19T10:12:03+00:00",
      "createdBy": 503,
      "updatedBy": null,
      "values": { "DocumentNumber": "2026-002" },
      "stampsEnabled": false,
      "downloadUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getfile&id=52",
      "pdfUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getpdf&id=52",
      "imageUrl": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=documentgenerator.api.document.getimage&id=52"
    }
  ],
  "meta": { "total": 2, "hasMore": false }
}

Error response example

400 — filter on a nonexistent field:

JSON
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Unknown filter field 'zzzNope' for entity 'documents'. Available: id, title, number, templateId, providerClassName, value, values, fields, createTime, updateTime, fileId, pdfId, imageId, stampsEnabled, provider, downloadUrl, pdfUrl, imageUrl, downloadUrlMachine, pdfUrlMachine, imageUrlMachine, createdBy, updatedBy, publicUrl"
  }
}

Errors

HTTP Code Description
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionFilter on a field the document does not have. Field list — GET /v1/documents/fields
HTTP403 CodeSCOPE_DENIED DescriptionThe key is missing the documentgenerator scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided
HTTP429 CodeRATE_LIMITED DescriptionRate 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

For the full list of common API errors, see Errors.

Known specifics

The publicUrl field is returned only by GET /v1/documents/:id and is not present in the list.

When limit > 50, Vibecode requests several pages and gathers all records into a single response. A single call returns at most 5000 records.

When offset ≥ 2500, use limit ≤ 500 for request stability.

For complex filters with many conditions, parameters are passed in the request body — POST /v1/documents/search. That endpoint also supports date windowing for large result sets. See Search documents.

See also