Collect evidence inside your app
Your server opens a short-lived session for a case. The SDK uses it to show the applicant what to send, ask your questions, guide each photo or file, run the liveness challenge and location step, confirm an email address or phone number, and submit the evidence.
show_if, email and phone codes, fetching the session after a submit, rejection screens with a help contact, and continuing on a phone. They need API and SDK versions that are not released yet.How a session flows
- Your server creates a case for one of your profiles with
POST /client/verifications, as in your first request. The profile decides what the applicant must provide. - Your server calls
POST /client/verifications/{id}/sessionsand returns the session descriptor to the signed-in applicant:session_id,token,api_base_urlandexpires_at. - Your app hands that descriptor to the SDK through a
sessionProvidercallback. The SDK loads the outstanding requirements, asks the questions, collects each document, then runs the facial, location, email and phone requirements in profile order. After every submission it loads the session again, so a requirement a workflow adds during the case is collected too. - Your server retrieves the outcome with
GET /client/verifications/{id}. Never grant access because the app reported a submission.
A session lasts at most 30 minutes and never longer than its case. Only a hash of its token is stored. Treat the descriptor as a temporary credential: keep it out of logs and persistent storage, and never put client credentials in an app.
What the applicant sees
The guided flow in the React Native, Flutter, Swift and Kotlin SDKs leads with your name and message. Credflare appears only as a small footer. Screens follow light and dark mode.




