Endpoint
| Method | Path | Description |
|---|---|---|
POST | /v1/accounts/{accountId}/documents/upload | Upload a compliance document to an account |
Upload a document
Accepts a Base64-encoded file along with its document type classification. The platform processes the upload and associates it with the account for compliance review.POST /v1/accounts/{accountId}/documents/upload
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string (UUID) | ✅ | The Buildmarkets account to attach the document to |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
document_type | string | ✅ | Classification of the document. See supported types below |
document_sub_type | string | ❌ | Free-form sub-classification (e.g., "passport", "drivers_license", "utility_bill") |
content | string | Conditional | Base64-encoded binary content of the document. Required for all types except w8ben. Maximum size: 10MB |
content_data | object | Conditional | JSON form data. Used only for w8ben document type in place of content |
mime_type | string | ❌ | MIME type of the uploaded file (e.g., "image/png", "image/jpeg", "application/pdf") |
Supported document_type values
| Value | Description |
|---|---|
identity_verification | Government-issued photo ID (passport, driver’s license, national ID) |
address_verification | Proof of address (utility bill, bank statement, lease) |
date_of_birth_verification | Document verifying date of birth |
tax_id_verification | Document verifying Social Security Number or ITIN |
account_approval_letter | Approval letter for account opening |
cip_result | Customer Identification Program result document |
w8ben | IRS Form W-8BEN (Certificate of Foreign Status) — submitted as content_data JSON, not Base64 |
w9 | IRS Form W-9 (Request for Taxpayer Identification) |
company_formation | Certificate of incorporation or equivalent |
entity_operating_document | Operating agreement or bylaws (for entity accounts) |
entity_registration | State registration filing |
hio_declaration_form | Household/Immediate Office declaration form |
limited_trading_authorization | Authorization for a third party to trade on the account |
pep_declaration_form | Politically Exposed Person declaration |
Response
Returns204 No Content on success. No body is returned.
Example requests
Identity verification — passport (image)
Address verification — utility bill (PDF)
W-8BEN — JSON form data
Thew8ben document type accepts form data as a JSON object in content_data rather than a Base64-encoded file. The structure mirrors the IRS W-8BEN form fields.
Response
File size and format limits
| Constraint | Limit |
|---|---|
| Maximum file size | 10MB per upload |
| Supported image types | image/png, image/jpeg, image/gif, image/webp |
| Supported document types | application/pdf |
| Encoding | Base64 (standard encoding, no line breaks required) |
Tip: If you’re encoding in JavaScript, useBuffer.from(fileBuffer).toString('base64'). In Python, usebase64.b64encode(file_bytes).decode('utf-8').
Common errors
| HTTP Status | Error | Cause |
|---|---|---|
400 | INVALID_DOCUMENT_TYPE | document_type is not one of the supported values |
400 | CONTENT_REQUIRED | content is missing for a non-w8ben document type |
400 | CONTENT_DATA_REQUIRED | content_data is missing for the w8ben document type |
400 | FILE_TOO_LARGE | Decoded file exceeds the 10MB size limit |
400 | INVALID_MIME_TYPE | The mime_type is not supported |
404 | ACCOUNT_NOT_FOUND | No account found for the provided accountId |
Next steps
- W-9 Requests → — Generate W-9 forms programmatically for a user
- Retrieving Documents → — Access documents that have been generated for an account
- Account Opening → — Review the KYC fields collected at account creation
W-9 Requests Documentation
Overview
The W-9 endpoint enables automated generation of IRS Form W-9 (Request for Taxpayer Identification Number and Certification) for specified users. As the documentation states, “W-9s are required for U.S. persons and entities to certify their taxpayer identification number.”Key Endpoint
POST/v1/documents/w9 — Initiates W-9 generation for a user
Request Details
The endpoint requires a single query parameter:userId(string, UUID format) — The unique identifier for the user
Response Structure
A successful request (200 OK) returns:successful(boolean) — Confirms request acceptancemessage(string) — Status confirmation text
Processing Timeline
The endpoint confirms immediate receipt, but form generation occurs asynchronously. Users can later retrieve the completed W-9 using the document listing endpoint withdocumentTypeID: 3 and the relevant year.