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

# Estimate group count

> Count contacts matching filter conditions without persisting a group. Admin only.



## OpenAPI

````yaml /api-reference/openapi.json post /api/groups/estimate
openapi: 3.1.0
info:
  title: Tedro API
  version: 1.0.0
  description: REST API for the Tedro communication operations platform.
servers:
  - url: https://api.tedro.io
    description: Production
security:
  - sessionCookie: []
    workspaceId: []
paths:
  /api/groups/estimate:
    post:
      tags:
        - Groups
      summary: Estimate group count
      description: >-
        Count contacts matching filter conditions without persisting a group.
        Admin only.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupEstimate'
      responses:
        '200':
          description: Contact count estimate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupEstimateResponse'
        '401':
          description: Unauthorized - missing or invalid session cookie
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - insufficient role (admin required)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - sessionCookie: []
          workspaceId: []
components:
  schemas:
    GroupEstimate:
      type: object
      properties:
        filters:
          type: object
          properties:
            version:
              type: number
              enum:
                - 1
            logic:
              type: string
              enum:
                - AND
                - OR
            conditions:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  operator:
                    type: string
                  value: {}
                required:
                  - field
                  - operator
          required:
            - version
            - logic
            - conditions
      required:
        - filters
      additionalProperties: false
      description: Estimate contact count for a filter set without persisting
      example:
        filters:
          version: 1
          logic: AND
          conditions:
            - field: language
              operator: equals
              value: en
    GroupEstimateResponse:
      type: object
      properties:
        count:
          type: number
      required:
        - count
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Session cookie set by Better Auth on sign-in.
    workspaceId:
      type: apiKey
      in: header
      name: x-workspace-id
      description: Workspace UUID. Required on all /api/* endpoints.

````