# Search individual-market health plans by location

Operation ID: `connectors.cmsSearchHealthPlans`

Search individual-market health plans by location. resolve the county FIPS from the ZIP when not supplied, build the search body, POST to /plans/search, and return the mapped plans.

## Public method

`searchHealthPlans`

Signature: `connectors.cms.createClient(config).searchHealthPlans(body)`

Return type: `Promise<CmsSearchHealthPlansResult>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /connectors/cms/search-health-plans`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "api_key": "example-api-key",
  "county_fips": "example-county-fips",
  "limit": 20,
  "market": "Individual",
  "mode": "sandbox",
  "offset": 0,
  "order": "asc",
  "state": "MA",
  "year": 1,
  "zip_code": "02116"
}
```

## Success responses

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

## Success response examples

### 200

```json
[
  {
    "aptc_eligible_premium": "example-aptc-eligible-premium",
    "benefits": [],
    "benefits_url": "https://example.com/resource",
    "brochure_url": "https://example.com/resource",
    "deductibles": [],
    "design_type": "example-design-type",
    "disease_mgmt_programs": [],
    "ehb_premium": "example-ehb-premium",
    "formulary_url": "https://example.com/resource",
    "id": "12345",
    "insurance_market": "example-insurance-market",
    "market": "example-market",
    "max_age_child": "example-max-age-child",
    "metal_level": "example-metal-level",
    "moops": [],
    "name": "Example Name",
    "network_url": "https://example.com/resource",
    "oopc": "example-oopc",
    "pediatric_ehb_premium": "example-pediatric-ehb-premium",
    "premium": "example-premium",
    "premium_w_credit": "example-premium-w-credit",
    "product_division": "example-product-division",
    "service_area_id": "12345",
    "state": "MA",
    "suppression_state": "MA",
    "tiered_deductibles": [],
    "tiered_moops": [],
    "tobacco_lookback": "example-tobacco-lookback",
    "type": "example-type"
  }
]
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Connector validation rejected the payload, or a required field was missing or of the wrong type. |
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The HealthCloud bearer token is missing or invalid, or the vendor rejected the supplied connector credentials. |
| `500` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The connector failed unexpectedly. |
| `502` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor returned an application or transport-level failure. |
| `504` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor did not respond within the connector timeout. |

## Error examples

### 400 — Invalid request

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

### 401 — Authorization required

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

### 500 — Internal error

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

### 502 — Upstream vendor error

```json
{
  "error": "Upstream vendor error"
}
```

### 504 — Upstream timeout

```json
{
  "error": "Upstream timeout"
}
```

## NodeJS / TypeScript implementation

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

```ts
const body = {
  "api_key": "example-api-key",
  "county_fips": "example-county-fips",
  "limit": 20,
  "market": "Individual",
  "mode": "sandbox",
  "offset": 0,
  "order": "asc",
  "state": "MA",
  "year": 1,
  "zip_code": "02116"
};

const result = await connectors.cms.createClient(config).searchHealthPlans(body);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"api_key":"example-api-key","county_fips":"example-county-fips","limit":20,"market":"Individual","mode":"sandbox","offset":0,"order":"asc","state":"MA","year":1,"zip_code":"02116"}' \
  'https://dev-api-connectors.health.cloud/connectors/cms/search-health-plans'
```

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