POST/organizations/{orgId}/queries/selection
Resolves "select all matching" to event ids for a bulk action: the query's filter, search and optional group key
(with its groupBys and timeZone), minus excludedIds, keeping only rows that pass actionFilter and that the caller
holds requiredVerb on. Returns ids, matched (after excludedIds, before actionFilter and requiredVerb), withoutVerb
(rows passing actionFilter that lack the verb) and truncated (over the selection limit: refused, no ids,
withoutVerb 0). A selection using any field the caller can't see, or that doesn't exist, is a 400 naming it. Then
call the bulk endpoint, such as Events_ArchiveEvents or Events_PurgeEvents, with the ids. The orgId comes from
Users_GetOrganizations; paths from Query_GetOrganizationQuerySourceSchema. Needs Organization basic access.
today (yyyy-MM-dd, the caller's local date) anchors relative dates such as Today; without it they resolve from the UTC date.
Path Parameters
| Field | Type | Required | Description |
|---|
| orgId | uuid | Required | |
Request Body
| Field | Type | Required | Description |
|---|
| source | string | Optional | |
| filter | QueryFilterGroup | Optional | |
| search | QuerySearch | Optional | |
| groupBys | QueryGroupBy[] | Optional | |
| groupKey | QueryGroupKeyPart[] | Optional | |
| hierarchy | QueryHierarchy | Optional | |
| requiredVerb | string | Optional | |
| actionFilter | QueryFilterGroup | Optional | |
| excludedIds | uuid[] | Optional | |
| timeZone | string | Optional | |
| today | string | Optional | |
QueryFilterGroup
| Field | Type | Description |
|---|
| logic | string| null | |
| rules | QueryFilterRule[]| null | |
| groups | QueryFilterGroup[]| null | |
QuerySearch
| Field | Type | Description |
|---|
| text | string| null | |
| paths | string[]| null | |
QueryGroupBy
| Field | Type | Description |
|---|
| path | string| null | |
| dateBucket | string| null | |
QueryGroupKeyPart
| Field | Type | Description |
|---|
| path | string| null | |
| value | JsonElement| null | |
QueryHierarchy
| Field | Type | Description |
|---|
| includeAncestors | boolean | |
| includeDescendants | boolean | |
| settingRuleIds | string[]| null | |
| parentId | uuid| null | |
QueryFilterRule
| Field | Type | Description |
|---|
| id | string| null | |
| path | string| null | |
| operator | string| null | |
| value | JsonElement| null | |
Response
| Field | Type | Description |
|---|
| ids | uuid[]| null | |
| withoutVerb | integer | |
| matched | integer | |
| truncated | boolean | |