Skip to content

GuidesVerify

Verify inside your site

Embed the verification in your own page: your server starts it and hands the page a session token, or the page starts one with a publishable key and a profile. The person never leaves your site.

Updated

Ask about this pageRead this page as Markdown

Before you start

  • A publishable key (kt_pub_live_, or kt_pub_test_ for test mode) that lists your site’s origins exactly. The widget opens only on those origins.
  • For a start on your server, a secret key allowed to write cases (cases:write).

Start on your server

The usual way: you know who the person is. Start the verification with deliver: "link", so nothing is sent, and hand its link.session_token to the page.

curl -X POST https://api.kontiga.com/v1/identity_verifications \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "person_id": "per_9Lb2Tx5",
    "profile_id": "vpr_4Tk9Bm2",
    "deliver": "link"
  }'

POST /v1/identity_verifications

A session token works for 30 minutes and is renewed while in use. For a page opened later, get a fresh one for the same verification:

curl -X POST https://api.kontiga.com/v1/identity_verifications/idv_6Wn3Rk8/session_tokens \
  -H "Authorization: Bearer $KONTIGA_API_KEY"

POST /v1/identity_verifications/{verification_id}/session_tokens

Or start in the page

With a publishable key and a profile, the widget asks for the person’s details itself and starts the verification. The person is found by your reference, then by the email, or added to People. The profile’s walk-in limits, per_hour and per_day, apply. Anyone with your page can start one, so use it for an open form only.

curl -X POST https://api.kontiga.com/v1/verify/sessions \
  -H "Authorization: Bearer <your publishable key>" \
  -H "Content-Type: application/json" \
  -d '{
    "profile_id": "vpr_4Tk9Bm2",
    "first_name": "Liam",
    "last_name": "Byrne",
    "reference": "CUST-88412",
    "email": "liam.byrne@mail.example"
  }'

POST /v1/verify/sessions

Mount the widget

Your page
<div id="kontiga-verify"></div>
<script src="https://js.kontiga.com/collect/v1.js"
        integrity="sha384-<the hash published for v1>" crossorigin="anonymous"></script>
<script>
  const widget = Kontiga.collect({
    publishableKey: "kt_pub_live_...",
    sessionToken: "<from your server>", // or profile: "vpr_...", to start in the page
    container: "#kontiga-verify",
    locale: "en",
    onEvent: (event) => {
      // never a result: your server hears it by webhook
      if (event.type === "submitted") showThanks();
    },
  });
</script>

On a phone the person verifies in the widget. On a desktop it offers to continue on the phone by QR code or text message, and follows along until the phone is done.

Events to your page

What the widget posts, only to the page that mounted it
EventMeans
startedThe verification screens are open.
submittedNothing more waits for the person. The result is on its way to your server.
cancelledThe person stopped.
errorIt could not go on, with a code such as session_expired. When the widget has not said started within 10 seconds, the page gets error and the widget closes.