Skip to content

Docs: by job

Keys and your account

How a call is authorized, what each answer carries, and the routes that manage your keys and your account.

Read as markdown

Payerworks writes and explains files; it sends nothing to a payer. What that means

Every call but GET /v1/health sends a key as Authorization: Bearer pw_test_… or pw_live_…. A test key is free from the developers page, for invented data only, and writes test files only; a live key needs a signed business associate agreement first. Your key is a bearer key: keep it on your server, never in browser code.

Every answer carries x-request-id, and every refusal carries the same id as request_id inside the error. Quote it when you write to us. A POST, and PUT /v1/account/webhook, may carry an Idempotency-Key, unless its route says it takes none: a retry with the same key and request within 24 hours is answered as the first call was, by running it again, because Payerworks never keeps an answer.

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/health

Health

Whether the API is answering. No key needed.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/health"
The answer (200)JSON
{
  "ok": true,
  "service": "Payerworks",
  "version": "v1",
  "transmits": false
}
Field, Type, What it is
FieldTypeWhat it is
okTypeboolean
serviceTypestring
versionTypestring
transmitsTypethe value falseWhat it isNo route transmits to a payer yet.

GET/v1/account

Your account

The key’s account, label, mode and rate, the calls it made on each day of this month (counted by UTC day) and the calls refused before they ran, and its webhook if one is set, with what its last delivery did.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/account" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "key_id": "pwk_0123456789abcdef",
  "account": "Sample Billing Co",
  "label": "Self-serve",
  "mode": "test",
  "rpm": 60,
  "usage": {
    "month": "2026-10",
    "days": [
      {
        "date": "2026-10-18",
        "calls": 12,
        "refused": 0
      },
      {
        "date": "2026-10-19",
        "calls": 4,
        "refused": 1
      }
    ],
    "total": 16,
    "refused": 1
  },
  "webhook": {
    "url": "https://hooks.example.com/payerworks/events",
    "secret_last_four": "Osk=",
    "created_at": "2026-10-19T15:00:00.000Z",
    "previous_secret_expires_at": null,
    "last_delivery": {
      "at": "2026-10-19T15:00:00.000Z",
      "trigger": "sandbox",
      "first_event_id": "evt_cc264f7536a9315a0c6fe09f",
      "events": 3,
      "delivered": 3,
      "failed": 0,
      "status": 200,
      "error": null
    }
  }
}
Field, Type, What it is
FieldTypeWhat it is
key_idTypestring
accountTypestring
labelTypestring
modeTypeone of "test", "live"
rpmTypeintegerWhat it isCalls a minute.
usageTypeobjectWhat it isThis month to date, by UTC day.
webhookTypeobject or null

GET/v1/account/contact

Your notice address

Where Payerworks emails you about this key: when one of its webhook destinations keeps failing, and when one of its enrollment requests moves without your doing it. A test key from this page starts with the address its link was sent to, the only address it may set.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/account/contact" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "email": "dev@example.com",
  "updated_at": "2026-11-11T02:55:51.832Z"
}
Field, Type, What it is
FieldTypeWhat it is
emailTypestring or null
updated_atTypestring or null

PUT/v1/account/contact

Set your notice address

The address told when a destination has failed for 2 hours, for 24 hours, and when it was disabled after its last attempt, and sent one email for every enrollment request that moved without your doing it inside the same 15 minutes. Send email: null to remove it, and nothing is emailed. Only the address that asked for this account’s test key by email (any key of the account may set it), or null; any other address is refused 403 contact_not_proved. A key issued by Payerworks has its address set by us: write to us.

Request

curl -sS -X PUT "$PAYERWORKS_BASE_URL/v1/account/contact" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "email": "dev@example.com"
}
The answer (200)JSON
{
  "email": "dev@example.com",
  "updated_at": "2026-11-11T02:55:51.832Z"
}
Field, Type, What it is
FieldTypeWhat it is
emailTypestring or null
updated_atTypestring or null

GET/v1/keys

Your account’s keys

Every key of your account in your key’s own mode (a test key lists the test keys, a live key the live ones): its name, mode, last four characters, when it was made, when it expires, when it was last rotated, until when its previous secret is accepted, whether it has expired, when it was revoked, and which one is the key asking, beside the account’s id. A revoked key is listed too. Never a key itself.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/keys" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "account_id": "pwk_0123456789abcdef01",
  "data": [
    {
      "key_id": "pwk_0123456789abcdef01",
      "name": "Server",
      "mode": "test",
      "last_four": "aaaa",
      "created_at": "2026-10-19T12:00:00.000Z",
      "expires_at": null,
      "expired": false,
      "revoked_at": null,
      "rotated_at": null,
      "previous_secret_accepted_until": null,
      "current": true
    },
    {
      "key_id": "pwk_c92dad163111102ffbbee26e",
      "name": "CI runner",
      "mode": "test",
      "last_four": "dwV0",
      "created_at": "2026-11-11T02:55:51.885Z",
      "expires_at": "2027-02-09T02:55:51.885Z",
      "expired": false,
      "revoked_at": null,
      "rotated_at": null,
      "previous_secret_accepted_until": null,
      "current": false
    }
  ]
}
Field, Type, What it is
FieldTypeWhat it is
account_idTypestringWhat it isThe account: the keys one key started.
dataTypelist of AccountKey

