> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetdoris.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Aggregate objects of a type

> Counts objects, or computes declared measures, grouped by one dimension or by time. `GET /types/{type_name}` lists the measures and dimensions of a type. This endpoint does not take a `privacy` parameter. Rate limit: 120 requests per minute for each workspace.



## OpenAPI

````yaml /openapi.json get /{type_name}/aggregate
openapi: 3.1.0
info:
  title: Doris Ontology API
  version: 1.0.0
  description: >-
    The REST API of the Doris ontology. Use it to read deals, accounts, people,
    meetings, commitments and the other types in your workspace. All routes
    share one quota of 10,000 requests a day for each workspace. The MCP server
    uses the same quota. When the quota is used up, the API returns `429
    quota_exceeded`.
servers:
  - url: https://server.meetdoris.com/api/v1/ontology
    description: Ontology API
security:
  - BearerAuth: []
tags:
  - name: Schema
    description: Types and the OpenAPI document.
  - name: Query
    description: Search, list and aggregate.
  - name: Resolve
    description: Read objects by ID.
  - name: Graph
    description: Follow links between objects.
  - name: Deals
    description: Deal-only reads.
  - name: Write
    description: Field writes and actions.
paths:
  /{type_name}/aggregate:
    get:
      tags:
        - Query
      summary: Aggregate objects of a type
      description: >-
        Counts objects, or computes declared measures, grouped by one dimension
        or by time. `GET /types/{type_name}` lists the measures and dimensions
        of a type. This endpoint does not take a `privacy` parameter. Rate
        limit: 120 requests per minute for each workspace.
      operationId: aggregateObjects
      parameters:
        - name: type_name
          in: path
          required: true
          schema:
            type: string
            example: deal
          description: >-
            The object type, for example `deal`, `account`, `person`, `meeting`
            or `commitment`. Call `GET /types` to see the types in your
            workspace.
        - name: group_by
          in: query
          schema:
            type: string
          description: A declared dimension to group by, for example `stage` on `deal`.
        - name: metric
          in: query
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
          description: >-
            A declared measure name, for example `deal_count` or
            `pipeline_amount` on `deal`. Repeat the parameter for more than one.
            Leave empty to use the count measure of the type.
        - name: filters
          in: query
          schema:
            type: string
          description: >-
            A JSON object of field filters, URL-encoded. Example:
            `{"stage":"Negotiation"}`. The server ignores a value that is not a
            JSON object.
        - name: time_bucket
          in: query
          schema:
            type: string
            enum:
              - week
              - month
              - quarter
          description: Group results by this time period. You must also set `time_field`.
        - name: time_field
          in: query
          schema:
            type: string
          description: >-
            The declared date property to group by time, for example
            `close_date`.
      responses:
        '200':
          description: Groups or time buckets, with totals.
          content:
            application/json:
              schema:
                type: object
              example:
                ok: true
                groups:
                  - stage: Negotiation
                    deal_count: 12
                totals:
                  deal_count: 12
        '400':
          description: '`validation_error`: an unknown dimension, measure or time field.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The type does not exist (`unknown_type`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Doris API key that starts with `sk-live-`. A workspace admin creates
        keys in Settings > Workspace > Developer. A key works only on
        `/api/v1/ontology/` routes.

````