Docs

Resolve Organization Selection

POST /organizations/{orgId}/queries/selection

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

FieldTypeRequiredDescription
orgIduuidRequired

Request Body

FieldTypeRequiredDescription
sourcestringOptional
filterQueryFilterGroupOptional
searchQuerySearchOptional
groupBysQueryGroupBy[]Optional
groupKeyQueryGroupKeyPart[]Optional
hierarchyQueryHierarchyOptional
requiredVerbstringOptional
actionFilterQueryFilterGroupOptional
excludedIdsuuid[]Optional
timeZonestringOptional
todaystringOptional

QueryFilterGroup

FieldTypeDescription
logicstring| null
rulesQueryFilterRule[]| null
groupsQueryFilterGroup[]| null

QuerySearch

FieldTypeDescription
textstring| null
pathsstring[]| null

QueryGroupBy

FieldTypeDescription
pathstring| null
dateBucketstring| null

QueryGroupKeyPart

FieldTypeDescription
pathstring| null
valueJsonElement| null

QueryHierarchy

FieldTypeDescription
includeAncestorsboolean
includeDescendantsboolean
settingRuleIdsstring[]| null
parentIduuid| null

QueryFilterRule

FieldTypeDescription
idstring| null
pathstring| null
operatorstring| null
valueJsonElement| null

Response

FieldTypeDescription
idsuuid[]| null
withoutVerbinteger
matchedinteger
truncatedboolean