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

# Dry-run a segment query (count only)

> Return the total number of users a [Segment List](/docs/segment-lists) SQL query would match, without returning the rows. Use this when you only need to size the audience.



## OpenAPI

````yaml POST /v1/subscriber_list/~/dry_run/count/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/subscriber_list/~/dry_run/count/:
    post:
      summary: Dry-run a segment query (count only)
      description: >-
        Return the total number of users a [Segment List](/docs/segment-lists)
        SQL query would match, without returning the rows. Use this when you
        only need to size the audience.
      operationId: segment-dry-run-count
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - query_text
              properties:
                query_text:
                  type: string
                  description: >-
                    The SQL query to count. Must return a `distinct_id` column
                    and reference only the `users` and `events` tables.
                  example: >-
                    SELECT distinct_id FROM users WHERE user_properties ->>
                    'plan' = 'enterprise'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    count: 4812
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Number of distinct users matched by the query.
                    example: 4812
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Schema error:
                  value:
                    code: 400
                    error_code: error
                    type: ValidationError
                    message: >-
                      {"query_text": "Schema error: No field named name. Valid
                      fields are users.distinct_id, users.created_at,
                      users.updated_at, users.language, users.locale,
                      users.timezone, users.user_properties,
                      users.active_channels, users.active_emails,
                      users.active_phone_numbers"}
                    detail:
                      query_text: >-
                        Schema error: No field named name. Valid fields are
                        users.distinct_id, users.created_at, users.updated_at,
                        users.language, users.locale, users.timezone,
                        users.user_properties, users.active_channels,
                        users.active_emails, users.active_phone_numbers
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  error_code:
                    type: string
                    example: error
                  type:
                    type: string
                    example: ValidationError
                  message:
                    type: string
                    description: Human-readable error message.
                  detail:
                    type: object
                    description: Structured error detail keyed by field.
      deprecated: false
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: cURL
          label: Dry-run (count only)
          source: >
            curl -X POST
            "https://hub.suprsend.com/v1/subscriber_list/~/dry_run/count/" \
              --header 'Authorization: Bearer __YOUR_API_KEY__' \
              --header 'Content-Type: application/json' \
              --data '{
                "query_text": "SELECT distinct_id FROM users WHERE user_properties ->> '\''plan'\'' = '\''enterprise'\''"
              }'
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.

````