# Fetch and map a single provider by NPI

Operation ID: `connectors.nppesGetProvider`

Fetch and map a single provider by NPI. Calls NPPES through the HealthCloud connector gateway.

## Public method

`getProvider`

Signature: `connectors.nppes.createClient().getProvider(body)`

Return type: `Promise<NppesGetProviderResult>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /connectors/nppes/get-provider`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "mode": "sandbox",
  "npi": "+15555550123"
}
```

## Success responses

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

## Success response examples

### 200

```json
{
  "addresses": [
    {
      "address_1": "1919 E THOMAS RD",
      "address_purpose": "LOCATION",
      "address_type": "DOM",
      "city": "PHOENIX",
      "country_code": "US",
      "country_name": "United States",
      "postal_code": "+15555550123",
      "state": "AZ",
      "telephone_number": "+15555550123"
    }
  ],
  "basic": {
    "enumeration_date": "+15555550123",
    "first_name": "SHELLEY",
    "last_name": "AKEY",
    "last_updated": "+15555550123",
    "middle_name": "ANNE",
    "name_prefix": "Mrs.",
    "sole_proprietor": "NO",
    "status": "A"
  },
  "created_epoch": "+15555550123",
  "enumeration_type": "NPI-1",
  "last_updated_epoch": "+15555550123",
  "number": "+15555550123",
  "other_names": [
    {
      "code": "1",
      "first_name": "SHELLEY",
      "last_name": "SMITH",
      "middle_name": "ANNE",
      "type": "Former Name"
    }
  ],
  "practice_locations": [
    {
      "address_1": "3010 CHILDRENS WAY",
      "address_purpose": "LOCATION",
      "address_type": "DOM",
      "city": "SAN DIEGO",
      "country_code": "US",
      "country_name": "United States",
      "postal_code": "+15555550123",
      "state": "CA",
      "telephone_number": "+15555550123"
    }
  ],
  "taxonomies": [
    {
      "code": "363LN0000X",
      "desc": "Nurse Practitioner, Neonatal",
      "license": "RN124410",
      "primary": false,
      "state": "AZ",
      "taxonomy_group": ""
    }
  ]
}
```

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

```ts
const body = {
  "mode": "sandbox",
  "npi": "+15555550123"
};

const result = await connectors.nppes.createClient().getProvider(body);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"mode":"sandbox","npi":"+15555550123"}' \
  'https://dev-api-connectors.health.cloud/connectors/nppes/get-provider'
```

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