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

# Post v1segmentspreview



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/segments/preview
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/segments/preview:
    post:
      tags:
        - Segments
      operationId: segments.preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - numbers
                    - emails
                query:
                  type: object
                  example:
                    condition: AND
                    rules:
                      - field: clicked_count
                        operator: greater
                        value: 0
                      - field: country_id
                        operator: equal
                        value: 225
                      - condition: OR
                        rules:
                          - field: leads_count
                            operator: equal
                            value: 1
                          - field: sales_count
                            operator: equal
                            value: 1
                      - field: date_created
                        operator: equal
                        value: '2023-07-05'
                  additionalProperties:
                    type: string
                page:
                  type: integer
                  minimum: 1
                per_page:
                  type: integer
                  minimum: 1
                  maximum: 100
              required:
                - type
                - query
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      total:
                        type: integer
                      rows:
                        type: array
                        items:
                          $ref: '#/components/schemas/ContactSmsResource'
                      stats:
                        type: object
                        description: >-
                          only for admins (elapsed, rows_read, bytes_read) (null
                          for users)
                        additionalProperties:
                          type: string
                      sql:
                        type: string
                        description: only for admins (null for users)
                    required:
                      - total
                      - rows
                      - stats
                      - sql
                  - type: string
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ContactSmsResource:
      type: object
      properties:
        team_id:
          type: string
        phone_normalized:
          type: string
        contact_id:
          type: string
        foreign_id:
          type: string
        last_sent:
          type: string
        last_clicked:
          type: string
        sent_count:
          type:
            - integer
            - 'null'
        clicked_count:
          type:
            - integer
            - 'null'
        leads_count:
          type:
            - integer
            - 'null'
        sales_count:
          type:
            - integer
            - 'null'
        network_brand:
          type: string
          description: '''profit_sum'' => $this->resource[''profit_sum''],'
        network_id:
          type: string
        network_reason:
          type: string
        phone_is_good:
          type: string
        phone_is_good_reason:
          type: string
        name:
          type: string
        country_id:
          type: string
        state_id:
          type: string
        state_id_reason:
          type: string
        custom1_str:
          type: string
        custom2_str:
          type: string
        custom3_str:
          type: string
        custom4_str:
          type: string
        custom5_str:
          type: string
        custom1_int:
          type: string
        custom2_int:
          type: string
        custom3_int:
          type: string
        custom4_int:
          type: string
        custom5_int:
          type: string
        custom1_dec:
          type: string
        custom2_dec:
          type: string
        custom1_datetime:
          type: string
        custom2_datetime:
          type: string
        custom3_datetime:
          type: string
        custom4_datetime:
          type: string
        custom5_datetime:
          type: string
        meta:
          type:
            - string
            - 'null'
        date_created:
          type: string
        date_updated:
          type: string
      required:
        - team_id
        - phone_normalized
        - contact_id
        - foreign_id
        - last_sent
        - last_clicked
        - sent_count
        - clicked_count
        - leads_count
        - sales_count
        - network_brand
        - network_id
        - network_reason
        - phone_is_good
        - phone_is_good_reason
        - name
        - country_id
        - state_id
        - state_id_reason
        - custom1_str
        - custom2_str
        - custom3_str
        - custom4_str
        - custom5_str
        - custom1_int
        - custom2_int
        - custom3_int
        - custom4_int
        - custom5_int
        - custom1_dec
        - custom2_dec
        - custom1_datetime
        - custom2_datetime
        - custom3_datetime
        - custom4_datetime
        - custom5_datetime
        - meta
        - date_created
        - date_updated
      title: ContactSmsResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````