Headers
X-Medsender-Signature:HMAC-SHA256 signature for verifying authenticity
When operations complete (send fax, receive fax, direct message, email, AI document), Medsender POSTs to your callback_url. Use this to update your system.
X-Medsender-Signature: HMAC-SHA256 signature for verifying authenticityCallbacks include an X-Medsender-Signature header so you can confirm the request came from Medsender before trusting the payload. The header is a lowercase hex HMAC-SHA256 digest, keyed with your API key, over the callback's token and timestamp concatenated together. Verification is currently supported for the three callback types in the table below; other callback types carry the header but cannot yet be verified from their payloads.
X-Medsender-Signature header using a constant-time comparison.| Callback type | Form field | Token | Timestamp | Signing key |
|---|---|---|---|---|
| Sent Fax | recordDetails | sendToken | completedAt | Test key when isTest is true, otherwise live key |
| Received Fax | recordDetails | sendToken | completedAt | Test key when isTest is true, otherwise live key |
| AI Document | AiDocumentDetails | aiResult.aiToken | aiResult.completedAt | Always the live key |
completedAt is JSON null, concatenate the literal string null (for example, sendToken + null).sha256= prefix.401 — see the Retry section below for redelivery behavior.Callbacks are sent as form data with a JSON string in a named field. Parse the form field, then parse the JSON inside.
recordDetails field with JSON string (keys in camelCase)recordDetails field with JSON string + file field with PDF attachment (keys in camelCase)AiDocumentDetails field with JSON string (nested keys in camelCase)If your endpoint returns a non-2xx response, fax callbacks are retried at intervals over the following hours (a 405 response is treated as permanent and is not retried). AI Document callbacks are not retried after your endpoint returns a response — but if no response is received (timeout or connection failure), delivery may be reattempted, so handle AI callbacks idempotently using aiToken.
Parse the form-urlencoded body and extract the JSON from the appropriate field.
Triggered after a fax finishes sending. Form field: recordDetails
Payload Fields
| Field | Description |
|---|---|
| sendToken | Unique identifier for this fax |
| fromNumber | Your Medsender fax number that sent this fax |
| toNumber | Destination fax number |
| sentStatus | Delivery status: "success" or "failure" |
| sentAt | When the fax was queued (ISO 8601) |
| completedAt | When the fax finished sending (ISO 8601) |
| numPages | Number of pages sent |
| errorDetails | Error message if sentStatus is "failure" |
| isTest | Whether this was a test fax |
| secureLink | URL to download the fax PDF |
Triggered after a fax is received on your number. Form field: recordDetails + file (PDF attachment)
Payload Fields
| Field | Description |
|---|---|
| sendToken | Unique identifier for this fax |
| fromNumber | Sender's fax number |
| toNumber | Your Medsender fax number that received it |
| callerName | Caller ID name from sender |
| faxStatus | Reception status: "success" or "failure" |
| sentAt | When transmission started (ISO 8601) |
| completedAt | When reception completed (ISO 8601) |
| numPages | Number of pages received |
| isTest | Whether this was a test fax |
| client | Client ID if the number is assigned to a client |
| callbackStatus | Webhook delivery status |
AI Extraction Fields (when enabled for your account):
| documentClassification | Document type: "Referral", "Lab Result", etc. |
| patientName | Full patient name extracted |
| patientFirstName | Patient first name |
| patientLastName | Patient last name |
| patientDob | Patient date of birth |
| insuranceMemberId | Insurance member ID |
| codes | Array of medical codes (CPT, ICD, etc.) |
Triggered after AI processing completes. Form field: AiDocumentDetails. All keys, including those inside aiResult, are camelCase.
Payload Fields (inside aiResult)
| Field | Description |
|---|---|
| aiToken | Unique identifier for this AI document request |
| documentClassification | Document type: "Referral", "Lab Result", etc. |
| documentSummary | AI-generated summary of the document |
| patientName | Full patient name extracted |
| patientDob | Patient date of birth (YYYY-MM-DD) |
| patientPhoneNumber | Patient phone number |
| patientGender | Patient gender |
| insuranceMemberId | Insurance member ID |
| icdCodesJson | Array of ICD codes |
| cptCodesJson | Array of CPT codes |
| completedAt | When processing completed (ISO 8601) |
| errorDetails | Error message if processing failed |