Get a List of CRM Items: crm.item.list
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Scope:
crmWho can execute the method: any user with "read" access permission for CRM object elements.
This method retrieves a list of items of a specific type from the CRM object.
CRM object items will not be included in the final selection if the user does not have "read" access permission for those items.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
entityTypeId* |
Identifier of the system or custom type whose items need to be retrieved. Numerical values for system types (Lead — 1, Deal — 2, Contact — 3, Company — 4, Invoice — 31, etc.) are listed in the CRM object types reference. The identifier of the smart process can be obtained using the crm.type.list method. |
|
select |
List of fields that should be populated in the items of the selection. Can contain only field names or A list of all available fields for selection can be obtained using the |
|
filter |
Object format:
where
The filter can have unlimited nesting and number of conditions. You can add a prefix to the
A list of all available fields for filtering can be obtained using the |
|
order |
Object format:
where
A list of all available fields for sorting can be obtained using the |
|
start |
This parameter is used to manage pagination. The result page size is always static — 50 records. To select the second page of results, pass the value The formula for calculating the
|
|
useOriginalUfNames |
Parameter to control the format of custom field names in the request and response.
Default is |
Code Examples
Retrieve a list of leads where:
- First name or last name is not empty.
- They are in the status "In Progress" or "Unprocessed".
- They came from sources "Advertising" or "Website".
- They are assigned to managers with IDs 1 or 6.
- They have a deal amount between 5000 and 20000.
- The calculation mode for the amount is manual.
Set the following sorting order for this selection:
- First name and last name in ascending order.
For clarity, we will select only the fields we need:
- Identifier
id - Title
title - First name
name - Last name
lastName - Stage ID
stageId - Source ID
sourceId - Responsible ID
assignedById - Amount
opportunity - Manual calculation mode
isManualOpportunity
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":1,"select":["id","title","lastName","name","stageId","sourceId","assignedById","opportunity","isManualOpportunity"],"filter":{"0":{"logic":"OR","0":{"!=name":""},"1":{"!=lastName":""}},"@stageId":["NEW","IN_PROCESS"],"@sourceId":["WEB","ADVERTISING"],"@assignedById":[1,6],">=opportunity":5000,"<=opportunity":20000,"isManualOpportunity":"Y"},"order":{"lastName":"ASC","name":"ASC"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.item.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":1,"select":["id","title","lastName","name","stageId","sourceId","assignedById","opportunity","isManualOpportunity"],"filter":{"0":{"logic":"OR","0":{"!=name":""},"1":{"!=lastName":""}},"@stageId":["NEW","IN_PROCESS"],"@sourceId":["WEB","ADVERTISING"],"@assignedById":[1,6],">=opportunity":5000,"<=opportunity":20000,"isManualOpportunity":"Y"},"order":{"lastName":"ASC","name":"ASC"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.item.list
// callListMethod: Retrieves all data at once. Use only for small selections (< 1000 items) due to high memory load.
try {
const response = await $b24.callListMethod(
'crm.item.list',
{
entityTypeId: 1,
select: [
"id",
"title",
"lastName",
"name",
"stageId",
"sourceId",
"assignedById",
"opportunity",
"isManualOpportunity",
],
filter: {
"0": {
logic: "OR",
"0": {
"!=name": "",
},
"1": {
"!=lastName": "",
},
},
"@stageId": ["NEW", "IN_PROCESS"],
"@sourceId": ['WEB', "ADVERTISING"],
"@assignedById": [1, 6],
">=opportunity": 5000,
"<=opportunity": 20000,
"isManualOpportunity": "Y",
},
order: {
lastName: 'ASC',
name: 'ASC',
},
},
(progress) => { console.log('Progress:', progress) }
);
const items = response.getData() || [];
for (const entity of items) { console.log('Entity:', entity); }
} catch (error) {
console.error('Request failed', error);
}
// fetchListMethod: Retrieves data in parts using an iterator. Use for large volumes of data for efficient memory consumption.
try {
const generator = $b24.fetchListMethod('crm.item.list', {
entityTypeId: 1,
select: [
"id",
"title",
"lastName",
"name",
"stageId",
"sourceId",
"assignedById",
"opportunity",
"isManualOpportunity",
],
filter: {
"0": {
logic: "OR",
"0": {
"!=name": "",
},
"1": {
"!=lastName": "",
},
},
"@stageId": ["NEW", "IN_PROCESS"],
"@sourceId": ['WEB', "ADVERTISING"],
"@assignedById": [1, 6],
">=opportunity": 5000,
"<=opportunity": 20000,
"isManualOpportunity": "Y",
},
order: {
lastName: 'ASC',
name: 'ASC',
},
}, 'ID');
for await (const page of generator) {
for (const entity of page) { console.log('Entity:', entity); }
}
} catch (error) {
console.error('Request failed', error);
}
// callMethod: Manual control of pagination through the start parameter. Use for precise control over request batches. Less efficient for large data than fetchListMethod.
try {
const response = await $b24.callMethod('crm.item.list', {
entityTypeId: 1,
select: [
"id",
"title",
"lastName",
"name",
"stageId",
"sourceId",
"assignedById",
"opportunity",
"isManualOpportunity",
],
filter: {
"0": {
logic: "OR",
"0": {
"!=name": "",
},
"1": {
"!=lastName": "",
},
},
"@stageId": ["NEW", "IN_PROCESS"],
"@sourceId": ['WEB', "ADVERTISING"],
"@assignedById": [1, 6],
">=opportunity": 5000,
"<=opportunity": 20000,
"isManualOpportunity": "Y",
},
order: {
lastName: 'ASC',
name: 'ASC',
},
}, 0);
const result = response.getData().result || [];
for (const entity of result) { console.log('Entity:', entity); }
} catch (error) {
console.error('Request failed', error);
}
try {
$entityTypeId = 1; // Replace with actual entity type ID
$order = []; // Replace with actual order array
$filter = []; // Replace with actual filter array
$select = []; // Replace with actual select array
$startItem = 0; // Optional, can be adjusted as needed
$itemsResult = $serviceBuilder
->getCRMScope()
->item()
->list($entityTypeId, $order, $filter, $select, $startItem);
foreach ($itemsResult->getItems() as $item) {
print("ID: " . $item->id . PHP_EOL);
print("XML ID: " . $item->xmlId . PHP_EOL);
print("Title: " . $item->title . PHP_EOL);
print("Created By: " . $item->createdBy . PHP_EOL);
print("Updated By: " . $item->updatedBy . PHP_EOL);
print("Created Time: " . $item->createdTime->format(DATE_ATOM) . PHP_EOL);
print("Updated Time: " . $item->updatedTime->format(DATE_ATOM) . PHP_EOL);
// Add more fields as necessary
}
} catch (Throwable $e) {
print("Error: " . $e->getMessage() . PHP_EOL);
}
BX24.callMethod(
'crm.item.list',
{
entityTypeId: 1,
select: [
"id",
"title",
"lastName",
"name",
"stageId",
"sourceId",
"assignedById",
"opportunity",
"isManualOpportunity",
],
filter: {
"0": {
logic: "OR",
"0": {
"!=name": "",
},
"1": {
"!=lastName": "",
},
},
"@stageId": ["NEW", "IN_PROCESS"],
"@sourceId": ['WEB', "ADVERTISING"],
"@assignedById": [1, 6],
">=opportunity": 5000,
"<=opportunity": 20000,
"isManualOpportunity": "Y",
},
order: {
lastName: 'ASC',
name: 'ASC',
},
},
(result) => {
if (result.error())
{
console.error(result.error());
return;
}
console.info(result.data());
},
);
require_once('crest.php');
$result = CRest::call(
'crm.item.list',
[
'entityTypeId' => 1,
'select' => [
"id",
"title",
"lastName",
"name",
"stageId",
"sourceId",
"assignedById",
"opportunity",
"isManualOpportunity",
],
'filter' => [
"0" => [
"logic" => "OR",
"0" => [
"!=name" => "",
],
"1" => [
"!=lastName" => "",
],
],
"@stageId" => ["NEW", "IN_PROCESS"],
"@sourceId" => ['WEB', "ADVERTISING"],
"@assignedById" => [1, 6],
">=opportunity" => 5000,
"<=opportunity" => 20000,
"isManualOpportunity" => "Y",
],
'order' => [
'lastName' => 'ASC',
'name' => 'ASC',
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Example Request with Date Filter Using OR Logic
Filter deals entityTypeId = 2 by two creation dates. For each date, set the start and end of the day range.
For clarity, we will select only the fields we need:
- Identifier
id - Title
title - Creation date
createdTime
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":2,"select":["id","title","createdTime"],"filter":{"0":{"logic":"OR","0":{">=createdTime":"2025-10-31T00:00:00+02:00","<createdTime":"2025-11-01T00:00:00+02:00"},"1":{">=createdTime":"2025-02-28T00:00:00+02:00","<createdTime":"2025-03-01T00:00:00+02:00"}}}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.item.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":2,"select":["id","title","createdTime"],"filter":{"0":{"logic":"OR","0":{">=createdTime":"2025-10-31T00:00:00+02:00","<createdTime":"2025-11-01T00:00:00+02:00"},"1":{">=createdTime":"2025-02-28T00:00:00+02:00","<createdTime":"2025-03-01T00:00:00+02:00"}}},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.item.list
try {
const response = await $b24.callMethod(
'crm.item.list',
{
entityTypeId: 2,
select: ['id', 'title', 'createdTime'],
filter: {
'0': {
logic: 'OR',
'0': {
'>=createdTime': '2025-10-31T00:00:00+02:00',
'<createdTime': '2025-11-01T00:00:00+02:00',
},
'1': {
'>=createdTime': '2025-02-28T00:00:00+02:00',
'<createdTime': '2025-03-01T00:00:00+02:00',
},
},
},
},
);
const items = response.getData().items || [];
items.forEach((item) => {
console.info(`Deal #${item.id}: ${item.title} (${item.createdTime})`);
});
} catch (error) {
console.error('crm.item.list error', error);
}
try {
$entityTypeId = 2;
$order = [];
$filter = [
"0" => [
"logic" => "OR",
"0" => [
">=createdTime" => "2025-10-31T00:00:00+02:00",
"<createdTime" => "2025-11-01T00:00:00+02:00",
],
"1" => [
">=createdTime" => "2025-02-28T00:00:00+02:00",
"<createdTime" => "2025-03-01T00:00:00+02:00",
],
],
];
$select = ['id', 'title', 'createdTime'];
$startItem = 0;
$itemsResult = $serviceBuilder
->getCRMScope()
->item()
->list($entityTypeId, $order, $filter, $select, $startItem);
foreach ($itemsResult->getItems() as $item) {
print("ID: " . $item->id . PHP_EOL);
print("Title: " . $item->title . PHP_EOL);
print("Created Time: " . $item->createdTime->format(DATE_ATOM) . PHP_EOL);
print(PHP_EOL);
}
} catch (Throwable $e) {
print("Error: " . $e->getMessage() . PHP_EOL);
}
BX24.callMethod(
'crm.item.list',
{
entityTypeId: 2,
select: ['id', 'title', 'createdTime'],
filter: {
'0': {
logic: 'OR',
'0': {
'>=createdTime': '2025-10-31T00:00:00+02:00',
'<createdTime': '2025-11-01T00:00:00+02:00',
},
'1': {
'>=createdTime': '2025-02-28T00:00:00+02:00',
'<createdTime': '2025-03-01T00:00:00+02:00',
},
},
},
},
function (result) {
if (result.error()) {
console.error('crm.item.list error', result.error());
return;
}
const { items } = result.data();
items.forEach((item) => {
console.log(`Deal #${item.id}: ${item.title} (${item.createdTime})`);
});
if (result.more()) {
result.next();
}
}
);
require_once('crest.php');
$result = CRest::call(
'crm.item.list',
[
'entityTypeId' => 2,
'select' => ['id', 'title', 'createdTime'],
'filter' => [
"0" => [
"logic" => "OR",
"0" => [
">=createdTime" => "2025-10-31T00:00:00+02:00",
"<createdTime" => "2025-11-01T00:00:00+02:00",
],
"1" => [
">=createdTime" => "2025-02-28T00:00:00+02:00",
"<createdTime" => "2025-03-01T00:00:00+02:00",
],
],
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"items": [
{
"id": 253,
"assignedById": 6,
"stageId": "NEW",
"opportunity": 19000,
"sourceId": "WEB",
"title": "Lead #253",
"name": "Admin",
"lastName": null,
"isManualOpportunity": "Y"
},
{
"id": 255,
"assignedById": 1,
"stageId": "NEW",
"opportunity": 19600,
"sourceId": "WEB",
"title": "Lead #255",
"name": "John",
"lastName": "Doe",
"isManualOpportunity": "Y"
},
{
"id": 252,
"assignedById": 1,
"stageId": "NEW",
"opportunity": 12000,
"sourceId": "ADVERTISING",
"title": "Lead #252",
"name": "John",
"lastName": "Smith",
"isManualOpportunity": "Y"
},
{
"id": 254,
"assignedById": 6,
"stageId": "IN_PROCESS",
"opportunity": 19000,
"sourceId": "ADVERTISING",
"title": "Lead #254",
"name": "Cat",
"lastName": "Smith",
"isManualOpportunity": "Y"
}
]
},
"total": 4,
"time": {
"start": 1721724354.214286,
"finish": 1721724354.805263,
"duration": 0.5909769535064697,
"processing": 0.24513697624206543,
"date_start": "2024-07-23T10:45:54+02:00",
"date_finish": "2024-07-23T10:45:54+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response. Contains a single key |
|
items |
Array with information about the found items. Returned fields depend on the |
|
total |
Total number of found items. |
|
next |
Contains the value to be passed in the next request in the The |
|
time |
Information about the request execution time. |
By default, custom field names are passed and returned in camelCase, e.g., ufCrm2_1639669411830.
When passing the useOriginalUfNames parameter with the value Y, custom fields will be returned with their original names, e.g., UF_CRM_2_1639669411830.
Error Handling
HTTP Status: 400, 403
{
"error": "INVALID_ARG_VALUE",
"error_description": "Invalid filter: field 'FIELD' is not allowed in filter"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
|
Action allowed only for intranet users |
User is not an intranet user |
|
|
|
Smart process not found |
Occurs when an invalid |
|
|
|
Invalid filter: field ' |
The field |
|
|
|
Invalid filter: field ' |
The value passed for the field |
|
|
|
Invalid order: field ' |
The field |
|
|
|
Invalid order: allowed sort directions are |
The value |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the portal administrator has restricted access to this application to specific users only |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Create a New CRM Entity crm.item.add
- Update CRM Item
- Get Element by Id crm.item.get
- Delete CRM Item: crm.item.delete
- Retrieve Fields of CRM Item
- CRM Object Fields
- How to Attach a Task to a Smart Process
- How to Filter Items by Stage Name
- How to Retrieve a List of Tasks from Deals
- How to Retrieve a List of Vendors