POST/v1/keys

Make a key

A named key of your key’s own mode and rate, shown once. expires_in_days (1 to 365) makes it stop on its own. A key never outlives the key that made it: its expiry is the sooner of expires_in_days and the making key’s own, and the making key’s when none is asked. An account holds 3 test keys or 25 live ones that are not revoked. Every key of an account may manage its keys, unless the account’s organization chose members only.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/keys" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "name": "CI runner",
  "expires_in_days": 90
}
The answer (201)JSON
{
  "key_id": "pwk_c92dad163111102ffbbee26e",
  "name": "CI runner",
  "mode": "test",
  "last_four": "dwV0",
  "created_at": "2026-11-11T02:55:51.885Z",
  "expires_at": "2027-02-09T02:55:51.885Z",
  "expired": false,
  "revoked_at": null,
  "rotated_at": null,
  "previous_secret_accepted_until": null,
  "current": false,
  "key": "pw_test_nSp1..."
}
Field, Type, What it is
FieldTypeWhat it is
key_idTypestring
nameTypestring
modeTypeone of "test", "live"
last_fourTypestring
created_atTypestring
expires_atTypestring or null
expiredTypeboolean
revoked_atTypestring or null
rotated_atTypestring or null
previous_secret_accepted_untilTypestring or null
currentTypebooleanWhat it isTrue for the key this call was made with.
keyTypestringWhat it ispw_test_ or pw_live_ and the secret: only in the answer that made it (POST /v1/keys, or a rotation).
overlap_hoursTypeinteger

DELETE/v1/keys/{id}

Revoke a key

The key stops working within a minute, and its SFTP user, if it has one, is removed at once. Revoking a key that is already revoked is not an error.

Request

curl -sS -X DELETE "$PAYERWORKS_BASE_URL/v1/keys/pwk_c92dad163111102ffbbee26e" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "key_id": "pwk_c92dad163111102ffbbee26e",
  "name": "CI runner",
  "mode": "test",
  "last_four": "8COs",
  "created_at": "2026-11-11T02:55:51.885Z",
  "expires_at": "2027-02-09T02:55:51.885Z",
  "expired": false,
  "revoked_at": "2026-11-11T02:55:51.895Z",
  "rotated_at": "2026-11-11T02:55:51.892Z",
  "previous_secret_accepted_until": "2026-11-12T02:55:51.892Z",
  "current": false
}
Field, Type, What it is
FieldTypeWhat it is
key_idTypestring
nameTypestring
modeTypeone of "test", "live"
last_fourTypestring
created_atTypestring
expires_atTypestring or null
expiredTypeboolean
revoked_atTypestring or null
rotated_atTypestring or null
previous_secret_accepted_untilTypestring or null
currentTypebooleanWhat it isTrue for the key this call was made with.
keyTypestringWhat it ispw_test_ or pw_live_ and the secret: only in the answer that made it (POST /v1/keys, or a rotation).
overlap_hoursTypeinteger

POST/v1/keys/{id}/rotate

Rotate a key

A new secret for the same key id, shown once, so its webhooks, events, usage and enrollments carry on. The old secret is still accepted for overlap_hours, 0 to 720, 24 by default, and stops at once if the key is revoked. Two rotations at once: the first finishes, and the other answers 409 key_rotation_conflict and makes nothing.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/keys/pwk_c92dad163111102ffbbee26e/rotate" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "overlap_hours": 24
}
The answer (200)JSON
{
  "key_id": "pwk_c92dad163111102ffbbee26e",
  "name": "CI runner",
  "mode": "test",
  "last_four": "8COs",
  "created_at": "2026-11-11T02:55:51.885Z",
  "expires_at": "2027-02-09T02:55:51.885Z",
  "expired": false,
  "revoked_at": null,
  "rotated_at": "2026-11-11T02:55:51.892Z",
  "previous_secret_accepted_until": "2026-11-12T02:55:51.892Z",
  "current": false,
  "key": "pw_test_p3oK...",
  "overlap_hours": 24
}
Field, Type, What it is
FieldTypeWhat it is
key_idTypestring
nameTypestring
modeTypeone of "test", "live"
last_fourTypestring
created_atTypestring
expires_atTypestring or null
expiredTypeboolean
revoked_atTypestring or null
rotated_atTypestring or null
previous_secret_accepted_untilTypestring or null
currentTypebooleanWhat it isTrue for the key this call was made with.
keyTypestringWhat it ispw_test_ or pw_live_ and the secret: only in the answer that made it (POST /v1/keys, or a rotation).
overlap_hoursTypeinteger

