Count jobs
Counts jobs records in the shared records index, optionally grouped by one attribute. Requires jobs:read.
Takes the same query and filters as the search route and returns numbers, never records. limit, offset, sort and objects are refused as unknown fields (400).
group_by names one attribute that GET /v4/records/{plural_slug}/attributes marks groupable: enum, select and boolean attributes, workflow phase, user references such as assigned_to, and the sources and types tokens. The answer then has groups (one per value with records, sorted by count), none_count (records without a value) and overlapping (true for multivalue attributes, where one record can be in several groups). Each group's value works as an eq (or, for multivalue attributes, contains_exact) filter on the search route.
An attribute with more than 50 values returns 422 GROUP_BY_TOO_MANY_VALUES; any other attribute returns 422 GROUP_BY_NOT_SUPPORTED. A grouped count runs one index query per value and has a 10-second budget: over it, 503 COUNT_TIMEOUT.
approximate is true for OAuth tokens of non-manager users: hidden and access-level-protected records are excluded in the index, so the count can lag recent permission changes.
Request example:
{"filters":[{"op":"and","clauses":[{"field":"status","op":"eq","value":"normal"}]}],"group_by":"assigned_to"}Response example (data):
{"count":42,"approximate":false,"groups":[{"value":"Ab12","label":"Anna de Boer","count":30},{"value":"Cd34","label":"Bob","count":9}],"none_count":3,"overlapping":false}Body
querystringSearch query, default *. The same as on the search route.
The same filters as on the search route.
group_ bystringOne attribute marked groupable in the attributes route.
assigned_tonearRecordSearchNeardocument_ querystringThe same as on the search route. Not with group_by (422 DOCUMENT_QUERY_WITH_GROUP_BY).
AutoCADResponse
Record count
Invalid request body
Invalid API key
Insufficient scope
Validation error
Internal server error
Counting took too long
Authorization
bearer_ authhttp (bearer) in headerAPI key or OAuth access token in Authorization header
Scopes: jobs:read
oauth2_ authoauth2OAuth authorization code flow with mandatory S256 PKCE.
Scopes: jobs:read
apikey_ authapiKey in queryAPI key in query string
Scopes: jobs:read
