Skip to content

Docs: by job

The payer directory

Find the payer and its published payer ID before anything else, from public federal files, each ID with its source.

Read as markdown

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"
The answer (200)JSON
{
  "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
FieldTypeWhat it is
objectTypethe value "list"
scopeTypestringWhat it isWhat the directory is, and is not.
payer_ids_areTypestring
built_onTypestringWhat it isYYYY-MM-DD.
queryTypeobject
totalTypeinteger
dataTypelist of object
has_moreTypeboolean
next_cursorTypestring or null
warningsTypelist of FieldProblem
bluecardTypeobjectWhat it isAsked about BlueCard: how it routes, in words.
medicare_wordsTypestring
connectionTypethe value "none"
transmitsTypethe 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"
The answer (200)JSON
{
  "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
FieldTypeWhat it is
idTypestringWhat it isThe directory row id: pwd_ and 16 hex, Payerworks’ own, never a payer ID.
objectTypethe value "payer_directory_row"
kindTypeone of "organization", "plan_program"
nameTypestring
aliasesTypelist of string
typesTypelist 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.
programTypeone 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_idTypestring or null
organization_nameTypestring or null
parentTypestring or null
statesTypelist of string
nationwideTypebooleanWhat it isTrue only where the source says the whole country.
area_statedTypebooleanWhat 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_wordsTypestringWhat it isWith area_stated false: Not stated, in words.
area_noteTypeobjectWhat it isWhat the row’s own page says about where it serves, with the page.
employer_group_statesTypelist of stringWhat it isStates where CMS lists the contract for employer group plans only; never in states.
see_payer_idsTypeobjectWhat 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_idTypestring or nullWhat it isThe one claims payer ID the payer publishes; null when it publishes none Payerworks has read, or several.
payer_id_wordsTypestring or nullWhat it isWhy payer_id is null, in words.
published_payer_idsTypelist of objectWhat it isEvery ID the payer or its Medicare contractor publishes, each with its page and the day it was read.
naic_codesTypelist of string
cms_contract_idsTypelist of string
hios_issuer_idsTypelist of string
connectionTypethe value "none"What it isPayerworks is connected to no payer yet.
transmitsTypethe value false
naic_group_codesTypelist of string
programsTypelist of string
plan_typeTypestring
organization_typeTypestring
effective_dateTypestring
medicaid_programsTypelist of string
regionsTypelist of string
dme_jurisdictionTypestring
legal_stateTypestring
domiciliary_statesTypelist of string
claims_mailing_addressTypeobject or nullWhat it isThe claims mailing address the payer gave CMS, an organization fact.
medicareTypethe value "fee_for_service" or list of string or nullWhat it isfee_for_service, or the Medicare programs the row offers, or null.
medicaidTypelist of string
possibly_same_asTypelist of string
possibly_same_as_wordsTypestring or null
sourcesTypelist of string
childrenTypelist of object
scopeTypestring
payer_ids_areTypestring
built_onTypestring
source_filesTypelist of object

Reading the answer

  • Each row says how it matched (match.by: name, alias, legal form or spelling) and whether exactly, and carries connection: "none" and transmits: 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
CodeStatusWhat it means
invalid_payer_queryStatus400What 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_idStatus400What 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_directoryStatus404What 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_unavailableStatus503What 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.

payers.mjsJavaScript
// 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));
}
What it answered, run against the API in Payerworks’ own tests (your request ids will differ)JSON
{
  "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

Questions? hello@payerworks.com