POST/v1/mcp

The MCP server, hosted

The same tools as the downloadable MCP server, over MCP’s Streamable HTTP transport (2026-07-28, and the 2025 handshakes), with your key as the bearer. Each tool call is a call to its route under your key. With a live key no tool is called unless the request carries Payerworks-MCP-Allow-Live-Key: 1. Payerworks transmits nothing.

Request

curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/mcp" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json
request.jsonJSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "example-client",
      "version": "1"
    }
  }
}
The answer (200)JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": {
      "tools": {
        "listChanged": false
      },
      "prompts": {
        "listChanged": false
      }
    },
    "serverInfo": {
      "name": "payerworks",
      "title": "Payerworks",
      "version": "1.0.0"
    },
    "instructions": "Each tool calls one route of the Payerworks API with the key this connection presents. Payerworks validates claims, writes and reads X12 files and explains each answer in plain words. It transmits nothing: no file reaches a payer. post_sand…"
  }
}

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
jsonrpcTypethe value "2.0"
idTypeobject
resultTypeobject
errorTypeobjectWhat it isA JSON-RPC error: never the API’s error shape.

GET/v1/audit-log

Your account’s audit log

Every change to this account, newest first: keys made, rotated, revoked or expired; the webhook, destinations and the notice address; providers, enrollment requests, tasks and documents; the SFTP user and its SSH keys; batch jobs; the organization and its members. Each entry says what, when, who (a key, a member, Payerworks, or Payerworks automatically), through which door, the object’s id, and the fields that changed by name only, never a value; a web address by its host. limit 1 to 100 (25), type (an entry type, or its family before the dot), created_gte and created_lt, starting_after. Each entry is kept 365 days, then deleted, and never changed before then. Every key of the account reads the same log.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/audit-log" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "object": "list",
  "data": [
    {
      "id": "aud_aeb4acb2fdf610d4bc531306",
      "type": "webhook_destination.removed",
      "words": "Webhook destination removed",
      "at": "2026-11-11T02:55:51.898Z",
      "actor": {
        "type": "key",
        "id": "pwk_0123456789abcdef01"
      },
      "door": "api",
      "object": {
        "kind": "webhook_destination",
        "id": "wd_41a29f8a49c92190"
      },
      "changed": [],
      "url_host": null,
      "count": null,
      "request_id": "req_example_15"
    },
    {
      "id": "aud_a08c0b0cd9c2ce25b9ef59ab",
      "type": "key.revoked",
      "words": "API key revoked",
      "at": "2026-11-11T02:55:51.895Z",
      "actor": {
        "type": "key",
        "id": "pwk_0123456789abcdef01"
      },
      "door": "api",
      "object": {
        "kind": "key",
        "id": "pwk_c92dad163111102ffbbee26e"
      },
      "changed": [],
      "url_host": null,
      "count": null,
      "request_id": "req_example_14"
    }
  ],
  "has_more": true,
  "next_cursor": "acur_412331373934333635373531383932236175645f663663623031613433613161613366356130353463653832",
  "retention_days": 365
}

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"
dataTypelist of AuditEntryWhat it isNewest first.
has_moreTypeboolean
next_cursorTypestring or nullWhat it isPass as starting_after.
retention_daysTypethe value 365What it isEach audit log entry is kept for 365 days (one year) from the moment of the change, then deleted. No entry is overwritten: each is written once, only where no entry of its id is.

GET/v1/audit-log/export

Download the audit log

The same entries and filters as a CSV file in the answer (csv, filename, columns), at most 5,000 entries a call; next_cursor names where the rest start. No cell opens as a formula in a spreadsheet.

Request

curl -sS -X GET "$PAYERWORKS_BASE_URL/v1/audit-log/export" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY"
The answer (200)JSON
{
  "object": "audit_log_export",
  "content_type": "text/csv",
  "filename": "payerworks-audit-log-2026-11-11.csv",
  "row_count": 7,
  "columns": [
    "id",
    "at"
  ],
  "csv": "id,at,type,words,actor_type,actor_id,door,object_kind,object_id,changed,url_host,count,request_id\r\naud_aeb4acb2fdf610d4bc531306,2026-11-11T02:55:51.898Z,webhook_destination.removed,Webhook destination removed,key,pwk_0123456789abcdef01,api,…",
  "has_more": false,
  "next_cursor": null,
  "retention_days": 365
}

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 "audit_log_export"
content_typeTypethe value "text/csv"
filenameTypestring
row_countTypeintegerWhat it isAt most 5,000.
columnsTypelist of one of "id", "at", "type", "words", "actor_type", "actor_id", "door", "object_kind", "object_id", "changed", "url_host", "count", "request_id"
csvTypestringWhat it isThe file, CRLF line ends; no cell opens as a formula in a spreadsheet.
has_moreTypeboolean
next_cursorTypestring or nullWhat it isPass as starting_after for the rest.
retention_daysTypethe value 365What it isEach audit log entry is kept for 365 days (one year) from the moment of the change, then deleted. No entry is overwritten: each is written once, only where no entry of its id is.

