Get a List of Deals crm.deal.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 deals
DEPRECATED
Development of this method has been halted. Please use crm.item.list.
The method crm.deal.list returns a list of deals based on a filter. It is an implementation of the list method for deals.
Method Parameters
|
Name |
Description |
|
select |
A list of fields that should be populated for deals in the selection. The following masks can be used in the selection:
You can find the list of available fields for selection using the method crm.deal.fields. By default, all fields are taken — |
|
filter |
Object format:
where:
You can add a prefix to the keys
The LIKE filter does not work with fields of type You can find the list of available fields for filtering using the method crm.deal.fields. The filter does not support the field |
|
order |
Object format:
where:
You can find the list of available fields for sorting using the method crm.deal.fields |
|
start |
This parameter is used to manage pagination. The page size for results is always static — 50 records. To select the second page of results, pass the value The formula for calculating the
|
Also, see the description of list methods.
Related methods and topics
Code Examples
How to Use Examples in Documentation
Get a list of deals where:
- the funnel ID is
1 - the deal type is
COMPLEX - the title ends with
a - the stage is
C1:NEW - the amount is greater than 10000 but less than or equal to 20000
- manual mode for amount calculation is enabled
- the responsible person is either the user with
id = 1or the user withid = 6 - the deal was created at least 6 months ago
Set the following sort order for this selection: title and amount in ascending order.
For clarity, select only the necessary fields:
- Identifier
ID - Title
TITLE - Deal type
TYPE_ID - Funnel ID
CATEGORY_ID - Stage
STAGE_ID - Amount
OPPORTUNITY - Is manual mode enabled
IS_MANUAL_OPPORTUNITY - Responsible
ASSIGNED_BY_ID - Creation date
DATE_CREATE
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SELECT":["ID","TITLE","TYPE_ID","CATEGORY_ID","STAGE_ID","OPPORTUNITY","IS_MANUAL_OPPORTUNITY","ASSIGNED_BY_ID","DATE_CREATE"],"FILTER":{"=%TITLE":"%a","CATEGORY_ID":1,"TYPE_ID":"COMPLEX","STAGE_ID":"C1:NEW",">OPPORTUNITY":10000,"<=OPPORTUNITY":20000,"IS_MANUAL_OPPORTUNITY":"Y","@ASSIGNED_BY_ID":[1,6],">DATE_CREATE":"'"$(date --date='-6 months' +%Y-%m-%d)"'"},"ORDER":{"TITLE":"ASC","OPPORTUNITY":"ASC"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.deal.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SELECT":["ID","TITLE","TYPE_ID","CATEGORY_ID","STAGE_ID","OPPORTUNITY","IS_MANUAL_OPPORTUNITY","ASSIGNED_BY_ID","DATE_CREATE"],"FILTER":{"=%TITLE":"%a","CATEGORY_ID":1,"TYPE_ID":"COMPLEX","STAGE_ID":"C1:NEW",">OPPORTUNITY":10000,"<=OPPORTUNITY":20000,"IS_MANUAL_OPPORTUNITY":"Y","@ASSIGNED_BY_ID":[1,6],">DATE_CREATE":"'"$(date --date='-6 months' +%Y-%m-%d)"'"},"ORDER":{"TITLE":"ASC","OPPORTUNITY":"ASC"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.deal.list
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of each deal returned in result[] (subset shaped by `select`)
type CrmDealListItem = {
ID: string
TITLE: string
TYPE_ID: string
CATEGORY_ID: string
STAGE_ID: string
OPPORTUNITY: string
IS_MANUAL_OPPORTUNITY: string
ASSIGNED_BY_ID: string
DATE_CREATE: ISODate | null
}
const now = new Date()
const sixMonthAgo = new Date()
sixMonthAgo.setMonth(now.getMonth() - 6)
try {
// crm.deal.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<CrmDealListItem[]>({
method: 'crm.deal.list',
params: {
select: [
'ID',
'TITLE',
'TYPE_ID',
'CATEGORY_ID',
'STAGE_ID',
'OPPORTUNITY',
'IS_MANUAL_OPPORTUNITY',
'ASSIGNED_BY_ID',
'DATE_CREATE',
],
filter: {
'=%TITLE': '%a',
CATEGORY_ID: 1,
TYPE_ID: 'COMPLEX',
STAGE_ID: 'C1:NEW',
'>OPPORTUNITY': 10000,
'<=OPPORTUNITY': 20000,
IS_MANUAL_OPPORTUNITY: 'Y',
'@ASSIGNED_BY_ID': [1, 6],
'>DATE_CREATE': sixMonthAgo,
},
order: {
TITLE: 'ASC',
OPPORTUNITY: 'ASC',
},
start: 0,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Deals on this page:', result.length, result)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function listDeals() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const now = new Date()
const sixMonthAgo = new Date()
sixMonthAgo.setMonth(now.getMonth() - 6)
// crm.deal.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'crm.deal.list',
params: {
select: [
'ID',
'TITLE',
'TYPE_ID',
'CATEGORY_ID',
'STAGE_ID',
'OPPORTUNITY',
'IS_MANUAL_OPPORTUNITY',
'ASSIGNED_BY_ID',
'DATE_CREATE',
],
filter: {
'=%TITLE': '%a',
CATEGORY_ID: 1,
TYPE_ID: 'COMPLEX',
STAGE_ID: 'C1:NEW',
'>OPPORTUNITY': 10000,
'<=OPPORTUNITY': 20000,
IS_MANUAL_OPPORTUNITY: 'Y',
'@ASSIGNED_BY_ID': [1, 6],
'>DATE_CREATE': sixMonthAgo,
},
order: {
TITLE: 'ASC',
OPPORTUNITY: 'ASC',
},
start: 0,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Deals on this page:', result.length, result)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', listDeals)
</script>
try {
$response = $b24Service
->core
->call(
'crm.deal.list',
[
'select' => [
'ID',
'TITLE',
'TYPE_ID',
'CATEGORY_ID',
'STAGE_ID',
'OPPORTUNITY',
'IS_MANUAL_OPPORTUNITY',
'ASSIGNED_BY_ID',
'DATE_CREATE',
],
'filter' => [
'=%TITLE' => '%a',
'CATEGORY_ID' => 1,
'TYPE_ID' => 'COMPLEX',
'STAGE_ID' => 'C1:NEW',
'>OPPORTUNITY' => 10000,
'<=OPPORTUNITY' => 20000,
'IS_MANUAL_OPPORTUNITY' => 'Y',
'@ASSIGNED_BY_ID' => [1, 6],
'>DATE_CREATE' => $sixMonthAgo,
],
'order' => [
'TITLE' => 'ASC',
'OPPORTUNITY' => 'ASC',
],
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Data: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error fetching deal list: ' . $e->getMessage();
}
const now = new Date();
const sixMonthAgo = new Date();
sixMonthAgo.setMonth(now.getMonth() - 6);
BX24.callMethod(
'crm.deal.list',
{
select: [
'ID',
'TITLE',
'TYPE_ID',
'CATEGORY_ID',
'STAGE_ID',
'OPPORTUNITY',
'IS_MANUAL_OPPORTUNITY',
'ASSIGNED_BY_ID',
'DATE_CREATE',
],
filter: {
'=%TITLE': '%a',
CATEGORY_ID: 1,
TYPE_ID: 'COMPLEX',
STAGE_ID: 'C1:NEW',
'>OPPORTUNITY': 10000,
'<=OPPORTUNITY': 20000,
IS_MANUAL_OPPORTUNITY: 'Y',
'@ASSIGNED_BY_ID': [1, 6],
'>DATE_CREATE': sixMonthAgo,
},
order: {
TITLE: 'ASC',
OPPORTUNITY: 'ASC',
},
},
(result) => {
result.error()
? console.error(result.error())
: console.info(result.data())
;
},
);
require_once('crest.php');
$sixMonthAgo = (new DateTime())->modify('-6 months')->format('Y-m-d');
$result = CRest::call(
'crm.deal.list',
[
'SELECT' => [
'ID',
'TITLE',
'TYPE_ID',
'CATEGORY_ID',
'STAGE_ID',
'OPPORTUNITY',
'IS_MANUAL_OPPORTUNITY',
'ASSIGNED_BY_ID',
'DATE_CREATE',
],
'FILTER' => [
'=%TITLE' => '%a',
'CATEGORY_ID' => 1,
'TYPE_ID' => 'COMPLEX',
'STAGE_ID' => 'C1:NEW',
'>OPPORTUNITY' => 10000,
'<=OPPORTUNITY' => 20000,
'IS_MANUAL_OPPORTUNITY' => 'Y',
'@ASSIGNED_BY_ID' => [1, 6],
'>DATE_CREATE' => $sixMonthAgo,
],
'ORDER' => [
'TITLE' => 'ASC',
'OPPORTUNITY' => 'ASC',
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Example
from b24pysdk.client import BaseClient
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
client: BaseClient
try:
bitrix_response = client.crm.deal.list(
select=["ID", "TITLE", "STAGE_ID", "OPPORTUNITY", "ASSIGNED_BY_ID", "DATE_CREATE"],
filter={">OPPORTUNITY": 1000, "!STAGE_ID": "WON", "=OPENED": "Y"},
order={"DATE_CREATE": "DESC", "ID": "DESC"},
start=0,
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
Example as_list
from b24pysdk.client import BaseClient
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
client: BaseClient
try:
bitrix_response = client.crm.deal.list(
select=["ID", "TITLE", "STAGE_ID"],
filter={"!STAGE_ID": "LOSE"},
order={"ID": "ASC"},
).as_list().response
result = bitrix_response.result
for item in result:
print(item)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
Example as_list_fast
from b24pysdk.client import BaseClient
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
client: BaseClient
try:
bitrix_response = client.crm.deal.list(
select=["ID", "TITLE", "STAGE_ID"],
filter={"!STAGE_ID": "LOSE"},
order={"ID": "DESC"},
).as_list_fast(descending=True).response
result = bitrix_response.result
for item in result:
print(item)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
Response Handling
HTTP Status: 200
{
"result": [
{
"ID": "37",
"TITLE": "[A] Deal",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "19999.99",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "1",
"DATE_CREATE": "2024-09-02T18:37:18+02:00"
},
{
"ID": "38",
"TITLE": "[A] Deal",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "20000.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "6",
"DATE_CREATE": "2024-09-02T18:37:38+02:00"
},
{
"ID": "39",
"TITLE": "[B] Sale",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "12500.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "1",
"DATE_CREATE": "2024-04-09T23:11:01+02:00"
},
{
"ID": "40",
"TITLE": "[B] Deal",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "13500.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "6",
"DATE_CREATE": "2024-08-08T19:00:14+02:00"
},
{
"ID": "41",
"TITLE": "[V] Deal",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "11500.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "6",
"DATE_CREATE": "2024-05-08T09:38:23+02:00"
},
{
"ID": "42",
"TITLE": "[S] Deal",
"TYPE_ID": "COMPLEX",
"CATEGORY_ID": "1",
"STAGE_ID": "C1:NEW",
"OPPORTUNITY": "18500.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"ASSIGNED_BY_ID": "6",
"DATE_CREATE": "2024-07-02T15:38:32+02:00"
}
],
"total": 6,
"time": {
"start": 1725292115.026221,
"finish": 1725292115.907058,
"duration": 0.8808369636535645,
"processing": 0.2484450340270996,
"date_start": "2024-09-02T17:48:35+02:00",
"date_finish": "2024-09-02T17:48:35+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
The root element of the response. Contains an array of objects with information about the deal fields. Note that the structure of the fields may change due to the |
|
total |
The total number of found items |
|
next |
Contains the value to be passed in the next request in the The |
|
time |
Information about the execution time of the request |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "Parameter 'filter' must be array."
}
|
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
|
Code |
Description |
Value |
|
|
|
The user does not have permission to "read" deals |
|
|
|
A non-object was passed to the |
|
|
|
A non-object was passed to the |
|
|
|
An unknown error occurred |
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 |