Documents API
Upload documents with real-time classification. Returns instant feedback on document type and validity. For bank statements, includes coverage information showing required date ranges.
POST
/api/v1/applications/{applicationId}/documentsUpload a document (PDF, JPEG, PNG) with synchronous classification. The endpoint classifies the document type and determines validity. For bank statements, it checks coverage against all statements on the application and returns missing date ranges if any.
Request Body
{
"file": "multipart/form-data",
"documentType": "BANK_STATEMENT"
}Response
{
"documentId": "660e8400-e29b-41d4-a716-446655440000",
"classified": true,
"type": "BANK_STATEMENT",
"valid": true,
"classification": {
"classification": "BANK_STATEMENT",
"statementDate": "12/31/2024",
"startDate": "10/01/2024",
"endDate": "12/31/2024",
"accountHolder": "John Doe",
"institutionName": "Chase Bank",
"accountType": "CHECKING"
},
"coverage": {
"status": "complete",
"requiredStart": "2024-01-01",
"requiredEnd": "2024-12-31",
"documentStart": "2024-10-01",
"documentEnd": "2024-12-31"
}
}Examples
cURL
curl -X POST https://api.growstacked.com/api/v1/applications/550e8400-e29b-41d4-a716-446655440000/documents \
-H "X-API-Key: sk_tenant_yourcode_abc123..." \
-F "file=@statement.pdf" \
-F "documentType=BANK_STATEMENT"Document Types
Supported Document Types
BANK_STATEMENT- Bank statements with coverage checking (only document type that includes coverage information in response)TAX_RETURN- Tax return documentsID- Identity documents
File Requirements
Upload Specifications
- Maximum file size: 10MB
- Supported formats: PDF, JPEG, PNG
- Files are validated by magic bytes to prevent spoofing