Preventing Duplicates
Duplicate verification sessions waste money, confuse users, and create data quality issues. This guide covers strategies for preventing duplicates at every layer.
Use idempotency keys
The most reliable way to prevent duplicate session creation is the
Idempotency-Key header. If a network error occurs and you retry the request,
Verifa returns the original response instead of creating a second session.
Key design tips:
- Use a value that uniquely identifies the intent (e.g.,
signup_\{user_id\}orreverify_\{user_id\}_\{date\}) - Don’t use random values generated on each attempt — that defeats the purpose
- Keys are cached for 24 hours
See Idempotency for the full specification.
Use external references
Always set external_ref to your internal user ID when creating sessions. This:
- Links the session to a persistent identity record
- Lets you query existing sessions before creating new ones
- Enables duplicate detection across sessions
Check before creating
Before creating a new session, check if the user already has an active one:
If an active session exists, resume it instead of creating a new one:
Handle expired sessions
When a user’s session expires (they took too long), resume it rather than creating a new session:
This re-issues a capture token and preserves any documents already uploaded.
Duplicate detection during verification
Verifa automatically detects when the same person verifies under different
external_ref values. The duplicate_detection check searches across all
previous sessions using:
- Device fingerprint — Same browser or device
- Email address — Same email submitted during capture
- Phone number — Same phone submitted during capture
- Document number — Same ID document number extracted via OCR
- Face embedding — Same face via cosine similarity matching
- Name + DOB — Same name and date of birth combination
- IP address — Same IP address (weaker signal)
When duplicates are detected, the signals appear in the risk assessment and can route the session to manual review.
Client-side best practices
Disable the submit button
Prevent the user from clicking “Start Verification” multiple times:
Cache the session
Store the session ID locally so refreshing the page doesn’t trigger a new session:
Webhook deduplication
In rare cases, you may receive the same webhook event more than once. Use the
session_id to deduplicate:
Related
- Idempotency — Idempotency key specification
- Sessions — Session creation, resumption, and lifecycle
- Identities — How external references link to identities
- Fraud Signals — Duplicate detection signals