Skip to main content

Document Verification & Tamper Detection (/api/v1/uploads)

Document upload, retrieval, verification (with extraction), and standalone tamper analysis are implemented under /api/v1/uploads, not /api/v1/documents.

Use X-API-Key or a Bearer / cookie session as described in Introduction.


1. Upload a document

Uploads a file for a given document type. The multipart field name must be exactly doc (required by the API).

  • Method: POST
  • Endpoint: /api/v1/uploads/docs/:docType
  • Authentication: Required
  • Headers:
    • X-API-Key: <your_api_key>
    • Content-Type: multipart/form-data
Field (form)TypeDescription
docFileThe document file.

Path param: docType — string your product uses for routing extractors (must align with backend extraction config for that type).


2. Verify document & extract data

Triggers verification (including tamper checks where configured), name matching, and structured extraction for an existing uploaded document.

  • Method: POST
  • Endpoint: /api/v1/uploads/docs/:id/verify
  • Authentication: Required
  • Headers:
    • X-API-Key: <your_api_key>
    • Content-Type: application/json
  • Path Param: id — ID of the uploaded document

Request body (JSON)

ParameterTypeDescription
forceExtractionBooleanIf true, forces a fresh extraction even if cached.
{
"forceExtraction": false
}

Response

  • Content-Type: application/json
{
"documentId": "doc_123",
"verified": true,
"verification": {
"verified": true,
"reason": "Document verified successfully",
"extractedName": "John Doe",
"dataExtracted": true
}
}
FieldTypeDescription
documentIdStringThe ID of the verified document.
verifiedBooleanOverall verification status.
verification.reasonStringDetailed reason for the status.
verification.extractedNameStringThe name extracted from the document.

3. Standalone tamper check

Analyzes a file for tampering without persisting it as a stored document. Uses multipart field doc (same as upload).

  • Method: POST
  • Endpoint: /api/v1/uploads/tamper
  • Authentication: Required
  • Headers:
    • X-API-Key: <your_api_key>
    • Content-Type: multipart/form-data
Field (form)TypeDescription
docFilePDF or supported document to scan.
curl -X POST https://api.riskinmind.ai/api/v1/uploads/tamper \
-H "X-API-Key: YOUR_API_KEY" \
-F "doc=@/path/to/bank_statement.pdf"

Response

  • Content-Type: application/json
{
"filename": "bank_statement.pdf",
"tamperCheck": {
"isTampered": false,
"verdict": "No Tampering Evidence",
"confidence": "HIGH",
"riskScore": 0.05
}
}