Query any entity
civicrm_queryRead records of ANY CiviCRM entity with APIv4 Entity.get: choose fields, filter, sort and page. Use civicrm_list_entities and civicrm_get_fields for the names. Field names may be joined (contact_id.display_name, email_primary.email) or ask for an option's text (status_id:label). Examples: entity Tag; entity Campaign with where [{field:'is_active',op:'=',value:true}]; entity Contribution with select ['id','total_amount'] and where [{field:'total_amount',op:'>=',value:1000}]. Read-only; credential fields and system entities (settings, payment processors, mailings, users) are refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Records per call, 1-100 (default 25). | |
| where | No | Filters, all of which must match. | |
| entity | Yes | APIv4 entity name, e.g. Campaign. | |
| offset | No | How many records to skip (default 0). Pass the previous reply's next_offset. | |
| select | Yes | Fields to return. | |
| order_by | No | Sort order. |