Clarity · Schema
AggregateRecordsRequest
GROUP BY + aggregates over a collection's records (user API; the admin variant adds project_id).
Artificial IntelligenceCustomer ExperienceAI AgentsEnterprise
Properties
| Name | Type | Description |
|---|---|---|
| group_by | array | 0..3 group keys: a field name, or {field, granularity} to bucket a date-time field. |
| metrics | array | 1..5 aggregates computed per bucket (default: count). |
| filters | object | Record filters, all AND-ed: {field: condition} where a condition is a value (equals), null (the field is empty), a list (one of), or an object of operators — eq, neq, in, not_in, gt, gte, lt, lte, emp |
| sort | object | Order groups by a group_by field or a metric label ('count', 'sum_amount'); default: the first metric. |
| order | object | Sort direction (default desc). |
| limit | integer | Groups per page, 1..100. |
| offset | integer | Groups to skip — page until offset reaches total. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-aggregate-records-request-schema.json",
"title": "AggregateRecordsRequest",
"description": "GROUP BY + aggregates over a collection's records (user API; the admin variant\nadds project_id).",
"x-generated": "2026-11-10",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/onclarity-com-agent-store-api-openapi.yml#/components/schemas/AggregateRecordsRequest",
"properties": {
"group_by": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/GroupBySpec"
}
]
},
"type": "array",
"title": "Group By",
"description": "0..3 group keys: a field name, or {field, granularity} to bucket a date-time field."
},
"metrics": {
"items": {
"$ref": "#/$defs/MetricSpec"
},
"type": "array",
"title": "Metrics",
"description": "1..5 aggregates computed per bucket (default: count)."
},
"filters": {
"additionalProperties": true,
"type": "object",
"title": "Filters",
"description": "Record filters, all AND-ed: {field: condition} where a condition is a value (equals), null (the field is empty), a list (one of), or an object of operators — eq, neq, in, not_in, gt, gte, lt, lte, empty (true|false). neq/not_in keep records whose field is empty. Fields: the collection's scalar fields plus id, created_at, updated_at. A date-time without an offset is read as UTC; a filter carries at most 1000 values in total."
},
"sort": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Sort",
"description": "Order groups by a group_by field or a metric label ('count', 'sum_amount'); default: the first metric."
},
"order": {
"anyOf": [
{
"type": "string",
"enum": [
"asc",
"desc"
]
},
{
"type": "null"
}
],
"title": "Order",
"description": "Sort direction (default desc)."
},
"limit": {
"type": "integer",
"title": "Limit",
"description": "Groups per page, 1..100.",
"default": 50
},
"offset": {
"type": "integer",
"title": "Offset",
"description": "Groups to skip — page until offset reaches total.",
"default": 0
}
},
"type": "object",
"$defs": {
"GroupBySpec": {
"properties": {
"field": {
"type": "string",
"title": "Field",
"description": "Field to group by."
},
"granularity": {
"anyOf": [
{
"type": "string",
"enum": [
"day",
"week",
"month"
]
},
{
"type": "null"
}
],
"title": "Granularity",
"description": "Date bucket for a date-time field; omit to group by the raw value."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"field"
],
"title": "GroupBySpec",
"description": "A group_by entry that buckets a date-time field (UTC; a week starts on Monday)."
},
"MetricSpec": {
"properties": {
"op": {
"type": "string",
"enum": [
"count",
"count_distinct",
"sum",
"avg",
"min",
"max"
],
"title": "Op",
"description": "Aggregate operation."
},
"field": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Field",
"description": "Schema field the op applies to."
}
},
"type": "object",
"required": [
"op"
],
"title": "MetricSpec",
"description": "One aggregate to compute per group. ``count`` needs no field; ``sum``/``avg``\nrequire a numeric field; ``count_distinct``/``min``/``max`` any non-JSON field."
}
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/onclarity-com-aggregate-records-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.