> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joincandidhealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.joincandidhealth.com/_mcp/server.

# Insurance Discovery

POST https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery
Content-Type: application/json

Sends an insurance discovery check to find potential coverage matches for a patient through Stedi.
Given patient demographics, this endpoint discovers what insurance coverages exist for the patient.
We recommend using the coverages check_insurance_discovery_passthrough API, as it allows long-running discovery requests to complete.

Reference: https://docs.joincandidhealth.com/api-reference/pre-encounter/eligibility-checks/v-1/insurance-discovery

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://pre-api.joincandidhealth.com` (Production, default)
- `https://pre-api-staging.joincandidhealth.com` (Staging)
- `https://sandbox-pre-api.joincandidhealth.com` (CandidSandbox)
- `https://staging-pre-api.joincandidhealth.com` (CandidStaging)
- `http://localhost:4000` (Local)

## Request

### Body (application/json)

This endpoint expects an InsuranceDiscoveryRequest.

- `provider` (InsuranceDiscoveryProvider, required) — Information about the provider requesting the insurance discovery check.
- `subscriber` (InsuranceDiscoverySubscriber, required) — Demographic information for the patient when they are the health plan subscriber. Providing as much information as possible improves the probability of finding matching coverage. SSN and address (especially zip code) are strongly recommended.
- `dependent` (InsuranceDiscoveryDependent, optional) — Demographic information for the patient when they are a dependent on a health plan. If you only have the dependent's information, identify them in the subscriber object instead and leave this empty.
- `encounter` (InsuranceDiscoveryEncounter, optional) — The date range for the service. If not specified, Stedi defaults to the current date. You can specify either a single date_of_service or a beginning_date_of_service and end_date_of_service.

## Response

### 200

- `discovery_id` (string, optional) — A unique ID for this insurance discovery check.
- `status` (enum, optional) — The status of the discovery check. COMPLETE means items are populated. PENDING means the check is still in progress.
  - Allowed values: `PENDING`, `COMPLETE`, `ERROR`, `UNKNOWN`
- `items` (list of any, optional) — An array of potential coverage matches for the patient. Only populated when status is COMPLETE. Each item is a raw passthrough of Stedi's deeply nested coverage-match object (provider, subscriber, payer, plan, and benefits details).
- `parsed_items` (list of ParsedDiscoveryItem, optional)
- `coverages_found` (integer, optional) — The number of potential coverage matches found. 0 if no matching coverage was found.
- `errors` (list of EligibilityCheckErrorDetails, optional)

## Types

### InsuranceDiscoveryProvider

Information about the provider requesting the insurance discovery check.

- `npi` (string, required) — The provider's National Provider Identifier (NPI).

### InsuranceDiscoverySubscriber

Demographic information for the patient when they are the health plan subscriber. Providing as much information as possible improves the probability of finding matching coverage. SSN and address (especially zip code) are strongly recommended.

- `first_name` (string, required) — The subscriber's first name.
- `last_name` (string, required) — The subscriber's last name.
- `middle_name` (string, optional) — The subscriber's middle name or initial.
- `date_of_birth` (string, optional) — The subscriber's date of birth, formatted as YYYYMMDD.
- `ssn` (string, optional) — The subscriber's Social Security Number (SSN). Full SSN is preferred, but even the last 4 digits can help.
- `gender` (enum, optional)
  - Allowed values: `M`, `F`
- `address` (InsuranceDiscoveryAddress, optional) — The patient's address. Providing a zip code improves the probability of finding matching coverage.

### InsuranceDiscoveryDependent

Demographic information for the patient when they are a dependent on a health plan. If you only have the dependent's information, identify them in the subscriber object instead and leave this empty.

- `first_name` (string, required) — The dependent's first name.
- `last_name` (string, required) — The dependent's last name.
- `middle_name` (string, optional) — The dependent's middle name or initial.
- `date_of_birth` (string, optional) — The dependent's date of birth, formatted as YYYYMMDD.
- `ssn` (string, optional) — The dependent's Social Security Number (SSN).
- `gender` (enum, optional)
  - Allowed values: `M`, `F`
- `address` (InsuranceDiscoveryAddress, optional) — The patient's address. Providing a zip code improves the probability of finding matching coverage.

