Home / Developers
Affirm Core API
Will this be affirmed, and what is missing? The same engine behind AffirmDME, callable from an ERP, an intake platform or your own scripts.
Access
Keys are issued by AffirmDME for one organization after its Business Associate Agreement is signed and the integration partner's agreement is on file. An organization admin requests a key under Settings → Integrations; the key's secret reaches the person who will install it through a one-time link that expires after 24 hours, never by email. The organization's admins see every key there and can revoke it at any time. Not a customer yet? Write to support@affirmdme.com. The steps are in the help article on API access.
Authorization: Bearer adk_… - Scopes.
readfor cases, documents, checklist, findings and activity;writeto create and update cases, mark them submitted and add documents. - Rate limit. Per key, per minute;
X-RateLimit-Limit,X-RateLimit-RemainingandRetry-Afteron 429. - Attribution. Every write appears in the case's activity trail as the key that made it.
The flow
GET /api/v1/orgfor the organization's locations (PTAN, NPI, jurisdiction, DME MAC).POST /api/v1/caseswith the beneficiary, the ordering practitioner and the HCPCS items.POST /api/v1/upload-url, PUT the PDF to the returned URL, thenPOST /api/v1/documents/{documentId}/process.GET /api/v1/cases/{caseId}/checklist— every coverage criterion MET, MISSING or FLAGGED, with what the record still has to say;/findingsfor the model's rationale and evidence.POST /api/v1/cases/{caseId}/submit, thenPATCHthe decision when the MAC answers.
Webhooks
An organization's admins register HTTPS endpoints for case.status_changed,
checklist.rebuilt and decision.recorded. Each delivery is a POST with
X-AffirmDME-Signature: t=<unix seconds>,v1=<hex> where
v1 = HMAC-SHA256(secret, t + "." + body); reject timestamps older than five minutes.
Failed deliveries retry after 1, 5 and 15 minutes. Payloads carry case identifiers and statuses,
never patient details.
import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(secret, header, rawBody) {
const { t, v1 } = Object.fromEntries(header.split(",").map((kv) => kv.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return expected.length === v1.length && timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
} Reference
The OpenAPI 3.1 document is served by the API itself and is the source of truth for paths, request bodies and responses: https://api.affirmdme.com/api/v1/openapi.json.