Reading the answer

  • GET /v1/account answers the key’s rate a minute and its usage this month to date, by UTC day, with refused calls counted apart.
  • A rotation (POST /v1/keys/{id}/rotate) keeps the key id, so webhooks, events, usage and enrollments carry on; the old secret is accepted only inside the overlap you choose. Every key of an account may manage its keys, unless the account’s organization chose that only its signed-in members do (see Organizations and members).
  • GET /v1/audit-log answers who changed what on the account, when and through which door, by field name only, never a value; each entry is kept one year. GET /v1/audit-log/export gives the same entries as a CSV file.

Troubleshooting

  • invalid_key (401): The key is not valid, or was revoked: a revoked key stops within a minute.
  • rate_limited (429): Over the key’s calls a minute. Wait the seconds retry-after names; the clients do this for you, at most twice.
  • idempotency_key_reused (422): That Idempotency-Key was used in the last 24 hours for a different request. Make a new key for each new request.
  • too_large (413): A request body is at most 2 MB. Larger work is split across calls.
  • invalid_audit_type (400): type names an entry type (key.created) or its family (key).
  • keys_managed_by_members (403): The account’s organization chose that only its signed-in members make, rotate and revoke keys: do it in the console, or ask an owner to switch it back.

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_audit_cursorStatus400What it meansstarting_after is the next_cursor of an earlier page of this audit log.
invalid_audit_typeStatus400What it meanstype is one of the audit log's entry types, or the part before its dot (key, webhook, enrollment...), as the developers page lists them.
invalid_concurrencyStatus400What it meansconcurrency is a whole number from 1 to 10: how many deliveries this destination takes at once.
invalid_contact_emailStatus400What it meansemail is an address of at most 254 characters, or null to remove it.
invalid_destination_idStatus400What it meansA destination id is wd_ followed by 16 lowercase hexadecimal characters.
invalid_destination_nameStatus400What it meansA destination's name is 1 to 80 characters.
invalid_enabledStatus400What it meansenabled is true or false, or left out.
invalid_event_typesStatus400What it meansevent_types is a list of the event types the developers page lists; an empty list, or leaving it out, receives every type.
invalid_expires_in_daysStatus400What it meansexpires_in_days is a whole number from 1 to 365, or left out for a key that does not expire.
invalid_idempotency_keyStatus400What it meansAn Idempotency-Key is 1 to 255 visible characters, with no spaces, quotes or backslashes. A UUID is a good one.
invalid_jsonStatus400What it meansThe body must be a JSON object.
invalid_key_idStatus400What it meansA key id is pwk_ followed by 16 to 40 letters and digits.
invalid_key_nameStatus400What it meansA key's name is 1 to 80 characters.
invalid_overlap_hoursStatus400What it meansoverlap_hours is a whole number from 0 to 720: how long the old secret is still accepted after a rotation.
invalid_keyStatus401What it meansThat key is not valid. Keys are issued by Payerworks; a revoked key stops within a minute.
no_keyStatus401What it meansSend your API key as Authorization: Bearer <key>.
contact_not_provedStatus403What it meansNotices go only to an address Payerworks has proved: the one that asked for this account's test key by email and opened the link we sent. Send that address, or null to stop the notices. To use another, write to us from it.
keys_managed_by_membersStatus403What it meansThis account's organization chose that only its signed-in members manage keys. Make, rotate or revoke the key at payerworks.com/console.
destination_not_foundStatus404What it meansThis key has no webhook destination with that id.
key_not_foundStatus404What it meansThis account has no key with that id.
not_at_destinationStatus404What it meansThat event was never sent to this destination (it was made before the destination was added, or its type is filtered out). A ping or a new event will be.
destination_conflictStatus409What it meansThe destination changed while this request ran, so nothing was saved. Send the request again.
destination_disabledStatus409What it meansThis destination is disabled. Enable it with PUT /v1/webhook-destinations/{id} and enabled: true first.
destination_limit_reachedStatus409What it meansA key holds at most 10 webhook destinations. Remove one to add another.
idempotency_in_flightStatus409What it meansThe first request with this Idempotency-Key is still running. Retry after the seconds retry-after names.
key_last_usableStatus409What it meansThat is the account's last usable key of its mode, so it was not revoked: without one, no key can be made and the audit log cannot be read. Make a replacement with POST /v1/keys first, then revoke this one.
key_limit_reachedStatus409What it meansAn account holds at most 3 test keys or 25 live keys that are not revoked. Revoke one to make another.
key_revokedStatus409What it meansThat key is revoked, so it cannot be rotated. Make a new key with POST /v1/keys.
key_rotation_conflictStatus409What it meansAnother rotation of this key finished while this one ran, so this one made nothing: the secret that other request showed is the key's current one. List the keys with GET /v1/keys, and rotate again if that secret was lost.
key_settings_out_of_rangeStatus409What it meansThe key's stored rate or account name is outside what a key may hold, so nothing was made or rotated; reason says which. Ask Payerworks to correct the key: sending the request again answers the same.
too_largeStatus413What it meansA request body may be at most 2 MB.
idempotency_key_reusedStatus422What it meansThis Idempotency-Key was used in the last 24 hours for a different request. Send a new key for a new request.
rate_limitedStatus429What it meansOver this key's calls a minute. Wait the seconds retry-after names.
store_unavailableStatus503What it meansWe could not read or write this key's records just now; the message says what was not done. Retry in a moment.

