Upload business documents
Changed onThis POST endpoint is used to upload documents for a business created with POST /business: a KYB report, articles of incorporation, a proof of address, and so on. <br> You must specify the business_token in the URL path. The caller must be the account that created the business, or the business itself using its own API key. <br> In the request body, include an array of documents. Each document requires a document_type, the original file_name (with its extension) and its Base64-encoded file_content; an optional description adds context, for other in particular. <br> Every document is validated and virus-scanned before any is stored, so a rejected document rejects the whole request and nothing is written. <br> A document may be at most 4,500,000 bytes once decoded and a request may carry at most 10 documents; the whole request must also stay under the 6 MB API limit (Base64 adds a third to each file), so larger sets go in several requests to POST /business/{business_token}/documents. <br> The response lists the documents stored, in request order, each with its document_token. A document that could not be stored is left out: compare the response with what you sent and resend what is missing. Uploads only add documents; nothing already on file is replaced.
Request
- Base URLhttps://api.masspay.io/v1.0.0
- Auth
- API key in header Authorization
- or API key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"documents": [
{
"document_type": "kyb_report",
"file_name": "kyb-report-apple-inc.pdf",
"file_content": "JVBERi0xLjQK...",
"description": "KYB report from Middesk, run 2026-10-01"
}
]
}Response
OK
Example response
{
"business_token": "0b9f5c2e-4a1d-4c7e-9f3a-2d8e6b1c4f57",
"documents": [
{
"document_token": "doc_8c5f1d2a-7b3e-4f9a-a1c6-3e2d9b8f7a10",
"document_type": "kyb_report",
"file_name": "kyb-report-apple-inc.pdf",
"size_bytes": 184322,
"description": "KYB report from Middesk, run 2026-10-01",
"time_uploaded": "2026-10-21T18:42:07"
}
]
}Changes
- info
endpoint added
- info