---
title: "Search Procurement Guidelines"
method: POST
path: "/api/internal/procurement-guidelines/search"
tags: ["Procurement Guidelines"]
---

# Search Procurement Guidelines

`POST /api/internal/procurement-guidelines/search`

Search procurement guideline chunks via Postgres FTS.

At least one of ``institution_ids`` or ``query`` must be supplied —
chunks table is 140K+ rows and we don't allow unbounded scans.

With ``query``: results ranked by ``ts_rank_cd``. Without ``query``
(institution-scoped browse): results sorted by document date descending.

``query`` accepts a websearch-style string (same syntax as RFP / Grant /
Meeting Minute / Budget search): bare words for stemmed match,
``"phrase"`` for exact phrase, ``OR``, ``-word`` for exclude.

Set ``group_by_document=true`` to collapse to the highest-scoring chunk
per document.

Semantic / LLM-synthesized answers are not in scope here — use the
existing ``/v3/rag/query`` endpoint for that. This endpoint returns raw
evidence rows for downstream reasoning.

## Request body

- ProcurementGuidelineSearchFilters — Search filters for procurement guideline chunks. The ``query`` field accepts a websearch-style query string evaluated against the chunks' ``text_search_fts`` column (english config — stemming enabled). Same syntax as RFP / Grant / Meeting Minute / Budget search. Semantic search lives on the existing ``/v3/rag/query`` endpoint (returns synthesized prose). This endpoint returns raw matching chunks for callers who want to reason over evidence directly. At least one of ``institution_ids`` or ``query`` must be supplied — the chunks table is 140K+ rows and we reject fully unbounded scans.
  - `query` string, nullable
  - `institution_ids` string[], nullable
  - `states` string[], nullable
  - `source_tables` string[], nullable
  - `document_date_after` string, date, nullable
  - `document_date_before` string, date, nullable
  - `group_by_document` boolean
  - `offset` integer
  - `limit` integer

## Response `200`

Successful Response

- PaginatedResponseProcurementGuidelineChunkResponse
  - `results` ProcurementGuidelineChunkResponse[], required
    - `chunk_id` integer, required
    - `document_id` integer, required
    - `institution_id` string, nullable
    - `institution_name` string, nullable
    - `institution_state` string, nullable
    - `institution_type` string, nullable
    - `document_date` string, date, nullable
    - `document_title` string, nullable
    - `document_url` string, nullable
    - `document_created_at` string, date-time, nullable
    - `text` string, required
    - `relevance` number, required
    - `other_matching_chunks_in_document` integer, nullable
  - `total` integer, required
  - `offset` integer, required
  - `limit` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.net/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/revisions/85804e68d86d/schema)
