#Search contacts
POST /v1/contacts/search
Search contacts with filters via POST — more convenient for complex queries.
#Request fields (body)
| Parameter | Type | Default | Description |
|---|---|---|---|
filter |
object | — | Filtering by GET /v1/contacts/fields fields.Filtering syntax. Example: ?filter[companyId]=15 |
limit |
number | 50 |
Number of records (up to 5000) |
offset |
number | 0 |
Skip N records |
order |
object | — | Sorting: { "lastName": "asc" } |
select |
string[] | — | Field selection: ["id", "name", "lastName", "phone"] |
#Examples
#curl — personal key
curl -X POST "https://vibecode.bitrix24.tech/v1/contacts/search" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": { "companyId": 15 },
"limit": 10,
"order": { "lastName": "asc" }
}'
#curl — OAuth app
curl -X POST "https://vibecode.bitrix24.tech/v1/contacts/search" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filter": { "companyId": 15 },
"limit": 10,
"order": { "lastName": "asc" }
}'
#JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.tech/v1/contacts/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { companyId: 15 },
limit: 10,
order: { lastName: 'asc' },
}),
})
const { success, data } = await res.json()
#JavaScript — OAuth app
const res = await fetch('https://vibecode.bitrix24.tech/v1/contacts/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { companyId: 15 },
limit: 10,
order: { lastName: 'asc' },
}),
})
const { success, data } = await res.json()
#Response fields
| Field | Type | Description |
|---|---|---|
data |
array | Array of contacts (fields — see Fields) |
The card URL of any contact from the data array is its id:
https://<portal>.bitrix24.ru/crm/contact/details/<id>/
<portal> — the portal domain. Access is restricted by the employee's permissions in Bitrix24.
#Response example
{
"success": true,
"data": [
{
"id": 71,
"name": "Ivan",
"lastName": "Petrov",
"phone": "74955553546",
"companyId": 15,
"assignedById": 1,
"typeId": "CLIENT"
}
]
}
#Error response example
403 — no scope:
{
"success": false,
"error": {
"code": "SCOPE_DENIED",
"message": "This endpoint requires 'crm' scope"
}
}
#Errors
| HTTP | Code | Description |
|---|---|---|
| 403 | SCOPE_DENIED |
API key lacks the crm scope |
| 401 | TOKEN_MISSING |
API key has no configured tokens |
Full list of common API errors — Errors.
#See also
- List contacts — GET request for simple filters
- Filtering syntax
- Batch — combining requests
- Limits and optimization — rate limits