search_constituents_advanced
Search constituents by combining custom attribute filters (including blank/not-blank) with standard LGL filters like keyword, location, membership, groups, lists, and updated date. All filters AND together.
Instructions
Server-side constituent search combining custom attribute filters (including blank/not-blank checks) with standard LGL filters (keyword, location, membership, groups, lists, updated date) and an optional free-text query. All provided filters AND together, matching LGL's actual q[] behavior — there is no OR support. Custom attributes, keywords, groups, lists, and membership levels are all referenced by their display name (not internal LGL IDs); names are resolved and cached for the life of this server process, so only the first call referencing a given name pays a lookup round-trip. Filtering ON a custom attribute (via custom_attributes) works independently of whether its VALUE comes back in results — set include_custom_attrs to also fetch attribute values, which is otherwise omitted to keep responses small.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | ||
| limit | No | ||
| query | No | Optional free-text query, routed to name/email/phone like search_constituents | |
| state | No | 2-letter state code | |
| offset | No | ||
| country | No | ||
| keyword | No | Keyword name (single keyword only — LGL's API does not support filtering by multiple keywords at once) | |
| list_names | No | List display names | |
| updated_to | No | YYYY-MM-DD; constituents updated on/before this date | |
| external_id | No | ||
| group_names | No | Group display names | |
| postal_code | No | Matches left-most characters | |
| updated_from | No | YYYY-MM-DD; constituents updated on/after this date | |
| constituent_type | No | ||
| custom_attributes | No | Filters on custom attributes, by their display name (e.g. 'Background Info'), not their internal key | |
| membership_status | No | ||
| include_custom_attrs | No | Include each result's custom attribute values (name/value pairs). Off by default — filtering on custom_attributes does not require this, and turning it on adds the full value of every custom attribute (e.g. long text fields) to every result. | |
| membership_end_date_to | No | YYYY-MM-DD | |
| membership_level_names | No | Membership level display names | |
| membership_end_date_from | No | YYYY-MM-DD |