Payerworks writes and explains files; it sends nothing to a payer. What that means
A search of payers and plan programs from public federal files, with a payer ID only where the payer publishes it, each with the page it came from and the day it was read. It is a directory, not a list of payers Payerworks can send to: Payerworks is connected to no payer yet.
Routes
Each route shows its call with curl and with the two clients, then its real answer, shortened, and the fields it holds. The client calls assume one client made once, const pw = new Payerworks() in JavaScript or pw = payerworks.Payerworks() in Python, each reading PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL, and body is the request.json shown.
GET/v1/payers
Search the payer directory
Payers and plan programs from public federal files (Medicare Advantage and Part D contracts, Medicaid managed care plans, insurers’ loss ratio filings, employer plans’ Form 5500 carriers) and the Medicare contractors; not a list Payerworks can send to; a payer ID only where the payer publishes it, with the page and the day it was read. Search with q by name, a misspelling, a payer ID, a NAIC code or a CMS contract ID (a state named in q is read as state=); narrow with state and type; page with limit (up to 100) and starting_after. Every row says connection none, and an all-digit payer ID under five digits is warned about: leading zeros are part of it.
Request
curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/payers?q=18003" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY"With the JavaScript client
const answer = await pw.getPayers({ query: {"q":"18003"} });With the Python client
answer = pw.get_payers(query={"q": "18003"}){
"object": "list",
"scope": "Payers and plan programs from public federal files; not a list of payers Payerworks can send to; payer IDs only where the payer publishes one.",
"payer_ids_are": "A payer ID is shown only where the payer or its Medicare contractor publishes it, with the page and the day it was read. Clearinghouses can route the same payer under other IDs, and Payerworks is connected to no payer yet.",
"built_on": "2026-10-19",
"query": {
"q": "18003",
"state": null,
"type": null
},
"total": 1,
"data": [
{
"id": "pwd_fe5efb2967c8dc5d",
"object": "payer_directory_row",
"kind": "plan_program",
"name": "Medicare DME MAC Jurisdiction C (CGS Administrators)",
"aliases": [
"DME MAC C",
"DME MAC Jurisdiction C"
],
"program": "medicare_dme",
"organization_id": "pwd_deeb1d92abd324d6",
"organization_name": "CGS Administrators",
"parent": "Medicare fee-for-service (Original Medicare)",
"states": [
"AL",
"AR"
],
"nationwide": false,
"area_stated": true,
"payer_id": "18003",
"payer_id_words": null,
"published_payer_ids": [
{
"payer_id": "18003",
"for": "Medicare DME claims, Jurisdiction C",
"transactions": [
"claims"
],
"claim_type": "professional",
"source": {
"url": "https://www.cgsmedicare.com/jc/claims/edi.html",
"label": "CGS JC DME: electronic claims",
"read_on": "2026-10-19"
}
}
],
"naic_codes": [],
"cms_contract_ids": [],
"hios_issuer_ids": [],
"connection": "none",
"transmits": false,
"match": {
"by": "payer_id",
"exact": true,
"payer_id": "18003"
}
}
],
"has_more": false,
"next_cursor": null,
"warnings": [],
"connection": "none",
"transmits": false
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
object | Typethe value "list" | |
scope | Typestring | What it isWhat the directory is, and is not. |
payer_ids_are | Typestring | |
built_on | Typestring | What it isYYYY-MM-DD. |
query | Typeobject | |
total | Typeinteger | |
data | Typelist of object | |
has_more | Typeboolean | |
next_cursor | Typestring or null | |
warnings | Typelist of FieldProblem | |
bluecard | Typeobject | What it isAsked about BlueCard: how it routes, in words. |
medicare_words | Typestring | |
connection | Typethe value "none" | |
transmits | Typethe value false |
GET/v1/payers/{id}
One directory row
One row in full by its directory id (pwd_ and 16 hex): its names, where its sources say it serves (or Not stated), programs, the payer IDs it publishes with their sources, and the files it came from. A payer ID sent here is refused 400 not_a_directory_row_id and pointed to the search, never answered as not found.
Request
curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/payers/pwd_fe5efb2967c8dc5d" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY"With the JavaScript client
const answer = await pw.getPayersById("pwd_fe5efb2967c8dc5d");With the Python client
answer = pw.get_payers_by_id("pwd_fe5efb2967c8dc5d"){
"id": "pwd_fe5efb2967c8dc5d",
"object": "payer_directory_row",
"kind": "plan_program",
"name": "Medicare DME MAC Jurisdiction C (CGS Administrators)",
"aliases": [
"DME MAC C",
"DME MAC Jurisdiction C"
],
"program": "medicare_dme",
"organization_id": "pwd_deeb1d92abd324d6",
"organization_name": "CGS Administrators",
"parent": "Medicare fee-for-service (Original Medicare)",
"states": [
"AL",
"AR"
],
"nationwide": false,
"area_stated": true,
"payer_id": "18003",
"payer_id_words": null,
"published_payer_ids": [
{
"payer_id": "18003",
"for": "Medicare DME claims, Jurisdiction C",
"transactions": [
"claims"
],
"claim_type": "professional",
"source": {
"url": "https://www.cgsmedicare.com/jc/claims/edi.html",
"label": "CGS JC DME: electronic claims",
"read_on": "2026-10-19"
}
}
],
"naic_codes": [],
"cms_contract_ids": [],
"hios_issuer_ids": [],
"connection": "none",
"transmits": false,
"naic_group_codes": [],
"dme_jurisdiction": "C",
"claims_mailing_address": null,
"medicare": "fee_for_service",
"medicaid": null,
"possibly_same_as": [],
"possibly_same_as_words": null,
"sources": [
"payer_pages"
],
"children": [],
"scope": "Payers and plan programs from public federal files; not a list of payers Payerworks can send to; payer IDs only where the payer publishes one.",
"payer_ids_are": "A payer ID is shown only where the payer or its Medicare contractor publishes it, with the page and the day it was read. Clearinghouses can route the same payer under other IDs, and Payerworks is connected to no payer yet.",
"built_on": "2026-10-19",
"source_files": [
{
"key": "payer_pages"
}
]
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
id | Typestring | What it isThe directory row id: pwd_ and 16 hex, Payerworks’ own, never a payer ID. |
object | Typethe value "payer_directory_row" | |
kind | Typeone of "organization", "plan_program" | |
name | Typestring | |
aliases | Typelist of string | |
types | Typelist of one of "commercial_insurer", "group_health_carrier", "group_dental_carrier", "medicare_advantage", "medicare_cost_plan", "medicare_part_d", "pace", "medicaid_managed_care", "medicaid_pccm", "medicaid_dental", "medicaid_behavioral_health", "medicaid_long_term_care", "medicaid_transportation", "medicaid_limited_benefit", "medicare_fee_for_service", "medicare_contractor", "medicare_dme", "tricare", "payer" | What it isAn organization’s kinds. |
program | Typeone of "commercial_insurer", "group_health_carrier", "group_dental_carrier", "medicare_advantage", "medicare_cost_plan", "medicare_part_d", "pace", "medicaid_managed_care", "medicaid_pccm", "medicaid_dental", "medicaid_behavioral_health", "medicaid_long_term_care", "medicaid_transportation", "medicaid_limited_benefit", "medicare_fee_for_service", "medicare_contractor", "medicare_dme", "tricare", "payer" | What it isA plan program’s kind. |
organization_id | Typestring or null | |
organization_name | Typestring or null | |
parent | Typestring or null | |
states | Typelist of string | |
nationwide | Typeboolean | What it isTrue only where the source says the whole country. |
area_stated | Typeboolean | What it isFalse when no file or page the row was read from says where it serves: its states are then empty, and Not stated, never guessed. |
area_words | Typestring | What it isWith area_stated false: Not stated, in words. |
area_note | Typeobject | What it isWhat the row’s own page says about where it serves, with the page. |
employer_group_states | Typelist of string | What it isStates where CMS lists the contract for employer group plans only; never in states. |
see_payer_ids | Typeobject | What it isA Medicare Advantage contract with no published ID of its own whose parent organization publishes payer IDs for its plans: the row that holds them. The IDs are never copied onto this row. |
payer_id | Typestring or null | What it isThe one claims payer ID the payer publishes; null when it publishes none Payerworks has read, or several. |
payer_id_words | Typestring or null | What it isWhy payer_id is null, in words. |
published_payer_ids | Typelist of object | What it isEvery ID the payer or its Medicare contractor publishes, each with its page and the day it was read. |
naic_codes | Typelist of string | |
cms_contract_ids | Typelist of string | |
hios_issuer_ids | Typelist of string | |
connection | Typethe value "none" | What it isPayerworks is connected to no payer yet. |
transmits | Typethe value false | |
naic_group_codes | Typelist of string | |
programs | Typelist of string | |
plan_type | Typestring | |
organization_type | Typestring | |
effective_date | Typestring | |
medicaid_programs | Typelist of string | |
regions | Typelist of string | |
dme_jurisdiction | Typestring | |
legal_state | Typestring | |
domiciliary_states | Typelist of string | |
claims_mailing_address | Typeobject or null | What it isThe claims mailing address the payer gave CMS, an organization fact. |
medicare | Typethe value "fee_for_service" or list of string or null | What it isfee_for_service, or the Medicare programs the row offers, or null. |
medicaid | Typelist of string | |
possibly_same_as | Typelist of string | |
possibly_same_as_words | Typestring or null | |
sources | Typelist of string | |
children | Typelist of object | |
scope | Typestring | |
payer_ids_are | Typestring | |
built_on | Typestring | |
source_files | Typelist of object |
Reading the answer
- Each row says how it matched (
match.by: name, alias, legal form or spelling) and whether exactly, and carriesconnection: "none"andtransmits: false. A row with no published payer ID says so, never a guessed one.
Troubleshooting
not_a_directory_row_id(400): GET /v1/payers/{id} takes a directory row id, which begins pwd_, never a payer ID. Search with ?q= first.payer_not_in_directory(404): The directory holds no published facts about that payer.
Every refusal these routes may answer, with its status. Any route may also answer the codes every route shares, on Every error.
| Code | Status | What it means |
|---|---|---|
invalid_payer_query | Status400 | What it meansA search parameter is out of shape; the error names it in field (q, state, type, limit or starting_after). |
not_a_directory_row_id | Status400 | What it meansGET /v1/payers/{id} takes a directory row id (pwd_ and 16 hex), never a payer ID: search GET /v1/payers?q= to find a payer by its payer ID or name. |
payer_not_in_directory | Status404 | What it meansThe Payerworks directory holds no published facts about this payer. It lists payers and plan programs from public federal files, not every payer, and not the payers Payerworks can send to. |
payer_directory_unavailable | Status503 | What it meansThe payer directory is not loaded where this was asked; the Payerworks API answers it. |
Example
payers.mjs runs every step below against the API with a test key. It needs payerworks.mjs and sample-data.mjs beside it.
// Payerworks example: the payer directory. Docs: https://payerworks.com/docs/payers
//
// Run it with Node 18 or later, with the JavaScript client (https://payerworks.com/sdk/payerworks.mjs)
// and sample-data.mjs beside this file:
// PAYERWORKS_API_KEY=pw_test_... PAYERWORKS_BASE_URL=<the base URL shown with your key> node payers.mjs
// A test key and invented data only. Payerworks sends nothing to a payer: every file it writes is yours.
import { pathToFileURL } from 'node:url';
import { Payerworks, PayerworksError } from './payerworks.mjs';
import { refusalOf } from './sample-data.mjs';
/** @param {Payerworks} pw */
export async function run(pw) {
// 1. Search by name or payer ID. A payer ID is shown only where the payer publishes it, with its source.
const found = await pw.getPayers({ query: { q: '18003' } });
const row = found.data[0];
// 2. One row by its directory id (pwd_...), never by a payer ID.
const one = await pw.getPayersById(row.id);
// 3. The failure path: a payer ID in place of a row id is refused, and the error says to search first.
const refused = await refusalOf(() => pw.getPayersById('99999'), { PayerworksError });
return { total: found.total, name: one.name, payer_id: one.payer_id, connection: one.connection, transmits: one.transmits, refused };
}
// Run as a script: node <this file>, with PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL set.
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
console.log(JSON.stringify(await run(new Payerworks()), null, 2));
}
{
"total": 1,
"name": "Medicare DME MAC Jurisdiction C (CGS Administrators)",
"payer_id": "18003",
"connection": "none",
"transmits": false,
"refused": {
"status": 400,
"code": "not_a_directory_row_id",
"request_id": "req_3"
}
}A free test key lets you try the API’s calls with invented data only. Payerworks sends nothing to any payer yet.
Get a test key