POST /upload is the entry point for document processing. Every accepted upload returns a document_id, which becomes the handle for polling, streaming, and downstream bookkeeping.
Supported request shapes
Send a url
Use url when the document is already available at a fetchable HTTPS location.
Send file_base64
Use file_base64 when your application sends document bytes inline in the JSON payload.
Inline base64 uploads are supported up to 50 MB.
Required fields
Every upload includes:file_name: the original filename shown in downstream responsesxn_address: the Xactnet recipient address tied to the document
urlfile_base64
422.
Encode a local file to base64
These examples show the local-file-to-base64 step that teams often use before constructing an inline upload request, including workflows that start with scanner images or other local files.Python
Node.js
curl
Use the base64 string as the file_base64 field in the upload request:
What to store after upload
Persist at least these response fields on your side:document_idstatuscreated_atstatus_url
Validation and retries
- Review
422responses first when an upload is rejected. They indicate request-shape problems such as sending bothurlandfile_base64, sending neither field, or omitting a required field. - Retry upload failures from the same source document after correcting the request or transport problem.
- Reuse the returned
document_idfor all follow-up status checks, realtime subscriptions, and internal job mapping.
Typical follow-up flow
- Upload the document.
- Store
document_idon your internal job or claim record. - Poll
GET /status/{document_id}for simple backends, or open a realtime stream for richer UX. - Optionally query
GET /documentsto reconcile the authenticated organization’s recent uploads.