Code lists

The headers on every answer

Header, What it says
HeaderWhat it says
x-request-idWhat it saysThe request’s id. Quote it when you write to Payerworks.
x-ratelimit-limitWhat it saysThe key’s calls a minute.
x-ratelimit-remainingWhat it saysCalls left in this UTC minute.
x-ratelimit-resetWhat it saysSeconds until the window resets.
RateLimitWhat it saysThe same figures in the IETF draft’s form.
RateLimit-PolicyWhat it saysThe key’s policy in the IETF draft’s form.
idempotent-replayedWhat it saystrue when this is the first answer to an Idempotency-Key request, given again.
retry-afterWhat it saysSeconds to wait before a retry.

The audit log’s entry types

An entry names what changed by field name only, never a value: no name, address, note or answer is kept. A web address is kept as its host alone. Each audit log entry is kept for 365 days (one year) from the moment of the change, then deleted. No entry is overwritten: each is written once, only where no entry of its id is.

Type, What changed, Fields it may name
TypeWhat changedFields it may name
key.createdWhat changedAPI key createdFields it may namename, mode, rpm, expires_at
key.rotatedWhat changedAPI key secret rotatedFields it may namesecret, overlap_hours
key.revokedWhat changedAPI key revokedFields it may namenone
key.expiredWhat changedAPI key expiredFields it may namenone
webhook.setWhat changedAccount webhook setFields it may nameurl, secret
webhook.changedWhat changedAccount webhook changedFields it may nameurl, secret, overlap_hours
webhook.removedWhat changedAccount webhook removedFields it may namenone
webhook_destination.createdWhat changedWebhook destination addedFields it may namename, url, event_types, enabled, concurrency, secret
webhook_destination.changedWhat changedWebhook destination changedFields it may namename, url, event_types, enabled, concurrency, secret, overlap_hours
webhook_destination.removedWhat changedWebhook destination removedFields it may namenone
contact.changedWhat changedNotice contact setFields it may nameemail
contact.removedWhat changedNotice contact removedFields it may nameemail
provider.createdWhat changedProvider addedFields it may namename, npi, tax_id, tax_id_type, contacts
provider.changedWhat changedProvider changedFields it may namename, npi, tax_id, tax_id_type, contacts
provider.removedWhat changedProvider removedFields it may namenone
enrollment.createdWhat changedEnrollment request createdFields it may nameprovider_id, payer, transaction, primary_contact, notify_email, requested_effective_date, era_aggregation, ptan, note
enrollment.changedWhat changedEnrollment request changedFields it may nameprovider_id, payer, transaction, primary_contact, notify_email, requested_effective_date, era_aggregation, ptan, note
enrollment.submittedWhat changedEnrollment request submittedFields it may namenone
enrollment.withdrawnWhat changedEnrollment request withdrawnFields it may namereason
enrollment.withdrawal_requestedWhat changedWithdrawal of an enrollment request asked of PayerworksFields it may namereason
enrollment.removedWhat changedEnrollment request deletedFields it may namenone
enrollment.status_changedWhat changedEnrollment request status changedFields it may namestatus
enrollment.importedWhat changedEnrollment requests imported from a fileFields it may namenone
enrollment.note_addedWhat changedNote added to an enrollment requestFields it may namenone
enrollment_task.answeredWhat changedEnrollment task answeredFields it may namevalues
enrollment_task.addedWhat changedEnrollment task addedFields it may namenone
enrollment_task.supersededWhat changedEnrollment task replaced by anotherFields it may namenone
enrollment_task.completedWhat changedEnrollment task marked doneFields it may namenone
enrollment_document.requestedWhat changedEnrollment document upload startedFields it may namenone
enrollment_document.addedWhat changedEnrollment document addedFields it may namenone
enrollment_document.removedWhat changedEnrollment document removedFields it may namenone
sftp_user.addedWhat changedSFTP user addedFields it may nameacknowledgment_999
sftp_user.changedWhat changedSFTP user changedFields it may nameacknowledgment_999
sftp_user.removedWhat changedSFTP user removedFields it may namenone
sftp_ssh_key.addedWhat changedSFTP SSH key addedFields it may namenone
sftp_ssh_key.removedWhat changedSFTP SSH key removedFields it may namenone
job.createdWhat changedBatch job createdFields it may nameroute
job.canceledWhat changedBatch job canceledFields it may namenone
job.removedWhat changedBatch job and its files deletedFields it may namenone
account_baa.recordedWhat changedBusiness associate agreement recordedFields it may namesigner_name, signer_title, organization, signed_on, baa_version, reference_prefix
account_baa.withdrawnWhat changedBusiness associate agreement withdrawnFields it may namenone
org.createdWhat changedOrganization createdFields it may namename
org.updatedWhat changedOrganization changedFields it may namename, key_management
member.invitedWhat changedMember invitedFields it may nameemail, role
member.invitation_canceledWhat changedMember invitation canceledFields it may namenone
member.joinedWhat changedMember joinedFields it may namenone
member.role_changedWhat changedMember role changedFields it may namerole
member.removedWhat changedMember removedFields it may namekeys_revoked

