Finance & accountingUS W-2 EFW2
efw2.validate
Check a tax-year 2026 SSA, Maryland or Pennsylvania EFW2 file against the published format and reconcile its count and money totals. Price per employee-state, based on complete fixed-width records with an employee identity.
https://api.kanagu.dev/v1/efw2/validate- Price
- $0.15 per employee-state, on successful calls only
- Authentication
- API key required.
- MCP
call_operationwithoperation: "efw2.validate"athttps://api.kanagu.dev/mcp- Markdown
- /docs/efw2.validate.md
Compliance coverage
- Jurisdictions
- Jurisdictions: US
- Standards
- SSA Publication 42-007Tax year 2026, version 42026-11-12Source
- Maryland Employer Reporting of W-2s Instructions and SpecificationsTax year 2026, version 1.02026-09-27Source
- Pennsylvania myPATH W-2 Wage Records (EFW2)Undated web specification, snapshot 2026-11-262026-11-26Source
- 26 CFR § 1.224-1(h), Table 1TD 100442026-04-13Source
- Verification
- efw2.generate checks generated files and efw2.validate checks submitted files locally against published fixed-width, sequence, field and total rules.
- Last reviewed
- 2026-11-26
curl https://api.kanagu.dev/v1/efw2/validate \
-H "Authorization: Bearer $KANAGU_KEY" \
-H "Content-Type: application/json" \
-d '{"destination":"SSA","text":"RA"}'const res = await fetch("https://api.kanagu.dev/v1/efw2/validate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KANAGU_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"destination": "SSA",
"text": "RA"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();curl https://api.kanagu.dev/mcp \
-H "Authorization: Bearer $KANAGU_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"call_operation","arguments":{"operation":"efw2.validate","input":{"destination":"SSA","text":"RA"}}}}'{
"destination": "SSA",
"text": "RA"
}Request body
application/json
destination"SSA" | "MD" | "PA"textstring (max 2100000 chars)required
Response
200 · application/json
status"pass" | "invalid" | "needs_review"requiredfindingsarray of objectrequiredfindings[].severity"error" | "needs_review"requiredfindings[].destination"SSA" | "MD" | "PA"requiredfindings[].rulestringrequiredfindings[].lineinteger (≤ 9007199254740991)findings[].columninteger (≤ 9007199254740991)findings[].inputstringfindings[].fieldstringrequiredfindings[].expectedstringrequiredfindings[].actualstringrequiredfindings[].sourcestring (uri)requiredbillableEmployeeStatesinteger (0 to 9007199254740991)requiredverificationobjectrequiredverification.method"published_specification"requiredverification.agencyPortal"not_run"requiredverification.standardsarray of objectrequiredverification.standards[].namestringrequiredverification.standards[].versionstringrequiredverification.standards[].datestring (date)requiredverification.standards[].urlstring (uri)requiredrecordCountinteger (0 to 9007199254740991)requiredemployerCountinteger (0 to 9007199254740991)requiredemployeeCountinteger (0 to 9007199254740991)requiredstateRecordCountinteger (0 to 9007199254740991)requiredomittedFindingsinteger (0 to 9007199254740991)required
Try it
Errors
Errors are JSON {"error":{"code","message"}}. An operation may add its own 400 codes; the message says what to fix.
| Status | Code and meaning |
|---|---|
| 400 | invalid_inputThe body does not match the request schema. The message names each field. |
| 400 | invalid_jsonThe body is missing or is not valid JSON. |
| 400 | invalid_idempotency_keyIdempotency-Key must be 1–128 visible ASCII characters. |
| 401 | invalid_api_keyThe Bearer key is missing, malformed, invalid or inactive. |
| 402 | free_allowance_exhaustedThis month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left. |
| 404 | not_foundNo operation at this path. |
| 409 | idempotency_conflictThe Idempotency-Key was already used with a different body. |
| 413 | payload_too_largeJSON bodies may be at most 64 KiB. |
| 500 | internal_errorThe call failed on our side. It is not billed; retry with the same Idempotency-Key. |
JSON Schema
Request schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"destination": {
"default": "SSA",
"type": "string",
"enum": [
"SSA",
"MD",
"PA"
]
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 2100000
}
},
"required": [
"text"
],
"additionalProperties": false,
"examples": [
{
"destination": "SSA",
"text": "RA"
}
]
}Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"pass",
"invalid",
"needs_review"
]
},
"findings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"severity": {
"type": "string",
"enum": [
"error",
"needs_review"
]
},
"destination": {
"type": "string",
"enum": [
"SSA",
"MD",
"PA"
]
},
"rule": {
"type": "string"
},
"line": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"column": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"input": {
"type": "string"
},
"field": {
"type": "string"
},
"expected": {
"type": "string"
},
"actual": {
"type": "string"
},
"source": {
"type": "string",
"format": "uri"
}
},
"required": [
"severity",
"destination",
"rule",
"field",
"expected",
"actual",
"source"
],
"additionalProperties": false
}
},
"billableEmployeeStates": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"verification": {
"type": "object",
"properties": {
"method": {
"type": "string",
"const": "published_specification"
},
"agencyPortal": {
"type": "string",
"const": "not_run"
},
"standards": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"date": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": [
"name",
"version",
"date",
"url"
],
"additionalProperties": false
}
}
},
"required": [
"method",
"agencyPortal",
"standards"
],
"additionalProperties": false
},
"recordCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"employerCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"employeeCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"stateRecordCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"omittedFindings": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"status",
"findings",
"billableEmployeeStates",
"verification",
"recordCount",
"employerCount",
"employeeCount",
"stateRecordCount",
"omittedFindings"
],
"additionalProperties": false
}