> ## 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.

# List your aggregates

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

List your aggregates.

Returns your aggregates, with what each one counts, its key, its window and its filter.

Pagination works as it does elsewhere: pass `next_cursor` back as `cursor`.


## OpenAPI

````yaml get /v2/watch/management/aggregates
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:
    get:
      tags:
        - Watch
      summary: List aggregates
      description: |-
        **Beta.** The request and response shapes may still change.

        List your aggregates.
      operationId: listWatchAggregates
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: >-
            Maximum number of aggregates to return per page. A larger value is
            clamped to 200 rather than refused.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Pagination cursor from the previous response.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchAggregateListResponse'
        '400':
          description: KO
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WatchAggregateListResponse:
      type: object
      properties:
        aggregates:
          type: array
          items:
            $ref: '#/components/schemas/WatchAggregate'
        next_cursor:
          type: string
          description: >-
            Pass this back as `cursor` for the next page. Absent on the last
            page.
          examples:
            - agg_01jc0t6fwwfgfsq1md24mhyztj
      required:
        - aggregates
    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
    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
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer

````

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