# MyFax API Reference — Exult Healthcare

**Status:** ACTIVE service, NO direct API on current tier
**Verified:** 2026-04-11
**Config file:** `/Users/agent/pi-mono/.config/exult/myfax.json` (gitignored)
**Build log:** `/Users/agent/pi-mono/.pi/services/myfax_integration/build_log.md`

## What the account is

- Product: **MyFax consumer plan** by Consensus Cloud Solutions (formerly j2 Global)
- Historical account holder: Deepika Bhargava M.D PA
- Current delivery mailbox: `fax@exulthealthcare.com` (changed from `info@` on 2024-02-20)
- Account-level emails (welcome / billing / fee changes) land in: `exult-info@exulthealthcare.com`
- Fax numbers: **+1 469 214 7801** (primary), **+1 214 540 9470**
- Annual plan: $66/yr, 1000 inbound pages/mo, 0 outbound included, $0.10 per extra page
- Portal: https://central.myfax.com/
- Send-via-email: `E164NumberNoPlus@send.myfax.com`
- Support: 1-866-378-2373 / support@myfax.com / billing@myfax.com

## Auth

- **No API key exists.** Consumer MyFax does not expose REST/SOAP APIs.
- Legacy SOAP endpoint `https://ws.myfax.com/2010/01/sending.asmx` is **DEAD** as of 2026-04-11 (returns HTTP 400, `Unable to process unknown request`).
- Portal login credentials unknown — 2022 welcome email had a temporary password that must be assumed rotated. Use password reset at central.myfax.com if portal access is needed.

## Upgrade path for real API

To get a real fax API, account must be **upgraded to eFax Corporate or eFax Developer** (separate Consensus product):
- Sales: 1-866-378-2373 or https://www.efax.com/products/fax-api
- REST API over HTTPS, TLS 1.2, HITRUST CSF certified, HIPAA BAA available
- Separate contract + new credentials. Not a config flip.
- Required for any serious outbound fax automation.

## Working interim API via Microsoft Graph

Until Exult upgrades, use Graph on `fax@exulthealthcare.com` as the fax ingestion layer.

### Auth

Same as other Graph integrations — use `/Users/agent/pi-mono/.config/exult/microsoft365.json` (Exult Agent Service, client_id `6725660a-f83a-4cb0-8892-14a223e0a701`, has Mail.Read + Mail.ReadWrite). Client credentials flow, token from `login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token`.

### Endpoints

**List inbound faxes (last 24h):**
```
GET https://graph.microsoft.com/v1.0/users/fax@exulthealthcare.com/messages
  ?$filter=from/emailAddress/address eq 'noreply@myfax.com'
          and receivedDateTime ge {ISO8601}
  &$count=true
  &$select=id,subject,hasAttachments,receivedDateTime
Authorization: Bearer {token}
ConsistencyLevel: eventual
```
Returns ~20-100 messages/day typically. Subjects follow the pattern ` MyFax message from "{sender}" - {N} page(s)` (note leading space).

**Get fax PDF attachment:**
```
GET https://graph.microsoft.com/v1.0/users/fax@exulthealthcare.com/messages/{id}/attachments
Authorization: Bearer {token}
```
Returns array — the PDF is the item with `contentType: application/pdf`. Use `contentBytes` (base64).

**Send outbound fax (requires Gautam approval per-fax):**
```
POST https://graph.microsoft.com/v1.0/users/agent@exulthealthcare.com/sendMail
Authorization: Bearer {token}
Content-Type: application/json

{
  "message": {
    "subject": "Fax document",
    "body": { "contentType": "Text", "content": "Sent via MyFax gateway." },
    "toRecipients": [
      { "emailAddress": { "address": "{E164NumberNoPlus}@send.myfax.com" } }
    ],
    "attachments": [
      {
        "@odata.type": "#microsoft.graph.fileAttachment",
        "name": "doc.pdf",
        "contentType": "application/pdf",
        "contentBytes": "{base64}"
      }
    ]
  }
}
```

## Permissions / scopes required

Already present on Exult Agent Service app:
- `Mail.Read` (app-only) — inbound fax ingestion
- `Mail.ReadWrite` (app-only) — marking faxes as read, moving to folders
- `Mail.Send` (app-only) — **WARNING**: check before using. Historically not granted; may need admin consent.

## HIPAA posture

- Inbound faxes contain PHI. Do **not** copy fax bodies or attachments into git-tracked paths.
- Attachment retrieval OK as in-memory processing only.
- BAA status with MyFax: **unconfirmed** — consumer tier doesn't clearly offer one. Need to request via support@myfax.com parallel to the existing RingCentral BAA thread in gautam@ inbox.

## Related

- See `reference_admin_credentials.md` for the central credentials index.
- See `reference_amd_api.md` — AdvancedMD is the system of record for patient fax attribution.
- See `reference_rc_transcripts.md` — RingCentral does the voice side; MyFax does fax.
