Paginated CRM export through Bitrix24 REST: start, next and completeness checks
How to retrieve the entire CRM list, go beyond the first batch and detect omissions caused by data changes during export.
Define the selection boundaries
Before the first request, define the object type, filter, fields and order. For example, you need deals in the selected pipeline rather than every record accessible to the user. These parameters form the export specification and are saved with the result.
Changing the filter or sort order between pages means that the returned sets no longer belong to the same selection. For reproducibility, record the start time, integration user and settings version.
It is useful to document the data exchange scope and data owners in a working document: Bitrix24 integration specification: data, errors and responsibility. If you need to examine a specific portal scenario, see the service Bitrix24 support and development.
Before iterating through pages, check CRM filter logic: the wrong condition group will produce a complete but unsuitable set of records.
Continue using next from the response
In crm.item.list, the result contains items, and next specifies the start value for the next request. According to the documentation, a batch is limited to 50 items. The absence of next marks the end of this result set; there is no need to invent the next pointer.
Process the entire page, save its result and only then continue. When retrying after a network error, do not add the same IDs to the output twice. Store the attempt number separately from the object count.
Guard against changes to the list
While the integration reads pages, employees may add or modify CRM data. Ordinary pagination alone does not promise an immutable snapshot. For critical reconciliation, agree on a time window or retrieve an additional set of changes after the main pass.
A fixed sort order helps explain ordering, but does not replace completeness checks. Retain the minimum and maximum IDs, the number of unique records and the processing time boundaries.
Distinguish an error from an empty page
Empty items after a successful request and an API failure have different meanings. In the first case, check the filter and CRM scope accessible to the user; in the second, retain the error code and do not mark the page as processed.
A checkpoint must retain the last confirmed result. If the process stops between writing the data and advancing the pointer, repeating the page must safely eliminate duplicates by ID.
- 01Parameters
Record the original state.
- 02Pages
Perform the selected operation.
- 03Reconciliation
Confirm the saved result.
Reconcile the final set
Check the number of unique IDs, confirm that pages have not been saved twice, and spot-read several objects by their identifiers. Comparing with total is useful, but discrepancies during live changes need investigation rather than automatic correction.
Acceptance-test the export against the agreed scope: type, pipeline, period, permissions and time. Do not call it the company’s complete database if the integration user sees only part of the CRM.
Verification table
| Control | Data | Expected result |
|---|---|---|
| ControlFirst batch | DataParameters, items and next | Expected resultThe set matches the filter |
| ControlNext batch | Datastart from the preceding next | Expected resultIDs are not written twice |
| ControlCompletion | DataUnique IDs and scope | Expected resultOmissions and limitations are explained |
Acceptance checklist
- Parameters remain unchanged between pages
- The pointer comes from the response
- The checkpoint is recorded after the data
- Repeating a page does not duplicate objects
- Export permissions and time are recorded
Frequently asked questions
Why were only 50 deals retrieved?
You have probably read only the first batch. Check next in the successful response and use it as start to continue.
Can total be treated as an absolute guarantee?
No. It is a useful check figure, but the live database and user permissions affect comparability.
What should be done after a connection loss?
Resume from the last confirmed checkpoint and remove duplicates by their identifiers in your own export.
Need help automating the process?
We will review the original workflow, roles, data and exceptions. We will prepare a diagram, verifiable requirements and a safe Bitrix24 implementation plan.
Select service