In detail

How the API works

  • Run on real claims every day: The remittance reader, the claim status reading and the NPI check read live claims and remittances every day, and the 837P writer writes live Medicare secondary claims, each imported into the API, never copied. The rest, the 837I and 837D writers, the claim readers and edits, the payer directory, the eligibility and denial explainers, claim tracking, enrollment, the sandbox payers and your account, is Payerworks’ own code, written for this API.
  • What is kept, and for how long: A claim, a file or a remittance you send is answered and forgotten: never stored, never logged. A batch job is the one exception you ask for by name: it keeps your file until the job finishes and its result for 24 hours after, then deletes both. What is kept is a count of your key’s calls; your webhook’s address and signing secret; each webhook event queued for you, for 30 days, which holds the sandbox’s invented answer and, from what you sent, only your claim references and your file’s control numbers, or for an enrollment event only its ids, statuses and words (up to 2,000 events a UTC day); and for 24 hours a fingerprint of each request sent with an Idempotency-Key, never the request itself. Your webhook destinations (each one’s name, address, event types and signing secret, and what was posted to it, for as long as its event is kept), the address you set for notices and your keys’ names are kept until you remove them. Enrollment is the one part of the API that keeps what you send: the providers and enrollment requests you create (names, NPIs, tax ids, contacts and notes) and the PDFs you upload for a task, because a request lives for weeks and Payerworks people work it. They are for a practice’s business facts; never put a patient’s information in them. A test key’s providers and requests expire 30 days after their last change, and its PDFs 30 days after each was uploaded, or about a day after you delete one; a PDF uploaded but never confirmed goes after a day, whatever the key. A live key’s are kept until you delete them, and the copy of a deleted live PDF for 30 days more. Apart from that, our backups hold every PDF that was there each night, a test key’s included, for 7 days (35 for a night before 12/03/2026), and each Sunday’s for 14 days (180 for a Sunday before 12/06/2026, a year for one before 11/22/2026).
  • Errors you can act on: Every refusal comes back with a stable code, the path of the field, and a sentence a person can read. A rejection from a payer comes back the same way.
  • Honest about sending: The API builds, checks and reads every file, and the sandbox payers answer your test files end to end. It does not yet send a file to a real payer: transmission opens one payer at a time as Payerworks’ own routes go live, and until then you send on the connection you already have.
  • Test it without a call: A test key comes from this page and the sandbox payer answers it right away, with no meeting and no contract. A live key needs a signed business associate agreement first, because a live file carries real patients.
  • Answers pushed to you: Set a webhook and every answer the 837P claims sandbox makes, and every change to an enrollment request, is posted to your server as it is made, signed under the Standard Webhooks specification, so any of its libraries checks it. An event your server did not take is tried again, and every event can be listed and sent again for 30 days. Up to ten more webhook destinations, each with its own secret and its own event types, are each tried again on their own schedule for more than three days.

