Overview
API integration provides complete control over the user verification experience through custom UIs and direct API calls. Choose this approach when you need full customization of the user journey.When to use API Integration:
- Need complete UI customization
- Building native mobile applications
- Require specific flow control logic
- Want to handle multiple providers differently
Prerequisites
- API credentials from the Console
- Understanding of verification flows
Implementation Steps
Step 1: Create Verification Session
Start a verification session with your chosen provider:Step 2: Handle Flow Response
The API response varies by verification flow type:- QR Code Flow
- Redirect Flow
- Push Flow
Response
- Generate QR code from
flowDetails.qrData - Display QR code to user
- Poll for verification status
Example
Step 3: Poll for Status
PollGET /verifications/{id} until status becomes completed. Then call GET /verifications/{id}/userinfo to obtain the user attributes and provenance.
Step 4: Fetch User and Provenance
When status iscompleted, fetch GET /verifications/{id}/userinfo to retrieve personal attributes and verification context. You’ll see the personal claims alongside provenance (channel, credentials, evidence, metadata).
Request
Response
Parsing tips:
provenance.presentation.credentials[].typereuses theproviderIdyou supplied (for example,smartid,bankidse).provenance.presentation.credentials[].evidence.tokencontains provider-specific keys; inspect the semicolon-delimitednamesstring to know which ones are present.- Call
GET /verifications/{verificationId}/evidenceif you only need thistoken/namesobject without the rest of the UserInfo payload.
Evidence keys differ per provider. Use the semicolon-delimited
names string to determine which fields are present under evidence.token.Error Handling
- Common Errors
- Error Response Example
| Error | Description | Action |
|---|---|---|
300001 | Session not found | Verify session ID is correct |
300003 | Invalid status transition | Session already completed |
400002 | Provider not enabled | Enable provider in dashboard |
400005 | Provider unavailable | Try again later or use fallback |
Error Code Reference
View complete error codes and handling strategies
Best Practices
Security Considerations
Security Considerations
- Never expose Client Secret in frontend code - Implement proper session management - Use HTTPS for all API calls - Validate all responses server-side
User Experience
User Experience
- Show clear loading states during polling - Provide timeout warnings before expiry - Offer alternative authentication methods - Display provider-specific instructions
Performance Optimization
Performance Optimization
- Implement exponential backoff for polling - Cache provider information - Minimize API calls with proper state management - Use webhooks for real-time updates (if available)

