# Search document summaries

Operation ID: `graph.searchDocumentSummaries`

Search the Document Summaries index by free-text phrase and/or document type. When rag=true in the request body, runs retrieval-augmented generation instead of returning the raw result set.

## Public method

`searchDocumentSummaries`

Signature: `graph.searchDocumentSummaries(request)`

Return type: `Promise<DocumentSummarySearchResponse | GraphRagResponse<DocumentSummaryRagCitation>>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /graph/document-summaries/search`

## Path parameters

None.

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`SearchDocumentSummariesRequest`](../models/SearchDocumentSummariesRequest.md) | No |  |  |  | No |  |

Request model: [`SearchDocumentSummariesRequest`](../models/SearchDocumentSummariesRequest.md)

## Request example

```json
{
  "doc_type": "medical_policy",
  "limit": 5,
  "offset": 0,
  "phrase": "diabetes",
  "rag": false
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`SearchDocumentSummariesResponse`](../models/SearchDocumentSummariesResponse.md) | application/json | Document search or grounded RAG answer |

## Success response examples

### 200

```json
{
  "documents": [
    {
      "doc_id": "document-example-001",
      "doc_type": "medical_policy",
      "published_date": "2026-01-15T00:00:00Z",
      "score": 0.97,
      "source_url": "https://example.com/resource",
      "summary": "Synthetic summary of diabetes coverage guidance.",
      "title": "Diabetes Coverage Guidance"
    }
  ],
  "request": {
    "doc_type": "medical_policy",
    "limit": 5,
    "offset": 0,
    "phrase": "diabetes",
    "rag": false
  },
  "total": 1
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `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

### 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";
import type { DocumentSummarySearchRequest } from "@healthcloudai/hc-sdk";
```

```ts
const request = {
  "doc_type": "medical_policy",
  "limit": 5,
  "offset": 0,
  "phrase": "diabetes",
  "rag": false
};

const result = await graph.searchDocumentSummaries(request);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"doc_type":"medical_policy","limit":5,"offset":0,"phrase":"diabetes","rag":false}' \
  'https://dev-api-graph.health.cloud/graph/document-summaries/search'
```

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