POST
/
api
/
v2.1
/
verifications
/
{verificationId}
/
documents
{
  "data": {
    "documentId": "<string>",
    "status": "<string>",
    "uploadedAt": "<string>"
  }
}

Overview

The Upload Verification Documents endpoint allows you to submit required documents for an active verification process. The documents are sent as base64-encoded content within a JSON payload, supporting various document types based on the verification requirements.

Path Parameters

verificationId
string
required
The ID of the verification request (obtained from Create Verification)

Headers

Authorization
string
required
Bearer token for authentication
X-Tenant-ID
string
required
Tenant identifier for multi-tenant operations
Content-Type
string
required
Must be application/json

Request Body

docId
string
required
Unique identifier for the document (typically a UUID)
documentType
string
required
Type of document being uploaded:
  • GOVERNMENT_ID - Passport, ID card, driver’s license
  • PROOF_OF_ADDRESS - Utility bill, bank statement
  • SOURCE_OF_FUNDS - Income statements, bank records
  • BENEFICIAL_OWNERSHIP - Company ownership documents
  • PEP_DECLARATION - Politically exposed person declaration
  • BANK_STATEMENT - Account statements
  • INCOME_PROOF - Salary slips, tax returns
fileName
string
required
Name of the file (e.g., “passport.pdf”)
fileContent
string
required
Base64-encoded file content
customerId
string
required
ID of the customer being verified
description
string
Additional description or notes about the document

Response

data
object
Document upload confirmation

Example Request

curl --request POST \
  --url https://api.finhub.cloud/api/v2.1/verifications/ver_abc123def456/documents \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'X-Tenant-ID: fh_api_finsei_ltd_7f957f77' \
  --header 'Content-Type: application/json' \
  --data '{
    "docId": "550e8400-e29b-41d4-a716-446655440000",
    "documentType": "GOVERNMENT_ID",
    "fileName": "passport.pdf",
    "fileContent": "JVBERi0xLjMKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovT3V0bGluZXMgMiAwIFIKL1BhZ2VzIDMgMCBSCj4+CmVuZG9iago...",
    "customerId": "cust_123456789",
    "description": "Identity verification for medium-risk client"
  }'
```text`n## Example Response

```json
{
  "data": {
    "documentId": "doc_xyz789ghi123",
    "status": "UPLOADED",
    "uploadedAt": "2025-01-23T10:35:00.000Z"
  }
}
```text`n## Document Requirements by Risk Level

| Risk Level | Required Documents |
|------------|-------------------|
| Low Risk | GOVERNMENT_ID |
| Medium Risk | GOVERNMENT_ID, PROOF_OF_ADDRESS, SOURCE_OF_FUNDS |
| High Risk | GOVERNMENT_ID, PROOF_OF_ADDRESS, SOURCE_OF_FUNDS, BENEFICIAL_OWNERSHIP, PEP_DECLARATION |

## File Encoding Example

To convert a file to base64 for the API:

```javascript
// Node.js example
const fs = require('fs');

function fileToBase64(filePath) {
  const fileBuffer = fs.readFileSync(filePath);
  return fileBuffer.toString('base64');
}

const base64Content = fileToBase64('./documents/passport.pdf');

// PowerShell example
$fileContent = [System.Convert]::ToBase64String(
  [System.IO.File]::ReadAllBytes("C:\documents\passport.pdf")
);
```text`n## Bulk Document Upload

For multiple documents, iterate through the required documents:

