---
title: Abilities
url: https://lhero.org/portfolio/lh-user-insights/abilities/
date: 2026-10-15T02:05:11+11:00
modified: 2026-10-15T02:05:11+11:00
type: lh-portfolio-doc
---

- **Part of:** [LH User Insights](https://lhero.org/portfolio/lh-user-insights/)

- [`get-query-schema`](#ability-get-query-schema) Get User Insights Query Schema
- [`query-users`](#ability-query-users) Query Users

## Get User Insights Query Schema

`lh-user-insights/get-query-schema` Read-only Idempotent

Returns the registered field list (id, label, type, default visibility, filter config) and the operator registry per filter type. Call this first to discover valid `by` values and operators before calling query-users, since fields include dynamic ones (BuddyPress xProfile fields vary per site, custom fields vary per install). Requires `list_users`. Pass `site_id` to act on another site you belong to.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `site_id` | integer | No |  | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
| `run_without_site_plugins` | boolean | No |  | Optional, with `site_id`. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself. |

## Query Users

`lh-user-insights/query-users` Read-only Idempotent

Filters, sorts, and paginates site users through the same query engine as the User Insights admin screen. Call get-query-schema first for valid `by` and `operator` values – fields vary per site (BuddyPress xProfile, custom fields). Results are automatically scoped to the current site on multisite installs. Requires `list_users`. Pass `site_id` to act on another site you belong to.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `filters` | array of object | No |  | Filter conditions, ANDed together. Each item: {by: field id, operator: operator key for that field's type, condition: value, type: field filter type}. See get-query-schema for valid values. |
| `orderby` | string | No |  | Field id to sort by. Defaults to "registered". |
| `order` | string | No |  | Sort direction. Defaults to DESC. One of: `ASC`, `DESC`. |
| `search` | string | No |  | Matches part of the username, email or display name. Combined with the filters by AND. |
| `number` | integer | No | `20` | Max results to return. |
| `offset` | integer | No | `0` | Pagination offset. |
| `site_id` | integer | No |  | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
| `run_without_site_plugins` | boolean | No |  | Optional, with `site_id`. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself. |