Skip to main content
POST
Upload a MedEx case document

Authorizations

X-API-Key
string
header
required

Public API key: cxp_<hex> (firm-scoped) or cxpp_<hex> (provider-scoped). Required on every request.

Path Parameters

caseId
string<uuid>
required

MedCase UUID

Body

multipart/form-data
file
file
required

The file. Max 25 MB.

category
enum<string>
required

Document type. A retainer_hipaa_release uploaded with a firm key is hidden from providers until the firm shares it in Med Xchange.

Available options:
medical_records,
imaging,
intake_form,
insurance_card,
prescription,
lien_auth,
hipaa_auth,
retainer_hipaa_release,
demand_letter,
settlement,
correspondence,
police_report,
invoice,
statement,
ledger,
payment_receipt,
claim_form,
other
appointmentId
string<uuid>

Attach to this appointment. Must belong to the case.

note
string
Maximum string length: 2000
externalId
string

Your system's id for this upload. Unique per organisation (your practice or firm) across all cases. Re-sending the same externalId with the same case, category, appointmentId, note, supersedesDocumentId and file bytes returns the existing document (200, meta.replayed=true) without storing anything; anything different returns 409 external_id_conflict with error.details.existingId. The comparison is against the stored record as it is now: if the document it replaced was deleted since, a retry returns 409 external_id_conflict. Leading and trailing whitespace is trimmed; an empty or whitespace-only value is a 400 validation_error. Without an externalId an upload is never deduplicated, so always send one from an integration.

Required string length: 1 - 200
supersedesDocumentId
string<uuid>

Replace an earlier document your organisation uploaded to this case (e.g. a corrected claim form). The earlier document stays listed and downloadable with supersededAt and supersededByDocumentId set. It must be your own direct upload (not a synced document) on this case and not already replaced; otherwise 409 invalid_supersede.

notify
boolean
default:true

Send "false" to skip the email notifications for this upload. The activity log entry and the document.uploaded webhook are always written.

Response

Replay: the externalId was already used for this same upload. The existing document is returned; nothing is stored, logged, emitted or emailed, and meta.replayed is true.

data
object
required
meta
object
required