```javascript
const requiredDocuments = [
  { name: "passport.pdf", type: "GOVERNMENT_ID", purpose: "Identity verification" },
  { name: "utility_bill.pdf", type: "PROOF_OF_ADDRESS", purpose: "Address verification" },
  { name: "bank_statement.pdf", type: "SOURCE_OF_FUNDS", purpose: "Source of funds verification" }
];

for (const doc of requiredDocuments) {
  const fileContent = fileToBase64(`./documents/${doc.name}`);
  
  await uploadDocument({
    docId: generateUUID(),
    documentType: doc.type,
    fileName: doc.name,
    fileContent: fileContent,
    customerId: customerId,
    description: doc.purpose
  });
}
```text`n## Document Size Limits

- Maximum file size: 10MB per document
- Supported formats: PDF, JPG, PNG, JPEG
- Files are validated for format and content integrity

## High-Value Transaction Documents

For transactions above €10,000, additional documents may be required:

```javascript
const highValueDocuments = [
  { 
    name: "proof_of_funds_origin.pdf",
    type: "PROOF_OF_FUNDS",
    purpose: "Source of funds verification for high-value transaction"
  },
  { 
    name: "income_verification.pdf",
    type: "INCOME_PROOF",
    purpose: "Income verification for transaction legitimacy"
  }
];
```text`n## Next Steps

After uploading documents:

1. [Check Verification Status](/latest/api-reference/v2.1/verification/get-status) - Monitor document processing
2. [Approve Verification](/latest/api-reference/v2.1/verification/approve) - Admin approval if authorized
3. [Activate Account](/latest/api-reference/v2.1/customer/individual-activation) - Complete account setup

## PowerShell Script Example

```powershell
# Upload required documents for verification
if ($verificationId) {
    # Define required documents based on risk level
    $requiredDocuments = @(
        @{ name = "government_id.pdf"; type = "GOVERNMENT_ID"; purpose = "Identity verification" },
        @{ name = "proof_of_address.pdf"; type = "PROOF_OF_ADDRESS"; purpose = "Address verification" },
        @{ name = "source_of_funds.pdf"; type = "SOURCE_OF_FUNDS"; purpose = "Source of funds documentation" }
    )

    foreach ($doc in $requiredDocuments) {
        try {
            Write-Host "Uploading $($doc.name) ($($doc.type))..." -ForegroundColor Cyan
        
            # Create mock document content (in real scenario, read actual file)
            $documentContent = "Mock $($doc.type) document for verification. " +
                             "Customer: $customerId. " +
                             "Purpose: $($doc.purpose). " +
                             "Generated: $(Get-Date)"
            
            $documentBytes = [System.Text.Encoding]::UTF8.GetBytes($documentContent)
        
            # Convert to base64
            $base64Content = [System.Convert]::ToBase64String($documentBytes)
        
            # For real file upload:
            # $filePath = "./documents/$($doc.name)"
            # $fileBytes = [System.IO.File]::ReadAllBytes($filePath)
            # $base64Content = [System.Convert]::ToBase64String($fileBytes)
        
            # Create upload request
            $uploadRequest = @{
                docId        = [System.Guid]::NewGuid().ToString()
                documentType = $doc.type
                fileName     = $doc.name
                fileContent  = $base64Content
                customerId   = $customerId
                description  = $doc.purpose
            }
        
            $uploadUrl = "$baseUrl/api/v2.1/verifications/$verificationId/documents"
            $uploadBody = $uploadRequest | ConvertTo-Json -Depth 5
        
            $uploadResponse = Invoke-RestMethod -Uri $uploadUrl -Method Post -Headers $headers -Body $uploadBody
        
            Write-Host "  ✅ $($doc.name) uploaded successfully" -ForegroundColor Green
            
            if ($uploadResponse.data -and $uploadResponse.data.documentId) {
                Write-Host "    Document ID: $($uploadResponse.data.documentId)" -ForegroundColor Gray
            }
        }
        catch {
            Write-Host "  ⚠️ Failed to upload $($doc.name): $($_.Exception.Message)" -ForegroundColor Yellow
        }
    }

    # For high-risk clients, additional documents would include:
    # - BENEFICIAL_OWNERSHIP
    # - PEP_DECLARATION
    # - Enhanced due diligence documents
}
else {
    Write-Host "⚠️ No verification ID available - skipping document uploads" -ForegroundColor Yellow
}
```text`n## Related Endpoints

- [Create Verification Request](/latest/api-reference/v2.1/verification/create-verification) - Start verification process
- [Get Document Status](/latest/api-reference/v2.1/verification/document-status) - Check document processing status
- [Download Documents](/latest/api-reference/v2.1/verification/download-documents) - Retrieve uploaded documents