### InsuranceDiscoveryEncounter

The date range for the service. If not specified, Stedi defaults to the current date. You can specify either a single date_of_service or a beginning_date_of_service and end_date_of_service.

- `date_of_service` (string, optional) — A single date of service, formatted as YYYYMMDD.
- `beginning_date_of_service` (string, optional) — The beginning date of service, formatted as YYYYMMDD.
- `end_date_of_service` (string, optional) — The end date of service, formatted as YYYYMMDD.

### ParsedDiscoveryItem

- `eligibility_status` (enum, required) — enum to represent the status of a patient's coverage
  - Allowed values: `ACTIVE`, `INACTIVE`, `UNKNOWN`
- `benefits` (CoverageBenefits, optional)
- `confidence` (Confidence, optional)
- `plan_metadata` (PlanMetadata, optional)

### EligibilityCheckErrorDetails

This object is our fern representation of Stedi's EligbilityCheckError object from their API.

- `field?` (string, optional)
- `description?` (string, optional)
- `location?` (string, optional)
- `possibleResolutions?` (string, optional)
- `code?` (string, optional)
- `followupAction?` (string, optional)

### InsuranceDiscoveryAddress

The patient's address. Providing a zip code improves the probability of finding matching coverage.

- `address_1` (string, optional)
- `address_2` (string, optional)
- `city` (string, optional)
- `state` (string, optional)
- `postal_code` (string, optional)
- `country_code` (string, optional)

### CoverageBenefits

- `plan_coverage` (PlanCoverage, optional)
- `service_specific_coverage` (list of ServiceCoverage, optional)
- `benefits_related_entities` (list of BenefitsRelatedEntity, optional)
- `non_covered_details` (list of NonCoveredDetail, optional)
- `notes` (string, optional)
- `autoUpdatedEligibilityCheckId` (string, optional)

### Confidence

- `level` (enum, optional)
  - Allowed values: `REVIEW_NEEDED`, `HIGH`
- `reason` (string, optional)

### PlanMetadata

- `payer_name` (string, optional)
- `insurance_type` (string, optional)
- `insurance_type_code` (string, optional)
- `plan_name` (string, optional)
- `member_id` (string, optional)
- `group_number` (string, optional)
- `start_date` (date, optional)
- `end_date` (date, optional)
- `plan_dates` (list of PlanDate, optional)
- `subscriber` (ExpandedMemberInfo, optional)
- `dependent` (ExpandedMemberInfo, optional)
- `trading_partner` (string, optional) — The payer's own identifier as returned on the Stedi eligibility response (271) `tradingPartnerServiceId`. Reflects the payer's internal concept of their ID, which may differ from the ID Stedi routes on.

### PlanCoverage

- `in_network` (PlanCoverageDetails, optional)
- `in_network_flat` (list of CoverageDetails, optional)
- `out_of_network` (PlanCoverageDetails, optional)
- `out_of_network_flat` (list of CoverageDetails, optional)

### ServiceCoverage