Keys and limits

  • Send your key on every call as Authorization: Bearer <key>.
  • A test key (pw_test_…) is yours from the form on this page, for invented data only. It writes test interchanges and runs the sandbox payer, and nothing sent with it reaches a payer.
  • A live key (pw_live_…) writes production files. Payerworks issues it once a business associate agreement is signed; ask from the form at the foot of the page.
  • Each key has a rate in calls a minute: a test key from this page has 60, and a key Payerworks issues has 120 unless another rate is agreed. The rate is counted in a window that resets at the start of each UTC minute. Every answer to a route called with a valid key, an error included, carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset (the seconds until the window resets), and the same figures in the RateLimit and RateLimit-Policy fields of the IETF draft. Past the limit the answer is 429 with retry-after. An answer given before a key is read carries none of them: a missing or invalid key, an unknown path (404), a method the route does not answer (405), a path that does not decode (400), or GET /v1/health, which takes no key.
  • A call the API turns away before any work is done is counted as refused, apart from your calls: over the rate, a body that is not JSON or is too large, a query it cannot read, or an Idempotency-Key it cannot read, already used for another request or still running.
  • A revoked key stops working within a minute.
  • An account is the keys one key started. POST /v1/keys makes a named key of your key’s own mode and rate, shown once, with an expiry if you want one (1 to 365 days); a key never outlives the key that made it: its expiry is the sooner of expires_in_days and the making key’s own, and the making key’s when none is asked. An account holds 3 test keys or 25 live ones that are not revoked. Every key of an account may list its keys, and make, rotate and revoke them unless the account’s organization chose that only its signed-in members do.
  • POST /v1/keys/{id}/rotate gives a key a new secret under the same key id, so its webhooks, events, usage and enrollments carry on. The old secret is still accepted for overlap_hours (24 by default, up to 720) and stops at once if the key is revoked; a second rotation ends the first one’s overlap. Two rotations at once: the first finishes, and the other answers 409 key_rotation_conflict and makes nothing.

Every route is under /v1. The base URL is shown with your key. The whole contract, machine-readable, is /openapi.json.

Safe to retry

Send an Idempotency-Key header with any POST, and with the webhook PUT, and a retry gets the first answer instead of a second run.

  • Use a new key for each new request: a UUID is a good one. A key is remembered for 24 hours.
  • A retry with the same key and the same request gets the first answer again, with the header idempotent-replayed: true. What the first request did is not done a second time, and the sandbox’s webhook events keep their ids, so your server can ignore one it already handled.
  • If the first answer said its webhook events could not be recorded or queued, and to retry, the retry with the same key does that step instead of repeating the refusal.
  • The same key with a different request is refused with 422. While the first request is still running, a retry is refused with 409 and retry-after.
  • An answer that failed on our side (a 5xx) is not remembered, so a retry runs the request again.
  • Payerworks keeps a fingerprint of the request and the moment it ran, so it can answer the same way again. It never keeps the request or the answer.
curlcurl
key=$(uuidgen)   # one new key per request; reuse it only to retry that request
curl "$PAYERWORKS_BASE_URL/v1/sandbox/claims" \
  -H "Authorization: Bearer $PAYERWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $key" \
  -d @claims.json
Node.jsJavaScript
import { randomUUID } from "node:crypto";

const key = randomUUID(); // one per request; the same key on every retry of it
for (let attempt = 0; attempt < 3; attempt++) {
  const res = await fetch(`${process.env.PAYERWORKS_BASE_URL}/v1/sandbox/claims`, {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.PAYERWORKS_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": key },
    body: JSON.stringify({ claims }),
  });
  if (res.status < 500 && res.status !== 409 && res.status !== 429) {
    console.log(res.headers.get("idempotent-replayed") === "true" ? "the first answer, again" : "answered");
    break;
  }
  await new Promise((r) => setTimeout(r, 1000 * Number(res.headers.get("retry-after") || 1)));
}
PythonPython
import os, time, uuid, requests

key = str(uuid.uuid4())  # one per request; the same key on every retry of it
for attempt in range(3):
    res = requests.post(
        f"{os.environ['PAYERWORKS_BASE_URL']}/v1/sandbox/claims",
        headers={"Authorization": f"Bearer {os.environ['PAYERWORKS_API_KEY']}", "Idempotency-Key": key},
        json={"claims": claims},
    )
    if res.status_code < 500 and res.status_code not in (409, 429):
        break
    time.sleep(int(res.headers.get("retry-after", "1")))

Client libraries and an MCP server

