> ## 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 (sample rows)

> Preview the rows a [Segment List](/docs/segment-lists) SQL query would match, without committing it to a list. Returns up to the top 10 matched rows for the columns selected. Use this to spot-check a query before creating a Segment List or committing a new version.



## OpenAPI

````yaml POST /v1/subscriber_list/~/dry_run/
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/:
    post:
      summary: Dry-run a segment query (sample rows)
      description: >-
        Preview the rows a [Segment List](/docs/segment-lists) SQL query would
        match, without committing it to a list. Returns up to the top 10 matched
        rows for the columns selected. Use this to spot-check a query before
        creating a Segment List or committing a new version.
      operationId: segment-dry-run
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - query_text
              properties:
                query_text:
                  type: string
                  description: >-
                    The SQL query to preview. Must return a `distinct_id` column
                    and reference only the `users` and `events` tables. See the
                    [Segment Lists doc](/docs/segment-lists) for the dialect,
                    available columns, and query rules.
                  example: SELECT distinct_id, active_emails FROM users LIMIT 40
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - distinct_id: 01KN7Q7NS31C01S6CR4Y9EDKPX
                        active_emails: []
                      - distinct_id: 01KN7Q7NS31C01S6CR4Y9EDKPT
                        active_emails: []
                      - distinct_id: 01KRWTYB7MX8B7HTK619XHMHJK
                        active_emails: []
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: >-
                      Up to the top 10 matched rows, each containing
                      `distinct_id` and any additional columns you selected.
                    items:
                      type: object
                      properties:
                        distinct_id:
                          type: string
                          description: The user identifier.
                      additionalProperties: true
        '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. Common causes — column
                      doesn't exist, missing `distinct_id` in the SELECT,
                      referencing a table other than `users` or `events`, or
                      missing a bounded time filter on `events.requested_at`.
                  detail:
                    type: object
                    description: Structured error detail keyed by field.
      deprecated: false
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: cURL
          label: Dry-run (sample rows)
          source: >
            curl -X POST
            "https://hub.suprsend.com/v1/subscriber_list/~/dry_run/" \
              --header 'Authorization: Bearer __YOUR_API_KEY__' \
              --header 'Content-Type: application/json' \
              --data '{
                "query_text": "SELECT distinct_id, active_emails FROM users LIMIT 40"
              }'
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.

````