# Verify inside your site

> Kontiga is document fraud detection by Bynn Intelligence for insurers, letting agents, lenders and HR screening teams: every document is compared with a proprietary library of more than 300 million original documents, gathered over 20 years.

Documentation index: https://kontiga.com/llms.txt

Section: Guides. URL: https://kontiga.com/docs/guides/verify-widget

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 November 30, 2026

## 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.

API:

```bash
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"
  }'
```

CLI:

```bash
kontiga identity-verifications create \
  --person-id per_9Lb2Tx5 \
  --profile-id vpr_4Tk9Bm2 \
  --deliver link
```

MCP tool `start_identity_verification`:

```json
{
  "name": "start_identity_verification",
  "arguments": {
    "person_id": "per_9Lb2Tx5",
    "profile_id": "vpr_4Tk9Bm2",
    "deliver": "link"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.identityVerifications.create({
  person_id: "per_9Lb2Tx5",
  profile_id: "vpr_4Tk9Bm2",
  deliver: "link",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.identity_verifications.create(
    person_id="per_9Lb2Tx5",
    profile_id="vpr_4Tk9Bm2",
    deliver="link",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.IdentityVerifications.Create(ctx, &kontiga.IdentityVerificationsCreateParams{
	PersonId:  "per_9Lb2Tx5",
	ProfileId: "vpr_4Tk9Bm2",
	Deliver:   "link",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.identityVerifications().create(IdentityVerificationsCreateParams.builder()
    .personId("per_9Lb2Tx5")
    .profileId("vpr_4Tk9Bm2")
    .deliver("link")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.IdentityVerifications.CreateAsync(new IdentityVerificationsCreateOptions
{
    PersonId = "per_9Lb2Tx5",
    ProfileId = "vpr_4Tk9Bm2",
    Deliver = "link",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->identityVerifications->create([
    'person_id' => 'per_9Lb2Tx5',
    'profile_id' => 'vpr_4Tk9Bm2',
    'deliver' => 'link',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.identity_verifications.create(
  person_id: "per_9Lb2Tx5",
  profile_id: "vpr_4Tk9Bm2",
  deliver: "link"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .identity_verifications()
    .create(kontiga::identity_verifications::CreateParams {
        person_id: "per_9Lb2Tx5".into(),
        profile_id: "vpr_4Tk9Bm2".into(),
        deliver: "link".into(),
        ..Default::default()
    })
    .await?;
```

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:

API:

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

CLI:

```bash
kontiga identity-verifications session-token idv_6Wn3Rk8
```

MCP tool `create_identity_verification_session_token`:

```json
{
  "name": "create_identity_verification_session_token",
  "arguments": {
    "verification_id": "idv_6Wn3Rk8"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.identityVerifications.sessionToken("idv_6Wn3Rk8");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.identity_verifications.session_token("idv_6Wn3Rk8")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.IdentityVerifications.SessionToken(ctx, "idv_6Wn3Rk8")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.identityVerifications().sessionToken("idv_6Wn3Rk8");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.IdentityVerifications.SessionTokenAsync("idv_6Wn3Rk8");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->identityVerifications->sessionToken('idv_6Wn3Rk8');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.identity_verifications.session_token("idv_6Wn3Rk8")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .identity_verifications()
    .session_token("idv_6Wn3Rk8".into())
    .await?;
```

## 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.

API:

```bash
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"
  }'
```

CLI:

```bash
kontiga verify-sessions create \
  --profile-id vpr_4Tk9Bm2 \
  --first-name Liam \
  --last-name Byrne \
  --reference CUST-88412 \
  --email liam.byrne@mail.example
```

MCP tool `start_verification_session`:

```json
{
  "name": "start_verification_session",
  "arguments": {
    "profile_id": "vpr_4Tk9Bm2",
    "first_name": "Liam",
    "last_name": "Byrne",
    "reference": "CUST-88412",
    "email": "liam.byrne@mail.example"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // no key needed
const result = await kontiga.verifySessions.create({
  profile_id: "vpr_4Tk9Bm2",
  first_name: "Liam",
  last_name: "Byrne",
  reference: "CUST-88412",
  email: "liam.byrne@mail.example",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # no key needed
result = kontiga.verify_sessions.create(
    profile_id="vpr_4Tk9Bm2",
    first_name="Liam",
    last_name="Byrne",
    reference="CUST-88412",
    email="liam.byrne@mail.example",
)
```

Go:

```go
client := kontiga.NewClient() // no key needed
result, err := client.VerifySessions.Create(ctx, &kontiga.VerifySessionsCreateParams{
	ProfileId: "vpr_4Tk9Bm2",
	FirstName: "Liam",
	LastName:  "Byrne",
	Reference: "CUST-88412",
	Email:     "liam.byrne@mail.example",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // no key needed
var result = kontiga.verifySessions().create(VerifySessionsCreateParams.builder()
    .profileId("vpr_4Tk9Bm2")
    .firstName("Liam")
    .lastName("Byrne")
    .reference("CUST-88412")
    .email("liam.byrne@mail.example")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // no key needed
var result = await kontiga.VerifySessions.CreateAsync(new VerifySessionsCreateOptions
{
    ProfileId = "vpr_4Tk9Bm2",
    FirstName = "Liam",
    LastName = "Byrne",
    Reference = "CUST-88412",
    Email = "liam.byrne@mail.example",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // no key needed
$result = $kontiga->verifySessions->create([
    'profile_id' => 'vpr_4Tk9Bm2',
    'first_name' => 'Liam',
    'last_name' => 'Byrne',
    'reference' => 'CUST-88412',
    'email' => 'liam.byrne@mail.example',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # no key needed
result = kontiga.verify_sessions.create(
  profile_id: "vpr_4Tk9Bm2",
  first_name: "Liam",
  last_name: "Byrne",
  reference: "CUST-88412",
  email: "liam.byrne@mail.example"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // no key needed
let result = kontiga
    .verify_sessions()
    .create(kontiga::verify_sessions::CreateParams {
        profile_id: "vpr_4Tk9Bm2".into(),
        first_name: "Liam".into(),
        last_name: "Byrne".into(),
        reference: "CUST-88412".into(),
        email: "liam.byrne@mail.example".into(),
        ..Default::default()
    })
    .await?;
```

## 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

| Event | Means |
| --- | --- |
| `started` | The verification screens are open. |
| `submitted` | Nothing more waits for the person. The result is on its way to your server. |
| `cancelled` | The person stopped. |
| `error` | It 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. |

> **Decide on your server.** No event carries the result, and anyone can call your page's callbacks. Act on `identity_verification.completed`, or read the verification with your secret key.
