Dashboard

Mobile App Drop-In — Backend Pattern

How your backend starts verification attempts for a mobile app, and confirms the results, in a Mobile App Drop-In integration.

Never put a VerifyHuman client secret in your app binary. Your backend starts attempts and confirms results; the app only opens a URL.


1. Create a persistent hosted page (once)

Create the page with a product Wizard or VerifyFlow. List your pages and their tokens with the API:

curl "https://app.verifyhuman.io/api/v1/hosted/pages?product=verifyidentity" \
  -H "X-API-Key: vhk_live_your_client_key"

2. Start an attempt per user

When the app asks to verify a user, your backend starts one attempt on that page:

curl -X POST https://app.verifyhuman.io/api/v1/hosted/pages/PAGE_TOKEN/attempts \
  -H "X-API-Key: vhk_live_your_client_key" \
  -H "Content-Type: application/json" \
  -d '{"product": "verifyidentity", "return_url": "https://app.example.com/verify-complete"}'
{
  "attempt_token": "ATTEMPT_TOKEN",
  "verification_url": "https://app.verifyhuman.io/hosted/v/PAGE_TOKEN?attempt=ATTEMPT_TOKEN",
  "status_url": "https://app.verifyhuman.io/hosted/status/ATTEMPT_TOKEN",
  "expires_at": "2026-11-03T12:00:00Z"
}

Store attempt_token against the user, return only verification_url to the app. return_url must be HTTPS and on a domain registered for the key; use a universal link / App Link so the return opens your app. Starting an attempt is not billed. Full reference: Hosted Attempts API.


3. Confirm with the signed webhook

Webhooks are the source of truth. On verification.completed, verify the signature and timestamp, then update the user's record:

import hashlib
import hmac
import os
import time

from flask import Flask, request

app = Flask(__name__)
WEBHOOK_SECRET = os.environ["VERIFYHUMAN_WEBHOOK_SECRET"]
MAX_TIMESTAMP_AGE = 300  # seconds


def signature_is_valid(req) -> bool:
    timestamp = req.headers.get("X-VerifyHuman-Timestamp", "")
    signature = req.headers.get("X-VerifyHuman-Signature", "")
    try:
        if abs(time.time() - int(timestamp)) > MAX_TIMESTAMP_AGE:
            return False
    except ValueError:
        return False
    signed = f"{timestamp}.".encode() + req.get_data()
    expected = "sha256=" + hmac.new(WEBHOOK_SECRET.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(signature, expected)


@app.post("/webhooks/verifyhuman")
def verifyhuman_webhook():
    if not signature_is_valid(request):
        return "", 401
    event = request.get_json()
    if event.get("type") == "verification.completed" and event.get("environment") == "live":
        data = event["data"]
        record_result(  # your own storage
            verification_id=data["verification_id"],
            product=data.get("verification_type"),
            passed=data.get("status") == "PASS",
            event_id=event["id"],  # ignore repeats of the same event
        )
    return "", 200

Match the verification to the user through your own records (for example the attempt your backend started), and accept each verification_id once. For a pull-based check, fetch the Evidence Receipt.


4. Handle the return

When the user finishes, VerifyHuman opens your return_url with ?attempt=ATTEMPT_TOKEN appended. The app then:

  1. shows "Confirming your result…";
  2. asks your backend for the user's status, sending the attempt value;
  3. your backend checks that attempt equals the stored attempt_token, and returns pending until it has a verified webhook, then pass or fail.

The return and its query parameters are UX signals only. The public GET /hosted/status/<attempt-token> reports progress, not proof.

Outcome Where the user is sent
Verification passed return_url (or the page's success URL)
Verification failed The page's failure URL, if set
Awaiting review No redirect

Test mode

Use a page created with a Test key and a Test webhook endpoint. Test runs are not billed and Test results never satisfy a Live check. See Test and Live Environments.


Native Mobile API alternative

Apps using the native Mobile API (/api/mobile/v1/) instead of hosted pages have session status endpoints:

Product Status endpoint
VerifyHuman GET /api/mobile/v1/verifyhuman/status/{verification_id}
VerifyAge GET /api/mobile/v1/verifyage/status/{session_id}
VerifyIdentity GET /api/mobile/v1/verifyidentity/status/{session_id}
VerifyTrust GET /api/mobile/v1/verifycompliance/status/{session_id}

Confirm final results on your backend with the webhook or receipt either way.