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

# Preview group size

> Preview how many consumers and how much current balance will be included before creating or updating a superadmin communication group.



## OpenAPI

````yaml /api/superadmin.openapi.yaml post /communications/groups/preview
openapi: 3.1.0
info:
  title: YouNegotiate Superadmin API
  version: '2.0'
  description: Stateless API endpoints for the Superadmin portal.
servers:
  - url: https://api.hub.younegotiate.com
    description: Production
security: []
tags:
  - name: System
    description: Public superadmin domain system and health endpoints.
  - name: Authentication
    description: Superadmin login, logout, password reset, and password change endpoints.
  - name: Profile
    description: Authenticated superadmin profile endpoints.
  - name: Admin Configuration
    description: Platform configuration values and feature flag controls.
  - name: MailHub Users
    description: Superadmin management for EcoMail Hub / EcoPortal users.
  - name: Super Admin Users
    description: Superadmin management for platform operations users.
  - name: Consumers
    description: Superadmin consumer account list, detail, filter, and export endpoints.
  - name: Creditors
    description: Superadmin creditor account list and account access endpoints.
  - name: Sub Accounts
    description: Superadmin sub account list and export endpoints.
  - name: Reseller Partners
    description: Superadmin reseller partner list and report-history endpoints.
  - name: Special Plan Inquiries
    description: >-
      Superadmin special membership inquiry list, detail, resolve, and close
      endpoints.
  - name: Plans
    description: >-
      Superadmin membership plan list, create, update, reorder, visibility, and
      delete endpoints.
  - name: Failed - Canceled
    description: Superadmin failed or cancelled membership list and custom email endpoints.
  - name: Merchant Requests
    description: >-
      Superadmin merchant API request list, export, email, forwarding, progress,
      and approval endpoints.
  - name: Bill Pay Donations
    description: Superadmin Bill Pay gift donation list, export, and receipt endpoints.
  - name: Export & Reporting
    description: Superadmin generated report options and CSV download endpoints.
  - name: Communications / Templates
    description: >-
      Superadmin email and SMS template management for manual communications and
      campaigns.
  - name: Communications / Groups
    description: >-
      Superadmin communication group management for dynamic consumer targeting
      and campaign selection.
  - name: Communications / Schedule Campaign
    description: >-
      Superadmin email and SMS campaign scheduling, immediate send, and delivery
      queue endpoints.
  - name: Communications / Campaign Tracker
    description: >-
      Superadmin campaign tracker snapshots, refresh actions, and consumer
      exports.
  - name: Automated Communications
    description: >-
      Superadmin automated email/SMS templates, trigger configuration, and
      delivery history endpoints.
paths:
  /communications/groups/preview:
    post:
      tags:
        - Communications / Groups
      summary: Preview group size
      description: >-
        Preview how many consumers and how much current balance will be included
        before creating or updating a superadmin communication group.
      operationId: superadminPreviewCommunicationGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommunicationGroupPreviewRequest'
            example:
              company_id: all
              consumer_state: not_viewed_offer
              custom_rules:
                placement_date:
                  start_date: '2026-01-01'
                  end_date: '2026-01-31'
      responses:
        '200':
          description: Communication group preview returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationGroupPreviewResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    CommunicationGroupPreviewRequest:
      type: object
      additionalProperties: false
      required:
        - consumer_state
      properties:
        company_id:
          oneOf:
            - type: integer
            - type: string
              enum:
                - all
            - type: 'null'
          description: '`all` or null targets all companies; an integer targets one company.'
        consumer_state:
          $ref: '#/components/schemas/CommunicationGroupState'
        custom_rules:
          $ref: '#/components/schemas/CommunicationGroupCustomRulesRequest'
    CommunicationGroupPreviewResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/CommunicationGroupSnapshot'
    CommunicationGroupState:
      type: string
      enum:
        - all_active
        - not_viewed_offer
        - expired_negotiation
        - viewed_offer_but_no_response
        - open_negotiations
        - not_responded_to_counter_offer
        - negotiated_payoff_but_pending_payment
        - negotiated_plan_but_pending_payment
        - failed_or_skip_more_than_two_payments_consecutively
        - reported_not_paying
        - disputed
        - notice_response_added
        - notice_response_returned
    CommunicationGroupCustomRulesRequest:
      type: object
      additionalProperties: false
      properties:
        expiry_date:
          $ref: '#/components/schemas/CommunicationGroupDateRange'
        placement_date:
          $ref: '#/components/schemas/CommunicationGroupDateRange'
    CommunicationGroupSnapshot:
      type: object
      required:
        - total_count
        - total_balance
        - total_balance_label
      properties:
        total_count:
          type: integer
          example: 10
        total_balance:
          type: number
          format: float
          example: 1250.5
        total_balance_label:
          type: string
          example: $1,250.50
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    CommunicationGroupDateRange:
      type: object
      additionalProperties: false
      required:
        - start_date
        - end_date
      properties:
        start_date:
          type: string
          format: date
          example: '2026-01-01'
        end_date:
          type: string
          format: date
          example: '2026-01-31'
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum token

````