# Full-text search policy documents

Operation ID: `graph.searchPolicyDocuments`

Full-text search across medical-policy and guideline documents. Backed by Algolia (metadata + truncated excerpt) with a Neo4j fallback. ?q= is required.

## Public method

`searchPolicyDocuments`

Signature: `graph.searchPolicyDocuments(query)`

Return type: `Promise<PolicyDocument[]>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /documents/search`

## Path parameters

None.

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `limit` | `integer` | No |  |  | `20` | No |  |
| `network_id` | `string` | No |  |  |  | No | Filter by insurance network ID |
| `offset` | `integer` | No |  |  | `0` | No |  |
| `q` | `string` | Yes |  |  |  | No | Full-text search query |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`SearchPolicyDocumentsResponse`](../models/SearchPolicyDocumentsResponse.md) | application/json | Successful Response |

## Success response examples

### 200

```json
[
  {
    "bytes": 37881,
    "char_count": 4068,
    "content": "Synthetic policy content",
    "content_excerpt": "Synthetic policy excerpt",
    "content_type": "application/pdf",
    "extract_error": null,
    "extracted_at": "2026-07-20T20:04:39+00:00",
    "filename": "policy-example.pdf",
    "id": "306641dd229c8f3209c88ac9c58e303852f9d1ed",
    "network_id": "68069",
    "page_count": 2,
    "parent": "Example Health Plan",
    "payer": "Ambetter",
    "payer_key": "example-health-plan",
    "policy_number": "CP.MP.247",
    "policy_type": "medical policy",
    "score": 1.0153071880340576,
    "sha256": "ea29f2496db1bf3b0b3d39841e970d1045e5b8ba18b28b9371f9c45837315904",
    "source_page": "https://example.com/policies",
    "source_url": "https://www.ambetterhealth.com/content/dam/centene/absolute-total-care/solutions/clinical-policies/CP.MP.247.pdf",
    "title": "CP.MP.247",
    "truncated": false,
    "type": "medical policy",
    "wasabi_key": "policies/policy-example.pdf"
  }
]
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | The request was invalid — a required parameter was missing or a filter value was not recognized |
| `401` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `500` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Internal server error |

## Error examples

### 400 — A required query parameter was missing or a filter value was not recognized (sanitized example)

```json
{
  "error": "Bad request"
}
```

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const query = {
  "limit": 20,
  "network_id": "<NETWORK_ID>",
  "offset": 0,
  "q": "<Q>"
};

const result = await graph.searchPolicyDocuments(query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-graph.health.cloud/documents/search?limit=20&network_id=%3CNETWORK_ID%3E&offset=0&q=%3CQ%3E'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
