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

# Get an aggregate

> **Beta.** The request and response shapes may still change.

Retrieve one of your aggregates.

Returns one aggregate in full: its name, what it counts, its key, its window and its filter.

The response does not hold the counts. A rule reads the count of the evaluated identifier as `aggregate.custom.<name>` when you [evaluate a flow](https://docs.prelude.so/watch/v2/api-reference/evaluate-flow.md).


## OpenAPI

````yaml get /v2/watch/management/aggregates/{aggregate_id}
openapi: 3.1.0
info:
  title: Prelude API
  version: 2.0.0
  description: The Prelude API allows you to send messages to your users.
  contact:
    email: support@prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - apiToken: []
tags:
  - name: Notify
    description: Send transactional and marketing messages with compliance enforcement.
  - name: Transactional
    description: Send transactional messages (deprecated - use Notify API instead).
  - name: Verify
    description: Verify phone numbers.
  - name: Watch
    description: Evaluate email addresses and phone numbers for trustworthiness.
  - name: Lookup
    description: >-
      Retrieve detailed information about a phone number including carrier data,
      line type, and portability status.
paths:
  /v2/watch/management/aggregates/{aggregate_id}:
    get:
      tags:
        - Watch
      summary: Get an aggregate
      description: |-
        **Beta.** The request and response shapes may still change.

        Retrieve one of your aggregates.
      operationId: getWatchAggregate
      parameters:
        - name: aggregate_id
          in: path
          required: true
          schema:
            type: string
            examples:
              - agg_01jc0t6fwwfgfsq1md24mhyztj
          description: The aggregate identifier.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchAggregate'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                example:
                  code: aggregate_not_found
                  message: The requested aggregate does not exist.
                  type: not_found
                  request_id: 3d19215e-2991-4a05-a41a-527314e6ff6a
components:
  schemas:
    WatchAggregate:
      type: object
      properties:
        id:
          type: string
          examples:
            - agg_01jc0t6fwwfgfsq1md24mhyztj
          description: The aggregate identifier.
        name:
          type: string
          examples:
            - fraud_reports
        description:
          type: string
          examples:
            - Confirmed fraud reports per phone number.
        type:
          type: string
          enum:
            - CUSTOM
          description: >-
            Always `CUSTOM`. An aggregate you define is your own, and only your
            rules can read it.
        measure:
          type: string
          enum:
            - COUNT
            - COUNT_DISTINCT
        key:
          type: array
          items:
            type: string
          examples:
            - - target.phone_number
        distinct:
          type: string
          description: Only on a `COUNT_DISTINCT` aggregate.
          examples:
            - target.phone_number
        window:
          type: string
          enum:
            - 10m
            - 1h
            - 3h
            - 24h
            - 14d
          examples:
            - 14d
        source:
          type: object
          properties:
            event:
              type: object
              properties:
                filter:
                  type: string
                  description: Absent when the aggregate counts every event.
                  examples:
                    - >-
                      event.label == "account.banned" && event.confidence ==
                      "minimum"
                key:
                  type: array
                  items:
                    type: string
                  description: >-
                    The event values the counter is selected by. Always the same
                    as `key`.
                  examples:
                    - - target.phone_number
                distinct:
                  type: string
                  description: The event value counted. Always the same as `distinct`.
                  examples:
                    - target.phone_number
              required:
                - key
      required:
        - id
        - name
        - description
        - type
        - measure
        - key
        - window
        - source
    Error:
      type: object
      properties:
        code:
          type: string
          description: The error code.
          examples:
            - invalid_phone_number
        message:
          type: string
          examples:
            - >-
              The provided phone number is invalid. Provide a valid E.164 phone
              number.
          description: A human-readable message describing the error.
        type:
          type: string
          examples:
            - bad_request
          description: The error type.
        request_id:
          type: string
          examples:
            - 3d19215e-2991-4a05-a41a-527314e6ff6a
          description: >-
            A string that identifies this specific request. Report it back to us
            to help us diagnose your issues.
        param:
          type: string
          examples:
            - phone_number
          description: The parameter the error refers to, when it applies to a single one.
      required:
        - code
        - message
        - type
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.