# Medicare opt-out

URL: https://docs.healthcare.dev/datasets/medicare-opt-out

<Freshness dataset="medicare-opt-out" />

|                 |                                                                                                                                    |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Source          | CMS ([Opt Out Affidavits](https://data.cms.gov/provider-characteristics/medicare-provider-supplier-enrollment/opt-out-affidavits)) |
| Source id       | `cms-opt-out`                                                                                                                      |
| Release cadence | About monthly                                                                                                                      |
| License         | Public domain (US government work)                                                                                                 |
| Endpoint        | [`/v1/providers/{npi}/opt-out`](/reference/providers/medicare-opt-out-status-for-an-npi)                                           |
| MCP tool        | `check_medicare_opt_out`                                                                                                           |
| Plans           | Every plan, Free included                                                                                                          |

Providers who opt out of Medicare file an affidavit with their Medicare contractor; CMS publishes the
list. Each record is one affidavit: NPI, name, specialty, opt-out effective and end dates, whether
CMS lists the provider as eligible to order and refer, the practice address on the affidavit and
when CMS last updated it.

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

- `opted_out` is true when a listed affidavit's period covers today (effective on or before today,
  ending after it). An NPI can have affidavits in several states.
- Opt-outs renew every two years unless the provider cancels, so `opt_out_end_date` moves when
  one renews.
- Not listed means no opt-out affidavit recorded with this NPI as of `data_version`. Affidavits a
  later file drops stay with `status: retired`.
- `GET /v1/providers/{npi}` links here (`links.opt_out`) when the file lists the NPI.
