Batch Verification
Process multiple verifications efficiently using batch operations. Ideal for onboarding large user groups.
Approach
VerifyHQ doesn't expose a single batch endpoint — instead, use concurrent requests with idempotency keys for safe, parallelized batch processing:
Fetch Batch Examplejavascript
import { randomUUID } from 'crypto';
const baseUrl = 'https://api.verifyhq.wejoona.com';
const users = ['user_001', 'user_002', 'user_003', /* ... */];
// Process in batches of 10 (respect rate limits)
const BATCH_SIZE = 10;
for (let i = 0; i < users.length; i += BATCH_SIZE) {
const batch = users.slice(i, i + BATCH_SIZE);
const results = await Promise.allSettled(
batch.map(userId =>
fetch(`${baseUrl}/verifications/identity`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.VERIFYHQ_API_KEY,
'Idempotency-Key': randomUUID(),
},
body: JSON.stringify({ userId, tier: 'BASIC' }),
}).then(async (response) => {
if (!response.ok) throw new Error(await response.text());
return response.json();
})
)
);
results.forEach((r, idx) => {
if (r.status === 'fulfilled') {
console.log(`✓ ${batch[idx]}: ${r.value.id}`);
} else {
console.error(`✗ ${batch[idx]}: ${r.reason.message}`);
}
});
// Wait 1s between batches to respect rate limits
await new Promise(r => setTimeout(r, 1000));
}For enterprise batch processing (10,000+ users), contact sales for dedicated throughput allocation.
Batch Guidelines
| Parameter | Type | Description |
|---|---|---|
Concurrency | guideline | Max 10 concurrent requests recommended |
Idempotency | guideline | Always use idempotency keys for safe retries |
Rate Limits | guideline | Stay within your plan rate limit |
Error Handling | guideline | Use Promise.allSettled to handle partial failures |