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

# Search Query

> Run a search query. Provide exactly one query source: query, simple_filters, filters, parsed_query, or search_id. For pagination, pass cursor alone.



## OpenAPI

````yaml https://api.sixtyfour.ai/openapi.json post /search/query
openapi: 3.1.0
info:
  title: Sixtyfour API
  description: >-
    Intelligence API for People and Entities. Deploy AI agents that investigate,
    resolve identities, map relationships, and surface risk signals
  contact:
    name: Sixtyfour
    url: https://sixtyfour.ai/
    email: support@sixtyfour.ai
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.sixtyfour.ai
    description: Production
security: []
tags:
  - name: Enrichment
    description: Find and enrich emails, phones, and LinkedIn for people and companies.
  - name: org-chart
    description: Discover people inside a company and build org charts.
  - name: Search
    description: Run deep and filter searches over Sixtyfour's data.
  - name: Workflow
    description: Create, run, and manage enrichment workflows.
  - name: Workflow Schedules
    description: Create and manage recurring schedules for workflows.
  - name: Account
    description: Manage and inspect your account and credit balance.
  - name: Intelligence
    description: Verify identity attributes such as age using high-tier OSINT research.
  - name: Atlas
    description: >-
      Read your Atlas investigations: attribution graph, workspace files,
      reports, and exports.
paths:
  /search/query:
    post:
      tags:
        - Search
      summary: Search Query
      description: >-
        Run a search query. Provide exactly one query source: query,
        simple_filters, filters, parsed_query, or search_id. For pagination,
        pass cursor alone.
      operationId: search_query_endpoint_search_query_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchQueryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilterSearchResponse'
        '400':
          description: Request was rejected by the route's validation rules.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Invalid request body
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Invalid API key
        '402':
          description: >-
            Insufficient credits or no active subscription for this
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Insufficient API credits
        '403':
          description: Forwarded user_id does not belong to caller's organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Forwarded user_id does not belong to your organization.
        '404':
          description: Search task or export file not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Search not found or has no parsed_query.
        '409':
          description: Export workflow already running for this search.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Export workflow is already running for this search.
        '422':
          description: Request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Rate limit exceeded
        '500':
          description: Unexpected server error. Retry with backoff.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Internal server error
        '502':
          description: Upstream search backend returned an error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: 'NL upstream transport error: connection reset by peer'
        '503':
          description: Search backend is not configured or unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Company search backend endpoint is not configured
        '504':
          description: Upstream search backend timed out.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: Field values request timed out