Rendered from the Flutter SDK for a sample profile that asks for camera photos of an ID card and a saved bank statement. React Native uses the same layout and copy. Sandbox sessions carry a Test mode label. The liveness and location screens are shown in Liveness and location.
Requirements come from the profile
The SDK has no settings for which documents to collect or how. You decide that in the profile the case was created with. The SDK reads the outstanding requirements from the session and renders them.
| Set in the profile | The SDK shows |
|---|---|
| Documents and their groups | A Required list, and Provide one of these for groups of alternatives. |
| Capture method for each document | Camera steps, file steps or both, for every requested side. |
| Requested sides | One step per side, with a front or back guide. |
| Workspace file types and size limit | The accepted formats and maximum size. |
| Your workspace name, logo and request message | The header and the message above the document list. |
| A facial requirement and its settings | A liveness challenge with the server's gestures, an optional video, then a selfie. |
| A location requirement and its settings | A location step that names your reference places by label. |
Questions in form_schema | A form that shows each question when its show_if matches the answers so far. |
| An email or phone requirement | A step that sends a code and asks the applicant to type it. |
A case keeps the requirements it was created with, so editing a profile changes new cases only. The server checks every upload against those requirements, whatever the app sends.
What a receipt means
A receipt confirms that Credflare received the evidence. It is not a verification decision. Camera source is reported by the device, so it is not proof of a live person or an untampered camera feed. A completed liveness challenge shows that the camera recorded the server's gesture sequence in time; read what the checks show.
| Capability in the session response | Current value |
|---|---|
capabilities.trusted_camera | false |
capabilities.liveness | "challenge" |
capabilities.deepfake_detection | false |
Session endpoints
The SDK clients call these for you. Each request sends Authorization: Bearer <session token>.
| Method and path | Purpose |
|---|---|
GET /sdk/sessions/{session} | Outstanding requirements, upload limits and your branding. |
POST /sdk/sessions/{session}/uploads/documents | Multipart document file with side, capture_source and document_type_id. |
POST /sdk/sessions/{session}/liveness-challenges | Issue a liveness challenge with the gestures to run. |
POST /sdk/sessions/{session}/uploads/biometrics | Multipart gesture frame, liveness video or selfie, with type, challenge_id and capture_source=camera. |
POST /sdk/sessions/{session}/submit | Submit a document with an evidence list of file_id, side and source, a facial_verification with its challenge_id, or a location_verification. |
POST /sdk/sessions/{session}/{channel}-codes | Send an email or phone code. channel is email or phone. |
POST /sdk/sessions/{session}/{channel}-codes/confirm | Confirm the code. |
POST /sdk/sessions/{session}/handoff | Create a link that continues the session on a phone. |
DELETE /sdk/sessions/{session} | Revoke the session. The case stays open. |
Send a UUID X-Idempotency-Key with every upload and submission. Reuse it when retrying the same payload after a network failure; use a new one when the applicant changes the evidence. Only successful responses are replayed, and reusing a key with different data returns 409. See request keys and retries.
Handle errors
| Status | Meaning | What to do |
|---|---|---|
| 401 | The session expired or was revoked. | Ask your backend whether to issue a replacement session for the same case. |
| 409 | The case no longer accepts submissions, or a request key was reused with different data. | Stop collecting. When the session fetch after a submit returns it, show the receipt. For a key conflict, send the new data with a new key. |
| 422 | The evidence does not meet the requirement. | Match on code when it is present and show its rejection screen. Otherwise show the message and let the applicant try again. |
After a submit
A workflow can add a requirement while the case is open, for example a phone check when an answer says the applicant lives in Germany. The session always returns what is still outstanding, so the SDKs never decide from their own list. After each submit, email_code_confirm and phone_code_confirm, they fetch the session again:
- When
statusispendingorin_progressand any ofprofile.document_requirements,profile.verification_requirements,profile.form_schemais not empty, continue with the next outstanding step. - Otherwise show the receipt.
- When the fetch returns
409, the case is closed (completed, rejected or expired) and accepts nothing more, for example because a workflow approved it after the last step. Show the receipt.
When the fetch fails in any other way, the SDKs show "We could not check what is still needed. Try again." with a retry, never the receipt.
Rejection screens
Every 422 with a code shows a screen from the rejection map in the SDK spec: a title, a message, who asked for the evidence, a help line and one button. The codes and their copy are listed in liveness and location rejections and code rejections. A 422 without a code, or with a code the SDK does not know, shows the server message with Try again.
| Action | Button | What it does |
|---|---|---|
retry | Try again | Stay on the step and capture again with the same settings. |
restart | Start again | Start the step from the beginning, which asks the server for a new challenge. |
reenter_code | Enter the code again | Clear the code field and let the applicant type the code again. |
new_code | Send a new code | Request a new code for the same email address or phone number. |
wait | Send a new code | Keep the code screen and enable sending a new code at resend_available_at from the rejection, or from the last code request when the rejection has none. |
leave | Close | Nothing can be done in the app now; show the help line and let the applicant leave. |
After a leave rejection, such as phone.not_configured or phone.send_limit, the flow ends with a host action result that carries the code, never with a cancellation. Use the code to tell the applicant what to do next, such as confirming the number another way or trying again tomorrow.
| SDK | How your app gets the code |
|---|---|
| JavaScript | onLeave(code) |
| React Native | onHostActionRequired({code}), before onClose |
| Flutter | onHostActionRequired(code), before onClose |
| Swift | .hostActionRequired(code:) |
| Kotlin | VerificationOutcome.rejectionCode from launchWithOutcome |
Help contact
requester in the session, and in the hosted page's public payload, has name, logo_url, help_email and help_url. Both help fields come from your workspace's default brand (its email and website), else from your organization's email and website. A website stored without a scheme is returned with https://, and anything that is not an http or https URL is left out. A field is null when nothing is stored, and requester is null when the case has no requester name.
{
"requester": {
"name": "Ada's Workspace",
"logo_url": null,
"help_email": "[email protected]",
"help_url": "https://northwind.example/support"
}
} | The session has | The help line says |
|---|---|
help_email | If you need help, contact {verifier} at {help_email}. The address is a mailto: link. |
Only help_url | If you need help, visit {help_url}. The link opens outside the flow. |
Neither, or no requester | If you need help, contact {verifier}. |
{verifier} is requester.name, or "your verifier" when requester is null. Every rejection screen also says "Requested by {verifier}."
Continue on a phone
The JavaScript SDK and the hosted page can show a QR code so an applicant who started on a computer can finish with the phone camera. The native SDKs do not offer it.
- The browser calls
POST /sdk/sessions/{session}/handoff, orPOST /client/verifications/{id}/handoffon the hosted page. The reply is201withhandoff_urlandexpires_at. - It shows
handoff_urlas a QR code with the minutes left, and a new code once it expires. - The phone opens the hosted page, which reads the token from the URL fragment, removes it from the address bar and calls
POST /verification-handoffs/redeemwith{"token": "..."}. The reply is a session descriptor for the same case, with the same outstanding requirements. - The first device keeps its own session and fetches it to show the receipt once the phone has finished.
- The link has the form
https://<hosted page>/verify/handoff#token=<64 hex characters>. The token sits in the fragment, so browsers never send it to a server or in aRefererheader, and it does not reveal the case. Never log the link. - A token works once, for ten minutes. Only its SHA-256 hash is stored.
- The phone's session lasts 30 minutes unless the workspace sets another length, and ends no later than the session that created the link or after the case expires.
- A workspace can turn handoff off. Creating a link then returns
403, so hide the option when that happens. - Redeeming returns
401when the token is unknown, expired or used, or when the creating session or its client credential was revoked;409when the case is closed; and403when anX-Environmentheader does not match the case. - Creating links is limited to five a minute and redeeming to ten a minute per caller.
Platform support
| SDK | Minimum | Face signals | Mock location | Permissions |
|---|---|---|---|---|
| JavaScript | A browser with camera and geolocation access, over HTTPS | MediaPipe Face Landmarker | Not detectable, sent as null | Camera and location |
| React Native | React Native 0.88.1 | Apple Vision on iOS, ML Kit on Android | Android only, null on iOS | Camera, photo library and location |
| Flutter | Flutter 3.41, iOS 15 | Apple Vision on iOS, ML Kit on Android | Android and iOS | Camera, photo library and location |
| Swift | iOS 16 | Apple Vision | iOS | Camera and location |
| Kotlin | Android 7.0 (API 24) | ML Kit | Android | Camera and location |
No SDK needs microphone access: the liveness video has no sound.