For AI agents: markdown of this page — /docs-content-en/entities/addresses/search.md documentation index — /llms.txt
Search addresses
POST /v1/addresses/search
Search addresses with filters and auto-pagination. Equivalent to GET /v1/addresses, but parameters are passed in the request body — suitable for complex filters with many conditions and for programmatic query building.
Request fields (body)
| Parameter | Type | Default | Description |
|---|---|---|---|
Parameterfilter |
Typeobject | Default— | DescriptionFiltering by the fields of GET /v1/addresses/fields.Filtering syntax. Example: { "entityTypeId": 8, "entityId": 42 } |
Parameterselect |
Typearray | Default— | DescriptionField names: ["city", "postalCode"]. Bitrix24 source names are accepted too — CITY maps to city. The value ["*"] returns every field. Alongside "*", an unknown name does not cause the search to be rejected — 200 is returned with an UNKNOWN_SELECT_FIELD warning in meta.warnings, and the field is missing from the records. Without select, the full record is returned. The composite key typeId, entityTypeId, entityId is always returned |
Parameterlimit |
Typenumber | Default50 |
DescriptionNumber of records (up to 5000) |
Parameteroffset |
Typenumber | Default0 |
DescriptionSkip N records |
Parametersort |
Typeobject | Default— | DescriptionSorting: { "typeId": "asc" } |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/addresses/search" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": { "entityTypeId": 1, "city": "Springfield" },
"limit": 20
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/addresses/search" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filter": { "entityTypeId": 1, "city": "Springfield" },
"limit": 20
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/addresses/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { entityTypeId: 1, city: 'Springfield' },
limit: 20,
}),
})
const { success, data } = await res.json()
console.log('Found:', data.length)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/addresses/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { entityTypeId: 1, city: 'Springfield' },
limit: 20,
}),
})
const { success, data } = await res.json()
Other scenarios
All addresses of a single requisite:
{
"filter": { "entityTypeId": 8, "entityId": 42 }
}
Addresses of a specific type for a lead:
{
"filter": { "entityTypeId": 1, "entityId": 1000755, "typeId": 1 }
}
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typearray | DescriptionArray of addresses (all fields — see Address fields) |
Fieldmeta.total |
Typenumber | DescriptionTotal number of records matching the filter |
Fieldmeta.hasMore |
Typeboolean | DescriptionWhether there are more records beyond limit |
The meta fields sit next to data, not inside it. Paginate by meta.hasMore: a data length equal to limit does not rule out the last page.
Response example
{
"success": true,
"data": [
{
"typeId": 1,
"entityTypeId": 1,
"entityId": 1000755,
"address1": "123 Main St",
"address2": "Suite 5",
"city": "Springfield",
"postalCode": "62701",
"region": "Sangamon County",
"province": "Illinois",
"country": "United States",
"countryCode": null,
"locAddrId": 483,
"anchorTypeId": 1,
"anchorId": 1000755
},
{
"typeId": 1,
"entityTypeId": 1,
"entityId": 1000759,
"address1": "97 Oak Ave",
"address2": "office 5",
"city": "Springfield",
"postalCode": "62704",
"region": "Sangamon County",
"province": "Illinois",
"country": "United States",
"countryCode": null,
"locAddrId": 491,
"anchorTypeId": 1,
"anchorId": 1000759
}
],
"meta": {
"total": 107,
"hasMore": true
}
}
Error response example
403 — no scope:
{
"success": false,
"error": {
"code": "SCOPE_DENIED",
"message": "This endpoint requires 'crm' scope"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key lacks the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP400 | CodeINVALID_FILTER |
DescriptionError in the filter syntax |
| HTTP400 | CodeUNKNOWN_SELECT_FIELD |
Descriptionselect contained a name that is absent from the address schema. The search is rejected before the Bitrix24 call, and message lists the accepted names after the word Available. Available names — Address fields |
| HTTP422 | CodeBITRIX_ERROR |
Descriptionselect contained id. The address schema accepts that name, Bitrix24 does not know it, so the whole search is rejected with an Unknown field definition message. The composite key comes from getting a single address |
Full list of common API errors — Errors.
Known specifics
Field names in the filter are camelCase. Pass typeId, entityTypeId, entityId, city, postalCode, countryCode — the same names the GET /v1/addresses/fields schema returns.