Standards · Schema

AggregateRecordsDto

A measure over the records a query selects, optionally grouped (twice) and compared with the previous period, or up to four `series` along one date bucket (`groupBy: { bucket }`, no `measure`). Keys outside this list are refused.

Artificial IntelligenceCollaborationWorkspaceFinancial ServicesProductivity

Properties

Name Type Description
query object The records measured. `sorts` and `limit` are ignored.
measure string Required without `series`, absent with it.
attribute string The number or currency attribute measured; required unless `measure` is `count`.
groupBy object
groupBy2 object
compare object Restricts the measure to the current period on a date attribute and answers the previous one in `previous`.
passages object
series array Up to four measures over one time axis, answered per name in `series`.
cumulate boolean Reads each date bucket as the running total of its series; refused without a date grouping.
userFilters object
timezone string IANA timezone of the date buckets, the comparison windows and `@today`; defaults to UTC.
hostRecordId string The host record a relation-sourced query reads from.
View JSON Schema on GitHub

JSON Schema

standards-new-aggregate-records-dto-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/standards-new/json-schema/standards-new-aggregate-records-dto-schema.json",
  "title": "AggregateRecordsDto",
  "description": "A measure over the records a query selects, optionally grouped (twice) and compared with the previous period, or up to four `series` along one date bucket (`groupBy: { bucket }`, no `measure`). Keys outside this list are refused.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/standards-new-openapi.json#/components/schemas/AggregateRecordsDto",
  "type": "object",
  "properties": {
    "query": {
      "type": "object",
      "description": "The records measured. `sorts` and `limit` are ignored.",
      "properties": {
        "source": {
          "type": "object",
          "additionalProperties": true,
          "description": "The collection the query reads (an object, or a relation of a host record)."
        },
        "filters": {
          "$ref": "#/$defs/FilterState"
        },
        "sorts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SortRule"
          }
        },
        "limit": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "source"
      ]
    },
    "measure": {
      "type": "string",
      "enum": [
        "count",
        "sum",
        "avg",
        "min",
        "max"
      ],
      "description": "Required without `series`, absent with it."
    },
    "attribute": {
      "type": "string",
      "description": "The number or currency attribute measured; required unless `measure` is `count`."
    },
    "groupBy": {
      "$ref": "#/$defs/AggregateGroupBy"
    },
    "groupBy2": {
      "$ref": "#/$defs/AggregateGroupBy"
    },
    "compare": {
      "type": "object",
      "description": "Restricts the measure to the current period on a date attribute and answers the previous one in `previous`.",
      "properties": {
        "attribute": {
          "type": "string"
        },
        "period": {
          "type": "string",
          "enum": [
            "day",
            "week",
            "month",
            "quarter",
            "year",
            "7d",
            "30d"
          ]
        }
      },
      "required": [
        "attribute",
        "period"
      ]
    },
    "passages": {
      "$ref": "#/$defs/AggregatePassages"
    },
    "series": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AggregateSeries"
      },
      "minItems": 1,
      "maxItems": 4,
      "description": "Up to four measures over one time axis, answered per name in `series`."
    },
    "cumulate": {
      "type": "boolean",
      "description": "Reads each date bucket as the running total of its series; refused without a date grouping."
    },
    "userFilters": {
      "$ref": "#/$defs/FilterState"
    },
    "timezone": {
      "type": "string",
      "description": "IANA timezone of the date buckets, the comparison windows and `@today`; defaults to UTC."
    },
    "hostRecordId": {
      "type": "string",
      "description": "The host record a relation-sourced query reads from."
    }
  },
  "required": [
    "query"
  ],
  "$defs": {
    "AggregateGroupBy": {
      "description": "A grouping: a status, select, single user or single relation attribute by name, or a date attribute cut into buckets.",
      "oneOf": [
        {
          "type": "string",
          "description": "Attribute name."
        },
        {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "description": "Date attribute (createdAt/updatedAt included)."
            },
            "bucket": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ]
            }
          },
          "required": [
            "attribute",
            "bucket"
          ]
        }
      ]
    },
    "AggregatePassages": {
      "type": "object",
      "description": "Counts passages instead of records: the records that entered one of `to`, options of the status or select attribute `field`, each once at its last entry while it still holds one. The entry date reads as `passedAt`.",
      "properties": {
        "field": {
          "type": "string",
          "description": "A status or select attribute."
        },
        "to": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Option values entered."
        }
      },
      "required": [
        "field",
        "to"
      ]
    },
    "AggregateSeries": {
      "type": "object",
      "description": "One series: its own measure over the query's records narrowed by its own filters, placed in time by its own date.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique in the request: its key in the answer's `series`."
        },
        "measure": {
          "type": "string",
          "enum": [
            "count",
            "sum",
            "avg",
            "min",
            "max"
          ]
        },
        "attribute": {
          "type": "string",
          "description": "The number or currency attribute measured; required unless `measure` is `count`."
        },
        "date": {
          "type": "string",
          "description": "The date attribute the series is cut by (`createdAt` when absent); a passages series takes none."
        },
        "passages": {
          "$ref": "#/$defs/AggregatePassages"
        },
        "filters": {
          "$ref": "#/$defs/FilterState"
        }
      },
      "required": [
        "name",
        "measure"
      ]
    },
    "FilterRule": {
      "type": "object",
      "description": "A single filter rule. The operator must be valid for the attribute's type.",
      "properties": {
        "attribute": {
          "type": "string",
          "description": "Root attribute name (a scalar attribute, or a reference attribute when `property` is set)."
        },
        "property": {
          "type": "string",
          "description": "When set, the rule filters on a qualified edge property of a reference attribute (relation or document). The operator then applies to the property's type."
        },
        "quantifier": {
          "type": "string",
          "enum": [
            "any",
            "none"
          ],
          "description": "Existence quantifier for qualified edge rules (\"at least one\" vs \"none\"). Only valid when `property` is set; defaults to the operator-derived polarity."
        },
        "operator": {
          "type": "string",
          "enum": [
            "is",
            "is_not",
            "contains",
            "not_contains",
            "starts_with",
            "ends_with",
            "less_than",
            "greater_than",
            "less_or_equal",
            "greater_or_equal",
            "is_within",
            "on_day_month",
            "any_of",
            "none_of",
            "is_empty",
            "is_not_empty"
          ],
          "description": "Filter operator. The valid subset depends on the attribute type (text, number, checkbox, date, select, multiselect, relation). The ordering operators (`less_than`, `greater_than`, `less_or_equal`, `greater_or_equal`) also apply to text, `label` and `id`: text compares by code point, and an `id` range is bounded by a whole UUID. Short codes (`lt`, `gte`, `eq`, `in`, …) are accepted and normalized."
        },
        "value": {
          "description": "Filter value. The type depends on the attribute and operator: string, number, boolean, array of strings, a relative date object ({ amount, unit, direction }) for `is_within`, a dynamic value such as @me ({ dynamic: \"actor\", ref: \"current\" }) or @today ({ dynamic: \"date\", anchor: \"today\" }), or null for operators like `is_empty`."
        }
      },
      "required": [
        "attribute",
        "operator",
        "value"
      ]
    },
    "FilterState": {
      "type": "object",
      "description": "Filter configuration: a combinator plus a flat list of rules.",
      "properties": {
        "combinator": {
          "type": "string",
          "enum": [
            "and",
            "or"
          ],
          "description": "How to combine rules."
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FilterRule"
          }
        }
      },
      "required": [
        "combinator",
        "rules"
      ]
    },
    "SortRule": {
      "type": "object",
      "description": "A single sort rule.",
      "properties": {
        "attribute": {
          "type": "string",
          "description": "Attribute name to sort by."
        },
        "direction": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "description": "Sort direction."
        }
      },
      "required": [
        "attribute",
        "direction"
      ]
    }
  }
}

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.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/standards-new-aggregate-records-dto"
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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.