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) | Type | Description |
|---|---|---|
doc | File | The 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)
| Parameter | Type | Description |
|---|---|---|
forceExtraction | Boolean | If true, forces a fresh extraction even if cached. |
- JSON Schema
- cURL
- Python
- JavaScript
{
"forceExtraction": false
}
curl -X POST https://api.riskinmind.ai/api/v1/uploads/docs/doc_123/verify \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"forceExtraction": true
}'
import requests
url = "https://api.riskinmind.ai/api/v1/uploads/docs/doc_123/verify"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"forceExtraction": True
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://api.riskinmind.ai/api/v1/uploads/docs/doc_123/verify', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
forceExtraction: true
})
});
const data = await response.json();
console.log(data);
Response
- Content-Type:
application/json
{
"documentId": "doc_123",
"verified": true,
"verification": {
"verified": true,
"reason": "Document verified successfully",
"extractedName": "John Doe",
"dataExtracted": true
}
}
| Field | Type | Description |
|---|---|---|
documentId | String | The ID of the verified document. |
verified | Boolean | Overall verification status. |
verification.reason | String | Detailed reason for the status. |
verification.extractedName | String | The 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) | Type | Description |
|---|---|---|
doc | File | PDF or supported document to scan. |
- cURL
- Python
- JavaScript
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"
import requests
url = "https://api.riskinmind.ai/api/v1/uploads/tamper"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
files = {
"doc": open("bank_statement.pdf", "rb")
}
response = requests.post(url, headers=headers, files=files)
print(response.json())
const formData = new FormData();
formData.append('doc', fileInput.files[0]);
const response = await fetch('https://api.riskinmind.ai/api/v1/uploads/tamper', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
Response
- Content-Type:
application/json
{
"filename": "bank_statement.pdf",
"tamperCheck": {
"isTampered": false,
"verdict": "No Tampering Evidence",
"confidence": "HIGH",
"riskScore": 0.05
}
}