Set Up Search Integration

Discover searchable resources, run structured or lexical queries, and page through results.

Use POST /v1/search for structured discovery across authorized resources. The same endpoint also accepts a lexical term for search boxes across locations, documents and indexed document text.

Discover the query catalogue

Send a versioned query object. The catalogue lists the available resource kinds and the filters, text modes, sort fields, projections and aggregates each kind supports. A kinds list can narrow the catalogue.

{
  "query": {
    "version": 1,
    "operation": "describe",
    "kinds": ["location"]
  }
}

Run a structured query

This request finds locations whose title contains “school” and returns up to ten hits ordered by title. The count is requested separately from the hit limit.

{
  "query": {
    "version": 1,
    "operation": "search",
    "kinds": ["location"],
    "filter": {
      "field": { "name": "title", "operator": "contains", "value": "school" }
    },
    "sort": [{ "field": "title", "direction": "asc" }],
    "aggregates": [{ "name": "locations", "operator": "count" }],
    "limit": 10
  }
}
  • Scope to organizations, clusters, locations, projects or libraries with the ID fields advertised for the selected kinds inside query.scope. Resource permissions and credential scope apply before matching and counting.
  • Join supported predicates with all, any or not. A node contains one predicate form. The catalogue lists the valid operators and value types for each field.
  • Text matching uses the selected kind's advertised mode. Semantic scores, when available, express similarity to the query. Use structured filters for exact constraints.
  • Use hits[].url when a result includes a private PixAtlas link. The recipient needs their own access.
  • Check coverage and complete before drawing a conclusion from an empty page or aggregate. Requested kinds or modes may be unsupported or temporarily unavailable. Encrypted message bodies that the server cannot read are outside searchable coverage.

Rank buildings by readable documents

Use one query to filter and rank buildings across the caller's authorized scope. The documentCount field counts readable current non-image, non-video library files in the building and its projects. A building with no readable matching files has a count of zero. The count uses the same document permissions as document search, including folder paths. Photos, videos and readable superseded versions have their own query options. When you only need building metadata, select the relevant fields in projection to skip document counting.

Building document counts and document, photo, and video searches use a work limit of 250,000 authorized library file revisions. If the applicable library scope exceeds that limit, coverage reports documentAuthorityWorkLimit for the affected source. Location, model and report searches also bound each applicable location or organization permission set to 250,000 IDs; exceeding that bound reports relationshipAuthorityWorkLimit. These limits report incomplete coverage instead of silently truncating matches or counts.

This query returns the five buildings with the most readable documents among buildings that have a readable current model with 3D geometry and no readable report for the specified work dates. The end date is exclusive.

The has3dContent filter checks for a current, uploaded, non-empty model output with a recognized mesh, point-cloud, or splat geometry format or entry point. It uses file metadata. Storage availability and viewer rendering are checked when the model is opened.

{
  "query": {
    "version": 1,
    "operation": "search",
    "kinds": ["location"],
    "filter": {
      "all": [
        {
          "relationship": {
            "name": "models",
            "operator": "any",
            "filter": { "field": { "name": "has3dContent", "operator": "eq", "value": true } }
          }
        },
        {
          "relationship": {
            "name": "reports",
            "operator": "none",
            "filter": {
              "field": {
                "name": "businessDate",
                "operator": "during",
                "value": ["2026-10-01", "2026-11-01"]
              }
            }
          }
        }
      ]
    },
    "sort": [
      { "field": "documentCount", "direction": "desc" },
      { "field": "title", "direction": "asc" }
    ],
    "projection": ["documentCount"],
    "limit": 5
  }
}

Add geography to the same query to restrict buildings by radius or area. For example, { "operator": "radius", "center": { "latitude": 48.26, "longitude": 11.43 }, "radiusMeters": 10000 } limits the results to ten kilometres from the supplied coordinates. A nearest search defaults to distance order. Text queries default to relevance and other queries default to title and stable identity. Specify a date sort when the request calls for the latest or oldest records.

Group document, model or report matches by locationId to count records per building after applying filters. To find reports themselves, select report and apply the date predicate directly to businessDate.

To return the five file types with the most documents, use a grouped count. Each group is calculated across all matching documents before the group limit applies. Use key, value, or missingCount to sort groups. Missing values sort last in either direction.

{
  "query": {
    "kinds": ["document"],
    "aggregates": [{
      "name": "topFileTypes",
      "operator": "count",
      "groupBy": "contentType",
      "sort": [{ "field": "value", "direction": "desc" }],
      "limit": 5
    }]
  }
}

For stored document text, request kinds: ["documentContent"] with text: { "mode": "lexical", "value": "roof survey" }. Matching current documents carry one passage excerpt and, when available, a link to its page. Index and extraction coverage can be incomplete.