- `service_code` (enum, required) — Code identifying the type of service or benefit within a specific insurance policy (X12 008010 Element 1365)
  - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `30`, `32`, `33`, `34`, `35`, `36`, `37`, `38`, `39`, `40`, `41`, `42`, `43`, `44`, `45`, `46`, `47`, `48`, `49`, `50`, `51`, `52`, `53`, `54`, `55`, `56`, `57`, `58`, `59`, `60`, `61`, `62`, `63`, `64`, `65`, `66`, `67`, `68`, `69`, `70`, `71`, `72`, `73`, `74`, `75`, `76`, `77`, `78`, `79`, `80`, `81`, `82`, `83`, `84`, `85`, `86`, `87`, `88`, `89`, `90`, `91`, `92`, `93`, `94`, `95`, `96`, `97`, `98`, `99`, `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `A7`, `A8`, `A9`, `AA`, `AB`, `AC`, `AD`, `AE`, `AF`, `AG`, `AH`, `AI`, `AJ`, `AK`, `AL`, `AM`, `AN`, `AO`, `AQ`, `AR`, `B1`, `B2`, `B3`, `BA`, `BB`, `BC`, `BD`, `BE`, `BF`, `BG`, `BH`, `BI`, `BJ`, `BK`, `BL`, `BM`, `BN`, `BP`, `BQ`, `BR`, `BS`, `BT`, `BU`, `BV`, `BW`, `BX`, `BY`, `BZ`, `C1`, `CA`, `CB`, `CC`, `CD`, `CE`, `CF`, `CG`, `CH`, `CI`, `CJ`, `CK`, `CL`, `CM`, `CN`, `CO`, `CP`, `CQ`, `DG`, `DM`, `DS`, `GF`, `GN`, `GY`, `IC`, `MH`, `NI`, `ON`, `PT`, `PU`, `RN`, `RT`, `TC`, `TN`, `UC`
- `in_network` (ServiceCoverageDetails, optional)
- `in_network_flat` (list of CoverageDetails, optional)
- `out_of_network` (ServiceCoverageDetails, optional)
- `out_of_network_flat` (list of CoverageDetails, optional)

### BenefitsRelatedEntity

- `entityIdentifier` (string, optional)
- `entityType` (string, optional)
- `entityName` (string, optional)
- `contactInformation` (list of RelatedEntityContact, optional)
- `serviceTypeCodes` (list of enum, optional)
  - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `30`, `32`, `33`, `34`, `35`, `36`, `37`, `38`, `39`, `40`, `41`, `42`, `43`, `44`, `45`, `46`, `47`, `48`, `49`, `50`, `51`, `52`, `53`, `54`, `55`, `56`, `57`, `58`, `59`, `60`, `61`, `62`, `63`, `64`, `65`, `66`, `67`, `68`, `69`, `70`, `71`, `72`, `73`, `74`, `75`, `76`, `77`, `78`, `79`, `80`, `81`, `82`, `83`, `84`, `85`, `86`, `87`, `88`, `89`, `90`, `91`, `92`, `93`, `94`, `95`, `96`, `97`, `98`, `99`, `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `A7`, `A8`, `A9`, `AA`, `AB`, `AC`, `AD`, `AE`, `AF`, `AG`, `AH`, `AI`, `AJ`, `AK`, `AL`, `AM`, `AN`, `AO`, `AQ`, `AR`, `B1`, `B2`, `B3`, `BA`, `BB`, `BC`, `BD`, `BE`, `BF`, `BG`, `BH`, `BI`, `BJ`, `BK`, `BL`, `BM`, `BN`, `BP`, `BQ`, `BR`, `BS`, `BT`, `BU`, `BV`, `BW`, `BX`, `BY`, `BZ`, `C1`, `CA`, `CB`, `CC`, `CD`, `CE`, `CF`, `CG`, `CH`, `CI`, `CJ`, `CK`, `CL`, `CM`, `CN`, `CO`, `CP`, `CQ`, `DG`, `DM`, `DS`, `GF`, `GN`, `GY`, `IC`, `MH`, `NI`, `ON`, `PT`, `PU`, `RN`, `RT`, `TC`, `TN`, `UC`

### NonCoveredDetail

- `type` (enum, required)
  - Allowed values: `DEDUCTIBLE`, `DEDUCTIBLE_CONTRACT`, `DEDUCTIBLE_REMAINING`, `DEDUCTIBLE_YEAR_TO_DATE`, `OOP_MAX`, `OOP_MAX_CONTRACT`, `OOP_MAX_REMAINING`, `OOP_MAX_YEAR_TO_DATE`, `COPAY`, `COINSURANCE`, `NON_COVERED`, `LIMITATION`
- `coverageLevel` (enum, required)
  - Allowed values: `EMPLOYEE_AND_CHILDREN`, `EMPLOYEE_ONLY`, `EMPLOYEE_AND_SPOUSE`, `FAMILY`, `INDIVIDUAL`
- `unit` (enum, required)
  - Allowed values: `PERCENT`, `CURRENCY`, `COUNT`