Three files, generated from the same route list as this page and openapi.json, so every route here is a method there. Each is plain source with no dependencies: download it, read it, and keep it in your own repository.

  • /sdk/payerworks.mjs: JavaScript. An ES module for Node 18 or later, on your server: one method per route, typed in JSDoc, and uploadDocument for an enrollment task’s PDF. Your key is a bearer key, so never put it in browser code.
  • /sdk/payerworks.py: Python. For Python 3.9 or later, the standard library only: one method per route.
  • /sdk/payerworks-mcp.mjs: MCP server. For an AI agent: run it with node over stdio, and each route that answers a question is a tool, with the reads of your account and your enrollment requests, except the routes that answer with a PDF, the two that read a picture with a model, and the enrollment export. Setting, removing or testing your webhook, sending an event again, and every change to a provider, an enrollment request, a task, a document, a key or a destination stay with you. One tool writes to your account: a sandbox claims run records its events and posts them to your webhook, when one is set.
  • The JavaScript and Python clients each send an Idempotency-Key on every POST and PUT, and retry a 429, a 503 or a 409 idempotency_in_flight at most twice, after the wait retry-after names, with the same key. A refusal is a PayerworksError carrying the status, the code, the sentence and the request id.
  • The two clients also each check a webhook’s signature, in the Standard Webhooks headers or the Payerworks-Signature header, in constant time.
  • The MCP server makes its calls the same way: an Idempotency-Key on every POST its tools send, and the same retries with the same key, waiting at most 30 seconds. A refusal reaches the model as a tool error carrying the status, the code, the sentence and the request id.
  • Both clients can keep your own request log: requestLog: true (request_log=True in Python) keeps the last 1,000 attempts in your process, a number keeps that many, and requestLogFile (request_log_file) appends one JSON line an attempt to a file of yours. Each entry is the method, the path, the status, the request id, the time it took and the Idempotency-Key, never a body, a query or a header. Payerworks keeps no such record of your calls.
  • Each of the three calls only the base URL you give it, never follows a redirect, and sends nothing anywhere else. The one exception is the JavaScript client’s uploadDocument, which posts your PDF, without your key, to the https upload address the API answered for it. Download again when this page lists a new route: each file names the build it was made from.

Add the MCP server to your AI client’s configuration:

Node.jsJavaScript
// Download /sdk/payerworks.mjs from this site into your project.
import { Payerworks, PayerworksError } from "./payerworks.mjs";

const pw = new Payerworks({ apiKey: process.env.PAYERWORKS_API_KEY, baseUrl: process.env.PAYERWORKS_BASE_URL });
try {
  const { valid, claims } = await pw.postClaimsValidate({ claim });
  const page = await pw.getEvents({ query: { limit: 10 } });
} catch (e) {
  if (e instanceof PayerworksError) console.log(e.status, e.code, e.message, e.requestId);
}
PythonPython
# Download /sdk/payerworks.py from this site into your project.
from payerworks import Payerworks, PayerworksError

pw = Payerworks()  # PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL from the environment
try:
    checked = pw.post_claims_validate({"claim": claim})
    page = pw.get_events(query={"limit": 10})
except PayerworksError as e:
    print(e.status, e.code, e.request_id)
MCPJSON
{
  "mcpServers": {
    "payerworks": {
      "command": "node",
      "args": ["/absolute/path/to/payerworks-mcp.mjs"],
      "env": { "PAYERWORKS_API_KEY": "pw_test_...", "PAYERWORKS_BASE_URL": "<the address shown with your key>" }
    }
  }
}

Example

keys.mjs runs every step below against the API with a test key. It needs payerworks.mjs and sample-data.mjs beside it.

keys.mjsJavaScript
// Payerworks example: keys and your account. Docs: https://payerworks.com/docs/keys
//
// 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 keys.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. Health needs no key, and says the API transmits nothing.
  const health = await pw.getHealth();

  // 2. Your key's rate a minute, and its calls this month to date by UTC day.
  const account = await pw.getAccount();

  // 3. A named key for one job, shown once, then revoked. Every key of an account may manage its keys,
  //    unless the account's organization chose that only its signed-in members do.
  const made = await pw.postKeys({ name: 'Example job', expires_in_days: 1 });
  const revoked = await pw.deleteKeysById(made.key_id);

  // 4. The account's audit log: who made and revoked that key, when, and through which door, newest first.
  const log = await pw.getAuditLog({ query: { limit: 2 } });

  // 5. The failure path: a key id this account never had.
  const refused = await refusalOf(() => pw.deleteKeysById('pwk_0000000000000000'), { PayerworksError });

  return {
    transmits: health.transmits,
    mode: account.mode,
    rpm: account.rpm,
    made: { key_id: made.key_id.startsWith('pwk_'), shown_once: typeof made.key === 'string' },
    revoked: Boolean(revoked),
    audit: log.data.map((e) => ({ type: e.type, by: e.actor.type, door: e.door })),
    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
{
  "transmits": false,
  "mode": "test",
  "rpm": 600,
  "made": {
    "key_id": true,
    "shown_once": true
  },
  "revoked": true,
  "audit": [
    {
      "type": "key.revoked",
      "by": "key",
      "door": "api"
    },
    {
      "type": "key.created",
      "by": "key",
      "door": "api"
    }
  ],
  "refused": {
    "status": 404,
    "code": "key_not_found",
    "request_id": "req_6"
  }
}

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