Some deployments enable semantic and hybrid document passage matching. These modes appear in the catalogue when configured. Semantic matches use cosine similarity against passages embedded with the same model and dimensions as the query. Hybrid matching also includes literal text matches. Use text.minimumScore to set the semantic threshold for an individual query. Embedding backfill can leave coverage partial.

Search groups verified representations of the same record, such as an uploaded file and its matching passage. Request expandRepresentations: true to receive the matching representations individually.

When the visual photo index is configured, kinds: ["visualPhoto"] with text: { "mode": "semantic", "value": "flat roof skylights" } queries photos by what they show. Visual results carry a similarity score and the applied threshold in standard-deviation units. This mode supports an optional single organization and single location in scope. Results use bounded approximate neighbours and have partial coverage.

To continue, send a new request containing query.version, query.operation: "page" and the returned query.cursor. Cursors are opaque and tied to the original search and caller. A change in access or expiry can require a fresh search.

Timeouts, background searches and retries

A search is stored durably before execution. Omitted execution, auto and immediate attempt execution and initial result authorization within a ten-second inline budget. If that budget expires, the response is HTTP 202 with status: "pending" and the same searchId. The search is preserved for background execution; this is not a failed search or an empty result. pending can also mean that results are saved but their retrieval authorization did not finish within the inline budget. Request execution: "background" to skip the inline attempt.

Poll with the same credential and returned ID:

{"query":{"version":1,"operation":"status","searchId":"<returned-search-id>"}}
StatusCaller action
queued, running, pending (HTTP 202)Wait and poll the same searchId. Do not submit a replacement search.
readyConsume results and aggregates; use the returned cursor for further pages.
partial, incompleteRead coverage and complete before answering. Missing coverage is not proof of absence.
failedRead the error. A terminal workLimit requires a narrower query; repeating the same work will not raise the budget.
cancelled, invalidated, unavailableStop polling. Cancellation, changed access, expiry or a mismatched credential may prevent retrieval. Start a new search only when appropriate.
invalidCorrect the indicated field. Use a new retry key when changing the query.

Space polls out with bounded backoff rather than a tight loop. A network timeout while polling does not cancel the search: repeat status with the same ID. Only operation: "cancel" explicitly cancels a search:

{"query":{"version":1,"operation":"cancel","searchId":"<returned-search-id>"}}

Generate and retain a UUID requestId before submitting the initial search, especially for unreliable connections:

{
  "query": {
    "version": 1,
    "operation": "search",
    "requestId": "88fdebc4-6837-43c3-a88c-38b8f6fc4f8b",
    "execution": "auto",
    "kinds": ["document"],
    "projection": ["title"],
    "limit": 10,
    "aggregates": [{"name": "documents", "operator": "count"}]
  }
}

If the connection drops before a response arrives, resend the identical query with the same requestId and credential. An admitted search returns its existing ID/state instead of creating duplicate work. If admission never completed, the retry can create it. A changed query with that key returns requestIdConflict. The key is valid only for search, is scoped to the credential, and is retained with the snapshot; it is not permanent idempotency after expiry and cleanup. Without a known searchId or a preassigned requestId, a lost response cannot be reliably recovered by the caller. Do not treat a transport timeout as evidence that the original search was never accepted.

On handoff the inline database attempt is cancelled and unwound, then the same durable search is queued again; this is not a suspended SQL transaction. If immediate handoff cannot be persisted, the worker can recover the existing claim after its five-minute lease expires. A hard worker execution limit of four minutes and the snapshot/work budgets still apply. Background execution does not raise those limits or retry terminal failures forever. Permissions are checked again during background execution and retrieval.

The MCP search tool uses this same query object, statuses and recovery flow. Agents should retain the retry key and search ID, poll pending work, and tell the user when it is still running. They should not replace a pending query with hundreds of per-building or per-file requests.

Efficient MCP discovery

The MCP search tool can query all eligible organizations without listing them first. Omit scope for that authorized scope, or supply known IDs to narrow it. get_connection_context answers account and consent questions; it is not a prerequisite for resource searches. Collection tools remain useful for explicitly browsing a selected organization, location or document library.

User requestSearch shape
Find a building by name or addresslocation, with an any filter over title and the advertised address field. find_places also supports tolerant address spelling.
Latest structured reportsreport, sorted by businessDate descending.
Buildings with the most documentslocation, sorted by documentCount descending.
Document totals by buildingdocument, with a count aggregate grouped by locationId.
A phrase inside a documentdocumentContent, with an advertised text mode. Metadata search does not search document bodies.

