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
filter object Filtering by the fields of GET /v1/addresses/fields.
Filtering syntax. Example: { "entityTypeId": 8, "entityId": 42 }
select array Field 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
limit number 50 Number of records (up to 5000)
offset number 0 Skip N records
sort object Sorting: { "typeId": "asc" }

Examples

curl — personal key

Terminal
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 app

Terminal
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

javascript
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 app

javascript
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:

JSON
{
  "filter": { "entityTypeId": 8, "entityId": 42 }
}

Addresses of a specific type for a lead:

JSON
{
  "filter": { "entityTypeId": 1, "entityId": 1000755, "typeId": 1 }
}

Response fields

Field Type Description
success boolean Always true on success
data array Array of addresses (all fields — see Address fields)
meta.total number Total number of records matching the filter
meta.hasMore boolean Whether 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

JSON
{
  "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:

JSON
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}

Errors

HTTP Code Description
403 SCOPE_DENIED The API key lacks the crm scope
401 TOKEN_MISSING The API key has no configured tokens
400 INVALID_FILTER Error in the filter syntax
400 UNKNOWN_SELECT_FIELD select 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
422 BITRIX_ERROR select 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.

See also