healthcare.dev docs
API referenceProviders

Medicare opt-out status for an NPI

GET /v1/providers/{npi}/opt-out

GET https://api.healthcare.dev/v1/providers/{npi}/opt-out

Medicare opt-out affidavits CMS lists with this NPI: specialty, opt-out effective and end dates, whether the provider may still order and refer, and the practice address on the affidavit. opted_out is true when a listed affidavit's period covers today. Opt-outs renew every two years unless cancelled, so the end date can move. Not listed means no opt-out affidavit recorded with this NPI as of data_version. A well-formed NPI always answers 200.

Requires an API key: Authorization: Bearer hdev_live_.... See Authentication.

Path parameters

NameTypeRequiredDescriptionExample
npistringyes10-digit National Provider Identifier1881018208

Query parameters

NameTypeRequiredDescriptionExample
view"compact" | "standard" | "full"noHow much of each record to return (default full). compact: id, npi, specialty, opt_out_effective_date, opt_out_end_date, eligible_to_order_and_refer, status (fewest tokens, for agents). standard: every field except replaced_by. full: every field.compact
fieldsstringnoComma-separated fields to return instead of a view. Valid fields: id, npi, name, specialty, opt_out_effective_date, opt_out_end_date, eligible_to_order_and_refer, address, last_updated, status, effective_start, effective_end, replaced_by.id,npi,specialty

Examples

curl

curl "https://api.healthcare.dev/v1/providers/1881018208/opt-out" \
  -H "Authorization: Bearer $HDEV_API_KEY"

TypeScript

const res = await fetch("https://api.healthcare.dev/v1/providers/1881018208/opt-out", {
  headers: { Authorization: `Bearer ${process.env.HDEV_API_KEY}` },
});
const { data, meta } = await res.json();

Python

import os
import requests

res = requests.get("https://api.healthcare.dev/v1/providers/1881018208/opt-out", headers={"Authorization": f"Bearer {os.environ['HDEV_API_KEY']}"})
body = res.json()

Try it

GEThttps://api.healthcare.dev/v1/providers/1881018208/opt-out?view=compact&fields=id%2Cnpi%2Cspecialty
Get a free key
Copy as curl
curl "https://api.healthcare.dev/v1/providers/1881018208/opt-out?view=compact&fields=id%2Cnpi%2Cspecialty" \
  -H "Authorization: Bearer $HDEV_API_KEY"

Response

The NPI's opt-out affidavits

{
  "data": {
    "npi": "string",
    "opted_out": true,
    "note": "string",
    "affidavits": [
      {
        "id": "string",
        "npi": "string",
        "name": {
          "display": null,
          "first": null,
          "last": null
        },
        "specialty": "string",
        "opt_out_effective_date": "2026-10-01",
        "opt_out_end_date": "2026-10-01",
        "eligible_to_order_and_refer": true,
        "address": {
          "line1": null,
          "line2": null,
          "city": null,
          "state": null,
          "postal_code": null
        },
        "last_updated": "2026-10-01",
        "status": "active",
        "effective_start": "2026-10-01",
        "effective_end": "2026-10-01",
        "replaced_by": [
          null
        ]
      }
    ]
  },
  "meta": {
    "source": "cms-icd10",
    "data_version": "2026.1",
    "retrieved_at": "2026-10-24T12:00:00Z",
    "license": "Public domain (CMS). Reference data, not medical advice."
  },
  "links": {
    "self": "/v1/providers/1881018208/opt-out",
    "next": null
  }
}

Fields

FieldTypeAlways presentDescription
npistringyes
opted_outbooleanyesWhether CMS's current opt-out file lists an affidavit with this NPI in effect today
notestringyesHow the answer was matched, in plain words: show it with the data
affidavitsMedicareOptOut[]yes

Errors

Errors are application/problem+json (RFC 9457). Branch on type, not on title. See Errors.

StatustypeWhen
400invalid-requestA parameter or the body failed validation; errors lists each field.
401unauthorizedMissing, malformed or revoked API key.
404not-foundNo record with that id (retired records are still returned).
429rate-limited / quota-exceededToo many requests per second (retry after Retry-After), or the monthly quota is used up.
503dataset-unavailable / unavailableThe dataset has no published version yet, or the service is degraded.

On this page