> ## 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.

# Search contacts with AND/OR filters

> Like listing, with the filter as a JSON tree: a condition `{"field", "op", "value"}` or a group `{"and": [...]}` / `{"or": [...]}`, at most 3 levels deep and 20 conditions. A contact is an external person: your teammates, vendors and digital workers are not contacts and are never returned. Standard fields sit at the top level and custom fields under `fields`, keyed as GET /v1/fields?object=contact lists them. `account` holds the id of the contact's primary account, or null when it has none; `accounts` the ids of every account it is on, the primary first (empty for a contact on none). `is_key_contact` says whether it is a key contact of an account. `sentiment` is negative, neutral or positive, or null when none is recorded; `origin` is where the contact first came from, crm or statisfy, or null when not recorded (contacts from before it was). `engagements` counts the contact's engagements in the last 90 days; `last_engagement_date` is the day of its latest engagement ever, so it can be older than that window while `engagements` is 0. Dates are YYYY-MM-DD, the UTC day.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects/contact/records/search
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/objects/contact/records/search:
    post:
      tags:
        - contacts
      summary: Search contacts with AND/OR filters
      description: >-
        Like listing, with the filter as a JSON tree: a condition `{"field",
        "op", "value"}` or a group `{"and": [...]}` / `{"or": [...]}`, at most 3
        levels deep and 20 conditions. A contact is an external person: your
        teammates, vendors and digital workers are not contacts and are never
        returned. Standard fields sit at the top level and custom fields under
        `fields`, keyed as GET /v1/fields?object=contact lists them. `account`
        holds the id of the contact's primary account, or null when it has none;
        `accounts` the ids of every account it is on, the primary first (empty
        for a contact on none). `is_key_contact` says whether it is a key
        contact of an account. `sentiment` is negative, neutral or positive, or
        null when none is recorded; `origin` is where the contact first came
        from, crm or statisfy, or null when not recorded (contacts from before
        it was). `engagements` counts the contact's engagements in the last 90
        days; `last_engagement_date` is the day of its latest engagement ever,
        so it can be older than that window while `engagements` is 0. Dates are
        YYYY-MM-DD, the UTC day.
      operationId: contacts_search
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                cursor:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: '`next_cursor` from the previous page'
                  title: Cursor
                fields:
                  anyOf:
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    Custom field keys to return (comma-separated); all of them
                    when omitted
                  title: Fields
                filter:
                  anyOf:
                    - $ref: '#/components/schemas/FilterCondition'
                    - $ref: '#/components/schemas/FilterGroup'
                    - type: 'null'
                  default: null
                  description: A condition, or an 'and'/'or' group of them
                  title: Filter
                limit:
                  default: 25
                  maximum: 100
                  minimum: 1
                  title: Limit
                  type: integer
                view_id:
                  anyOf:
                    - minimum: 1
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    Only the records this saved view or segment selects (GET
                    /v1/views lists them); other filters narrow them further
                  title: View Id
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactPage'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    FilterCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        op:
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - contains
            - not_contains
            - starts_with
            - ends_with
            - exists
            - not_exists
          title: Op
          type: string
        value:
          default: null
          title: Value
      required:
        - field
        - op
      title: FilterCondition
      type: object
    FilterGroup:
      additionalProperties: false
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/FilterCondition'
                  - $ref: '#/components/schemas/FilterGroup'
              type: array
            - type: 'null'
          default: null
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/FilterCondition'
                  - $ref: '#/components/schemas/FilterGroup'
              type: array
            - type: 'null'
          default: null
          title: Or
      title: FilterGroup
      type: object
    ContactPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Contact'
          title: Data
          type: array
        has_more:
          default: false
          title: Has More
          type: boolean
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      required:
        - data
      title: ContactPage
      type: object
    Contact:
      properties:
        account:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The id of the contact's primary account; null when it has none (it
            may still be on accounts)
          title: Account
        accounts:
          description: The ids of every account the contact is on, the primary first
          items:
            type: string
          title: Accounts
          type: array
        crm_contact_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The contact's id in your CRM
          title: Crm Contact Id
        department:
          anyOf:
            - type: string
            - type: 'null'
          title: Department
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        engagements:
          default: 0
          description: Engagements in the last 90 days
          title: Engagements
          type: integer
        fields:
          additionalProperties: true
          title: Fields
          type: object
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        id:
          title: Id
          type: string
        is_key_contact:
          default: false
          title: Is Key Contact
          type: boolean
        last_engagement_date:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            YYYY-MM-DD (UTC) of the latest engagement, at any time; null when
            none
          title: Last Engagement Date
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        origin:
          anyOf:
            - enum:
                - crm
                - statisfy
              type: string
            - type: 'null'
          description: Where the contact first came from; null when not recorded
          title: Origin
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
        sentiment:
          anyOf:
            - enum:
                - negative
                - neutral
                - positive
              type: string
            - type: 'null'
          description: null when none is recorded
          title: Sentiment
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - id
      title: Contact
      type: object
  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.