components:
  schemas:
    SearchQueryRequest:
      properties:
        simple_filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Simple Filters
          description: MongoDB-style filters; the API translates them to DSL.
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
          description: Raw OpenSearch DSL filters.
        parsed_query:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parsed Query
          description: Structured filter set returned by a previous search.
        search_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Id
          description: >-
            Search history ID returned by a previous search. Replays only the
            query shape; pass exclusions again on this request if they should
            apply.
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: >-
            Natural-language query. Mutually exclusive with simple_filters /
            filters / parsed_query / search_id. Supported for people and company
            search.
        query_label:
          anyOf:
            - type: string
              maxLength: 50000
            - type: 'null'
          title: Query Label
          description: >-
            Display label stored with a structured search. It does not affect
            the query or results. Oversized labels are truncated.
        persist_history:
          type: boolean
          title: Persist History
          description: >-
            Set false to skip the canonical search-history write for this search
            (e.g. a page load that replays a search another surface already
            recorded). Replays via search_id never write history regardless.
          default: true
        from_offset:
          anyOf:
            - type: integer
              maximum: 10000
              minimum: 0
            - type: 'null'
          title: From Offset
          description: >-
            Company-mode page offset for page-numbered navigation (mirrors
            OpenSearch `from`). Offset pages return no cursor and are not
            persisted to history; page one (offset 0 or omitted) behaves exactly
            as before. People mode rejects this field.
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Cursor
          description: Opaque pagination cursor returned by a previous response.
        mode:
          type: string
          enum:
            - people
            - company
          title: Mode
          description: Search mode; inferred from DB when using `search_id`.
          default: company
        page_size:
          type: integer
          maximum: 100
          minimum: 1
          title: Page Size
          description: >-
            Maximum number of results per page (1-100). Pages may contain fewer
            rows while more results remain (e.g. with exclusion filtering); rely
            on `has_more`/`next_cursor`, never on page fullness.
          default: 10
        max_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Results
          description: >-
            Maximum number of results to return across pages. Omit to get the
            default for your credential: 1000 for API keys, the platform ceiling
            for signed-in sessions. Values above your ceiling are rejected.
        output_shape:
          type: string
          enum:
            - raw
            - workflow
          title: Output Shape
          description: >-
            Return raw OpenSearch rows or canonical workflow LEAD/COMPANY rows.
            The selected shape is retained by cursor continuations.
          default: raw
        selected_company_names:
          anyOf:
            - items:
                type: string
                maxLength: 500
                minLength: 1
              type: array
              maxItems: 1000
            - type: 'null'
          title: Selected Company Names
          description: >-
            Platform-only exact company selections. The backend resolves names
            to company IDs instead of trusting client-supplied OpenSearch IDs.
            Excess hints are ignored; parsed-query name matching still applies.
        selected_company_ids:
          anyOf:
            - additionalProperties:
                type: string
              propertyNames:
                maxLength: 500
                minLength: 1
              type: object
              maxProperties: 1000
            - type: 'null'
          title: Selected Company Ids
          description: >-
            Platform-only name -> company ID map from autocomplete. Each pair is
            verified against the company index before use; unverified pairs fall
            back to name resolution. Disambiguates companies sharing a name.
            Excess hints are ignored; parsed-query name matching still applies.
        exclude_public_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 50000
            - type: 'null'
          title: Exclude Public Ids
          description: >-
            People-mode inline identifiers to exclude from results, applied as a
            post-filter. Accepts LinkedIn public IDs or profile URLs. For
            company searches, use `exclude_entity_ids`. Max 1000 for API
            requests, 50000 for platform requests.
        exclude_entity_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 50000
            - type: 'null'
          title: Exclude Entity Ids
          description: >-
            Inline identifiers to exclude from results, applied as a
            post-filter. People mode: LinkedIn public IDs or profile URLs.
            Company mode: numeric LinkedIn company IDs, company URLs/slugs, or
            exact website domains (values that resolve to no or multiple
            companies are ignored). Max 1000 for API requests, 50000 for
            platform requests.
        exclude_list_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 10
            - type: 'null'
          title: Exclude List Ids
          description: >-
            Saved exclusion-list IDs to apply as a post-filter. Each list's
            entity type must match the search mode (person lists for people
            searches, company lists for company searches). Max 5 (10 for
            organizations with extended exclusion limits).
        expand_structured_location:
          type: boolean
          title: Expand Structured Location
          description: >-
            Expand a `parsed_query` location by radius. Off by default: only the
            `query` (NL) branch expanded before, so existing callers keep their
            result sets. `location_expansion_enabled` still gates the NL branch.
          default: false
        location_expansion_enabled:
          type: boolean
          title: Location Expansion Enabled
          description: >-
            Expand the location filter to nearby areas via PostGIS radius on the
            `query` (NL) branch. For `parsed_query`, use
            `expand_structured_location`.
          default: true
        location_expansion_radius_miles:
          type: integer
          maximum: 200
          minimum: 5
          title: Location Expansion Radius Miles
          description: >-
            Radius (miles) for PostGIS location expansion. Ignored when
            expansion is disabled.
          default: 10
        lineage:
          anyOf:
            - $ref: '#/components/schemas/SearchLineage'
            - type: 'null'
          description: >-
            Platform-only. The saved search this one was derived from. Stored
            with the new search so the agent can see the chain behind a live
            view; ignored on cursor and search_id replays.
      type: object
      title: SearchQueryRequest
      description: >-
        Unified search query request — replaces both /start-filter-search and
        /browse.
    FilterSearchResponse:
      properties:
        search_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Id
          description: >-
            Search history ID returned by a previous search. Replays only the
            query shape; pass exclusions again on this request if they should
            apply.
        resource_handle_id:
          type: string
          title: Resource Handle Id
          description: Legacy export handle. Empty for company direct-filter mode.
          default: ''
        csv_download_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Csv Download Url
          description: Signed URL to download results as CSV.
        json_download_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Json Download Url
          description: Signed URL to download results as JSON.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Cursor to fetch the next page; null when exhausted.
        cursor_expires_in_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cursor Expires In Seconds
          description: Seconds until `next_cursor` expires.
        request_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Request Duration Ms
          description: Server-side request duration in milliseconds.
        has_more:
          type: boolean
          title: Has More
          description: >-
            True when another page is available via `next_cursor`. Always
            continue via the cursor; a short or empty page does NOT mean the
            results are exhausted.
          default: false
        page_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Size
          description: >-
            Maximum number of results per page (1-100). Pages may contain fewer
            rows while more results remain (e.g. with exclusion filtering); rely
            on `has_more`/`next_cursor`, never on page fullness.
        page_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Count
          description: >-
            Number of results in this response page. May be less than
            `page_size` (down to 0) while `has_more` is true, e.g. when
            exclusion filtering is active.
        page_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Number
          description: 1-based page number (company pagination).
        total_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Pages
          description: Final total page count; omitted while `has_more` is true.
        max_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Pages
          description: Upper bound on pages based on max_results and page_size.
        max_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Results
          description: >-
            Effective maximum rows this search may return across pages after
            applying the request and credential limits.
        remaining_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Remaining Results
          description: Rows still available under max_results after this page.
        download_expires_in_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Download Expires In Seconds
          description: Seconds until the download URLs expire.
        total_results:
          type: integer
          title: Total Results
          description: Rows returned so far (cumulative for company pagination).
        total_available:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Available
          description: >-
            Exact total matches across pages; people-mode only. Null when
            unknown — including when exclusions are applied by post-filter scan
            rather than in the query, where the match count would overstate the
            eligible results. Never a capped or approximate figure.
        total_available_lower_bound:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Available Lower Bound
          description: >-
            Minimum total matches when the search stopped counting at its cap
            (50,000), so total_available is null. Null when the total is exact
            or no reliable lower bound is available.
        charge_credits:
          anyOf:
            - type: number
            - type: 'null'
          title: Charge Credits
          description: >-
            Credits charged for this page: 0.1 credit per result returned for
            billed callers, 0 when this call was not billed.
        output_shape:
          type: string
          enum:
            - raw
            - workflow
          title: Output Shape
          description: >-
            Shape of the rows in `results`. Echoed because cursor continuations
            reject `output_shape` on the request.
          default: raw
        exported_count:
          type: integer
          title: Exported Count
          description: Legacy export count; always 0 for company direct-filter mode.
          default: 0
        results:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Results
          description: Rows returned for the current page.
        parsed_query:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parsed Query
          description: >-
            Structured filter set echoed back; round-trippable into a follow-up
            request.
        natural_language_query:
          anyOf:
            - type: string
            - type: 'null'
          title: Natural Language Query
          description: Original natural-language query echoed verbatim, if any.
        company_filter_truncated:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Company Filter Truncated
          description: >-
            Present when company filters matched more companies than the
            resolver expansion cap. "total_matched": positive filters truncated
            — results cover people at the largest matching employers only.
            "excluded_total_matched": a not-filter truncated — only the largest
            matching employers are excluded, so people at smaller excluded
            companies may still appear.
        engine:
          anyOf:
            - type: string
              enum:
                - opensearch
                - clickhouse
            - type: 'null'
          title: Engine
          description: Search engine that served this page. Absent on legacy responses.
        plan:
          anyOf:
            - type: string
            - type: 'null'
          title: Plan
          description: >-
            Retrieval plan the engine ran: exact, structured, filtered_semantic,
            semantic or lookalike. ClickHouse only.
        cohort_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cohort Size
          description: >-
            Exact number of rows the filters matched before ranking. ClickHouse
            only.
        ranking_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Ranking Policy
          description: >-
            Version of the ranking policy the page was ranked with. ClickHouse
            only.
        ranking_strategy:
          anyOf:
            - type: string
            - type: 'null'
          title: Ranking Strategy
          description: >-
            Execution strategy the ranked plan chose from the scan estimate and
            cohort size: range_exact, range_two_stage, vectors_in or
            vectors_open. ClickHouse ranked plans only.
        unmet_constraints:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Unmet Constraints
          description: >-
            Parsed-query fields the engine had no column for and did not apply.
            ClickHouse only.
      type: object
      required:
        - total_results
      title: FilterSearchResponse
      description: Response for a completed filter search.
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      example:
        detail:
          - loc:
              - body
              - target_company
              - domain
            msg: Field required
            type: missing
            input: null
            ctx: {}
    SearchLineage:
      properties:
        parent_search_id:
          type: string
          maxLength: 64
          minLength: 1
          title: Parent Search Id
        relation:
          $ref: '#/components/schemas/LineageRelation'
          default: manual_edit
      type: object
      required:
        - parent_search_id
      title: SearchLineage
    ValidationError:
      title: ValidationError
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
          description: Path to the field that failed validation.
          example:
            - body
            - target_company
            - domain
        msg:
          type: string
          description: Human-readable error message.
          example: Field required
        type:
          type: string
          description: Error code (e.g. 'missing', 'value_error').
          example: missing
        input:
          description: The offending input value (any type, may be null).
          nullable: true
          example: null
        ctx:
          type: object
          description: Optional error context.
          additionalProperties: true
          example: {}
    LineageRelation:
      type: string
      enum:
        - manual_edit
      title: LineageRelation
      description: How a search was derived from its parent.

````

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