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

# Preview a HubSpot account filter

> Searches companies with the filter groups: whether they are valid, how many companies they return and a few of them. Writes nothing. Calls HubSpot: a 409 when its session expired, a 429 when its API limit is used up, a 500 on an unexpected failure. A filter HubSpot cannot run comes back with is_valid false and HubSpot's reason, scrubbed of anything secret.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/hubspot/preview/account-filter
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/hubspot/preview/account-filter:
    post:
      tags:
        - integrations
      summary: Preview a HubSpot account filter
      description: >-
        Searches companies with the filter groups: whether they are valid, how
        many companies they return and a few of them. Writes nothing. Calls
        HubSpot: a 409 when its session expired, a 429 when its API limit is
        used up, a 500 on an unexpected failure. A filter HubSpot cannot run
        comes back with is_valid false and HubSpot's reason, scrubbed of
        anything secret.
      operationId: integrations_hubspot_preview_account_filter
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                filter_groups:
                  description: HubSpot filter groups to validate
                  items:
                    $ref: '#/components/schemas/HubSpotFilterGroup'
                  title: Filter Groups
                  type: array
                limit:
                  default: 5
                  description: Number of sample records to return
                  maximum: 20
                  minimum: 1
                  title: Limit
                  type: integer
              required:
                - filter_groups
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubSpotFilterPreview'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    HubSpotFilterGroup:
      description: A group of filters (AND logic within group).
      properties:
        filters:
          description: Filters in this group
          items:
            $ref: '#/components/schemas/HubSpotFilter'
          title: Filters
          type: array
      required:
        - filters
      title: HubSpotFilterGroup
      type: object
    HubSpotFilterPreview:
      description: >-
        Whether the filter groups run, how many companies they return, and a few
        of them.
      properties:
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        is_valid:
          title: Is Valid
          type: boolean
        overlaps:
          items:
            $ref: '#/components/schemas/FilterOverlap'
          title: Overlaps
          type: array
        sample_accounts:
          items:
            $ref: '#/components/schemas/AccountSample'
          title: Sample Accounts
          type: array
        total_count:
          default: 0
          title: Total Count
          type: integer
      required:
        - is_valid
      title: HubSpotFilterPreview
      type: object
    HubSpotFilter:
      description: A single HubSpot property filter.
      properties:
        operator:
          $ref: '#/components/schemas/HubSpotOperator'
          description: Filter operator
        propertyName:
          description: HubSpot property name
          title: Propertyname
          type: string
        value:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Filter value (not needed for HAS_PROPERTY)
          title: Value
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: Filter values for IN/NOT_IN operators
          title: Values
      required:
        - propertyName
        - operator
      title: HubSpotFilter
      type: object
    FilterOverlap:
      description: Accounts that the previewed filter and one overlap filter both return.
      properties:
        count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Count
        type:
          title: Type
          type: string
      required:
        - type
      title: FilterOverlap
      type: object
    AccountSample:
      description: Sample account from filter preview.
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
        - id
        - name
      title: AccountSample
      type: object
    HubSpotOperator:
      description: HubSpot filter operators.
      enum:
        - EQ
        - NEQ
        - LT
        - LTE
        - GT
        - GTE
        - CONTAINS_TOKEN
        - NOT_CONTAINS_TOKEN
        - HAS_PROPERTY
        - NOT_HAS_PROPERTY
        - IN
        - NOT_IN
      title: HubSpotOperator
      type: string
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.