Grouped results contain IDs. Resolve their labels together using a second search for the appropriate kind with filter.field: {name: "id", operator: "in", value: [/* IDs */]}. Each in predicate accepts at most 64 values. This avoids one detail request per group. A result's url already provides its private PixAtlas link.

Keep kinds, filters and projection specific. limit controls the returned page, not all the work required to match, rank and count records. A partial response describes its coverage; it does not require enumerating every library to compensate.

Specialized tools retain additional coverage: list_site_reports also includes PDF-only reports and worker-hour details, while find_documents supports derived document kinds and comment matching. Choose those tools when the request needs that coverage rather than inferring it from a narrower search result.

Snapshot limits and source coverage

The catalogue publishes the query limits. A result page defaults to 25 hits and can contain at most 100. The complete saved match set is bounded to 20,000 hits and 16 MiB, expires after 15 minutes, and supports up to 1,000 aggregate groups. A user can retain at most 32 active searches across credentials. A workLimit response requires a narrower query; it is not an exhaustive partial answer. snapshotLimit means an earlier search must be cancelled or expire before another can start.

Saved results are bound to the caller's credential and consent scope. Retrieval checks current permissions for the complete saved set, including representations hidden by grouping. A changed authority or protected resource context invalidates the saved hits and aggregates together. Refreshing creates a new evaluation time and may produce different results.

Use completeness: "strict" when a partial answer is insufficient. Strict mode returns no hits or aggregates if the requested sources cannot prove completeness. This is particularly relevant to these current boundaries:

SourceCoverage
Models and library filesCurrent records by default; explicit history mode includes readable superseded records. Recoverable-deleted records are not supported.
Structured reportsCurrent canonical revisions, work dates and recorded total person-hours. Individual worker attribution is not inferred from names or totals.
FoldersExplicit stored folders. Derived ancestor paths are not included.
ChatAuthorized room metadata. Global message bodies are unavailable, including encrypted messages.
NotificationsThe caller's notifications without resource origins. Origin-linked notification content is not included.
WorkflowsAuthorized run metadata. Workflow definitions are not covered.
Document passages and visual photosVerified current indexed sources; extraction, embedding and approximate-neighbour coverage can be partial.
Named geographic anchorsAccessible Atlas location names and, where permitted, addresses. External geocoding is not performed. Ambiguous matches require a more precise anchor.

Unsupported field, relationship, history or text combinations produce validation errors. Discover capabilities with describe rather than assuming that every kind has every field.

Structured validation failures return HTTP 400. The response's errors list, when present, includes a machine-readable code, a query path and a message. Use the catalogue to check the supported combination for the affected kind.

The OpenAPI HTTP 200 entry records the established lexical response schema for generated clients. For a request with query, its x-pixservice-structured-schema extension identifies the applicable response schema.

Send top-level term and optional scope for the existing lexical response. A structured request uses the separate query object.

Query suggestions

Call POST /v1/search/suggestions with the current partial term:

{
  "term": "inspection rep",
  "scope": {
    "includeShared": true
  }
}

Use the returned suggestion list to drive autocomplete UI while typing.

Call POST /v1/search with the final term:

{
  "term": "inspection report retaining wall",
  "scope": {
    "includeShared": true
  }
}

Render each result using:

  • searchId from the top-level response for later telemetry
  • title as the primary label
  • subtitle as secondary context
  • snippet as the preview excerpt
  • source.pageNumber and source.chunkIndex when you want to show where a document preview came from

Handle lexical result types

Common result types:

  • Document
  • DocumentContent
  • Location
  • Cluster
  • SpatialMetadata

Recommended UI behavior:

  • show document previews inline when snippet is present
  • show page context when source.pageNumber is set
  • treat DocumentContent results as deep links into a document preview surface
  • treat Document results as the parent document card, optionally with preview text

Report lexical search interactions

After rendering results, keep the returned searchId and send follow-up interactions to POST /v1/search/interactions.

Example payload:

{
  "searchId": "4d20d178-22ce-4df2-a7ae-4ef2b4d92f89",
  "resultId": "document:8cfcbca40b3646f8a01f603fd1ae0677",
  "action": "DocumentOpen",
  "resultType": "Document",
  "rankPosition": 2,
  "dwellMilliseconds": 1800
}

Use action: "QueryReformulated" with reformulatedTerm when the user changes the search after seeing the results.

Trigger Indexing

Admin users can control indexing with:

  • POST /v1/search/index/documents/{documentId} to reindex one document
  • POST /v1/search/index/backfill to queue a full backfill
  • POST /v1/search/index/assets/backfill to rebuild the asset index
  • GET /v1/search/index/status to inspect indexing task status

If a document is missing from search after upload or reprocessing, reindex that document first. Use the backfill endpoint when rolling out search to an existing corpus.

On this page