- `value` (double, required)
- `additional_notes` (string, optional)
- `service_type_codes` (list of enum, optional)
  - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `30`, `32`, `33`, `34`, `35`, `36`, `37`, `38`, `39`, `40`, `41`, `42`, `43`, `44`, `45`, `46`, `47`, `48`, `49`, `50`, `51`, `52`, `53`, `54`, `55`, `56`, `57`, `58`, `59`, `60`, `61`, `62`, `63`, `64`, `65`, `66`, `67`, `68`, `69`, `70`, `71`, `72`, `73`, `74`, `75`, `76`, `77`, `78`, `79`, `80`, `81`, `82`, `83`, `84`, `85`, `86`, `87`, `88`, `89`, `90`, `91`, `92`, `93`, `94`, `95`, `96`, `97`, `98`, `99`, `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `A7`, `A8`, `A9`, `AA`, `AB`, `AC`, `AD`, `AE`, `AF`, `AG`, `AH`, `AI`, `AJ`, `AK`, `AL`, `AM`, `AN`, `AO`, `AQ`, `AR`, `B1`, `B2`, `B3`, `BA`, `BB`, `BC`, `BD`, `BE`, `BF`, `BG`, `BH`, `BI`, `BJ`, `BK`, `BL`, `BM`, `BN`, `BP`, `BQ`, `BR`, `BS`, `BT`, `BU`, `BV`, `BW`, `BX`, `BY`, `BZ`, `C1`, `CA`, `CB`, `CC`, `CD`, `CE`, `CF`, `CG`, `CH`, `CI`, `CJ`, `CK`, `CL`, `CM`, `CN`, `CO`, `CP`, `CQ`, `DG`, `DM`, `DS`, `GF`, `GN`, `GY`, `IC`, `MH`, `NI`, `ON`, `PT`, `PU`, `RN`, `RT`, `TC`, `TN`, `UC`

### PlanDate

- `start_date` (date, required)
- `field_name` (string, required)
- `end_date` (date, optional)

### ExpandedMemberInfo

- `member_id` (string, optional)
- `group_number` (string, optional)
- `first_name` (string, optional)
- `middle_name` (string, optional)
- `last_name` (string, optional)
- `date_of_birth` (string, optional)
- `gender` (string, optional)
- `address` (Address, optional)

### PlanCoverageDetails

- `deductible` (CoverageValue, optional)
- `deductible_contract` (CoverageValue, optional)
- `deductible_remaining` (CoverageValue, optional)
- `deductible_year_to_date` (CoverageValue, optional)
- `oop_max` (CoverageValue, optional)
- `oop_max_contract` (CoverageValue, optional)
- `oop_max_remaining` (CoverageValue, optional)
- `oop_max_year_to_date` (CoverageValue, optional)
- `additional_notes` (string, optional)

### CoverageDetails

- `type` (enum, required)
  - Allowed values: `DEDUCTIBLE`, `DEDUCTIBLE_CONTRACT`, `DEDUCTIBLE_REMAINING`, `DEDUCTIBLE_YEAR_TO_DATE`, `OOP_MAX`, `OOP_MAX_CONTRACT`, `OOP_MAX_REMAINING`, `OOP_MAX_YEAR_TO_DATE`, `COPAY`, `COINSURANCE`, `NON_COVERED`, `LIMITATION`
- `coverageLevel` (enum, required)
  - Allowed values: `EMPLOYEE_AND_CHILDREN`, `EMPLOYEE_ONLY`, `EMPLOYEE_AND_SPOUSE`, `FAMILY`, `INDIVIDUAL`
- `unit` (enum, required)
  - Allowed values: `PERCENT`, `CURRENCY`, `COUNT`
- `value` (double, required)
- `additional_notes` (string, optional)

### ServiceCoverageDetails

- `copay` (CoverageValue, optional)
- `coinsurance` (CoverageValue, optional)
- `visits` (CoverageValue, optional)
- `visits_remaining` (CoverageValue, optional)
- `additional_notes` (string, optional)

### RelatedEntityContact

- `mode` (string, optional)
- `value` (string, optional)

### Address

- `address1` (string, optional)
- `address2` (string, optional)
- `city` (string, optional)
- `state` (string, optional)
- `postal_code` (string, optional)
- `country_code` (string, optional)
- `country_sub_division_code` (string, optional)

### CoverageValue

- `family` (double, optional)
- `individual` (double, optional)
- `employeeAndSpouse` (double, optional)
- `employeeAndChildren` (double, optional)

## Examples

**Request**

```json
{
  "provider": {
    "npi": "npi"
  },
  "subscriber": {
    "first_name": "first_name",
    "last_name": "last_name"
  }
}
```

**Response**

```json
{
  "discovery_id": "discovery_id",
  "status": "PENDING",
  "items": [
    {
      "key": "value"
    },
    {
      "key": "value"
    }
  ],
  "parsed_items": [
    {
      "eligibility_status": "ACTIVE",
      "benefits": {
        "plan_coverage": {
          "in_network": {},
          "in_network_flat": [],
          "out_of_network": {},
          "out_of_network_flat": []
        },
        "service_specific_coverage": [
          {
            "service_code": "1",
            "in_network": {},
            "in_network_flat": [],
            "out_of_network": {},
            "out_of_network_flat": []
          },
          {
            "service_code": "1",
            "in_network": {},
            "in_network_flat": [],
            "out_of_network": {},
            "out_of_network_flat": []
          }
        ],
        "benefits_related_entities": [
          {
            "entityIdentifier": "entityIdentifier",
            "entityType": "entityType",
            "entityName": "entityName",
            "contactInformation": [],
            "serviceTypeCodes": []
          },
          {
            "entityIdentifier": "entityIdentifier",
            "entityType": "entityType",
            "entityName": "entityName",
            "contactInformation": [],
            "serviceTypeCodes": []
          }
        ],
        "non_covered_details": [
          {
            "type": "DEDUCTIBLE",
            "coverageLevel": "EMPLOYEE_AND_CHILDREN",
            "unit": "PERCENT",
            "value": 1.1,
            "additional_notes": "additional_notes",
            "service_type_codes": []
          },
          {
            "type": "DEDUCTIBLE",
            "coverageLevel": "EMPLOYEE_AND_CHILDREN",
            "unit": "PERCENT",
            "value": 1.1,
            "additional_notes": "additional_notes",
            "service_type_codes": []
          }
        ],
        "notes": "notes",
        "autoUpdatedEligibilityCheckId": "autoUpdatedEligibilityCheckId"
      },
      "confidence": {
        "level": "REVIEW_NEEDED",
        "reason": "reason"
      },
      "plan_metadata": {
        "payer_name": "payer_name",
        "insurance_type": "insurance_type",
        "insurance_type_code": "insurance_type_code",
        "plan_name": "plan_name",
        "member_id": "member_id",
        "group_number": "group_number",
        "start_date": "2023-01-15",
        "end_date": "2023-01-15",
        "plan_dates": [
          {
            "start_date": "2023-01-15",
            "field_name": "field_name",
            "end_date": "2023-01-15"
          },
          {
            "start_date": "2023-01-15",
            "field_name": "field_name",
            "end_date": "2023-01-15"
          }
        ],
        "subscriber": {
          "member_id": "member_id",
          "group_number": "group_number",
          "first_name": "first_name",
          "middle_name": "middle_name",
          "last_name": "last_name",
          "date_of_birth": "date_of_birth",
          "gender": "gender",
          "address": {}
        },
        "dependent": {
          "member_id": "member_id",
          "group_number": "group_number",
          "first_name": "first_name",
          "middle_name": "middle_name",
          "last_name": "last_name",
          "date_of_birth": "date_of_birth",
          "gender": "gender",
          "address": {}
        },
        "trading_partner": "trading_partner"
      }
    },
    {
      "eligibility_status": "ACTIVE",
      "benefits": {
        "plan_coverage": {
          "in_network": {},
          "in_network_flat": [],
          "out_of_network": {},
          "out_of_network_flat": []
        },
        "service_specific_coverage": [
          {
            "service_code": "1",
            "in_network": {},
            "in_network_flat": [],
            "out_of_network": {},
            "out_of_network_flat": []
          },
          {
            "service_code": "1",
            "in_network": {},
            "in_network_flat": [],
            "out_of_network": {},
            "out_of_network_flat": []
          }
        ],
        "benefits_related_entities": [
          {
            "entityIdentifier": "entityIdentifier",
            "entityType": "entityType",
            "entityName": "entityName",
            "contactInformation": [],
            "serviceTypeCodes": []
          },
          {
            "entityIdentifier": "entityIdentifier",
            "entityType": "entityType",
            "entityName": "entityName",
            "contactInformation": [],
            "serviceTypeCodes": []
          }
        ],
        "non_covered_details": [
          {
            "type": "DEDUCTIBLE",
            "coverageLevel": "EMPLOYEE_AND_CHILDREN",
            "unit": "PERCENT",
            "value": 1.1,
            "additional_notes": "additional_notes",
            "service_type_codes": []
          },
          {
            "type": "DEDUCTIBLE",
            "coverageLevel": "EMPLOYEE_AND_CHILDREN",
            "unit": "PERCENT",
            "value": 1.1,
            "additional_notes": "additional_notes",
            "service_type_codes": []
          }
        ],
        "notes": "notes",
        "autoUpdatedEligibilityCheckId": "autoUpdatedEligibilityCheckId"
      },
      "confidence": {
        "level": "REVIEW_NEEDED",
        "reason": "reason"
      },
      "plan_metadata": {
        "payer_name": "payer_name",
        "insurance_type": "insurance_type",
        "insurance_type_code": "insurance_type_code",
        "plan_name": "plan_name",
        "member_id": "member_id",
        "group_number": "group_number",
        "start_date": "2023-01-15",
        "end_date": "2023-01-15",
        "plan_dates": [
          {
            "start_date": "2023-01-15",
            "field_name": "field_name",
            "end_date": "2023-01-15"
          },
          {
            "start_date": "2023-01-15",
            "field_name": "field_name",
            "end_date": "2023-01-15"
          }
        ],
        "subscriber": {
          "member_id": "member_id",
          "group_number": "group_number",
          "first_name": "first_name",
          "middle_name": "middle_name",
          "last_name": "last_name",
          "date_of_birth": "date_of_birth",
          "gender": "gender",
          "address": {}
        },
        "dependent": {
          "member_id": "member_id",
          "group_number": "group_number",
          "first_name": "first_name",
          "middle_name": "middle_name",
          "last_name": "last_name",
          "date_of_birth": "date_of_birth",
          "gender": "gender",
          "address": {}
        },
        "trading_partner": "trading_partner"
      }
    }
  ],
  "coverages_found": 1,
  "errors": [
    {
      "field?": "field?",
      "description?": "description?",
      "location?": "location?",
      "possibleResolutions?": "possibleResolutions?",
      "code?": "code?",
      "followupAction?": "followupAction?"
    },
    {
      "field?": "field?",
      "description?": "description?",
      "location?": "location?",
      "possibleResolutions?": "possibleResolutions?",
      "code?": "code?",
      "followupAction?": "followupAction?"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery"

payload = {
    "provider": { "npi": "npi" },
    "subscriber": {
        "first_name": "first_name",
        "last_name": "last_name"
    }
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"provider":{"npi":"npi"},"subscriber":{"first_name":"first_name","last_name":"last_name"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery"

	payload := strings.NewReader("{\n  \"provider\": {\n    \"npi\": \"npi\"\n  },\n  \"subscriber\": {\n    \"first_name\": \"first_name\",\n    \"last_name\": \"last_name\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"provider\": {\n    \"npi\": \"npi\"\n  },\n  \"subscriber\": {\n    \"first_name\": \"first_name\",\n    \"last_name\": \"last_name\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"provider\": {\n    \"npi\": \"npi\"\n  },\n  \"subscriber\": {\n    \"first_name\": \"first_name\",\n    \"last_name\": \"last_name\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery', [
  'body' => '{
  "provider": {
    "npi": "npi"
  },
  "subscriber": {
    "first_name": "first_name",
    "last_name": "last_name"
  }
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"provider\": {\n    \"npi\": \"npi\"\n  },\n  \"subscriber\": {\n    \"first_name\": \"first_name\",\n    \"last_name\": \"last_name\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "provider": ["npi": "npi"],
  "subscriber": [
    "first_name": "first_name",
    "last_name": "last_name"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://pre-api.joincandidhealth.com/eligibility-checks/v1/insurance-discovery")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```