Flonk
Flonk Docs

Sessions

Create and manage KYC verification sessions

Last updated: 8/19/2026
5 min read

Sessions API

Sessions are the core of KYC verification. Create a session on your backend, then initialize the widget on your frontend — or drive the whole flow yourself via the Direct API.

Using the SDK

import { FlonkKYCServer } from '@flonkid/kyc/server';
const flonk = new FlonkKYCServer({
secretKey: process.env.FLONK_SECRET_KEY!,
});
// Create session
const session = await flonk.createSession({
clientMetadata: { email: 'user@example.com', userId: 'user_123' },
expiryMinutes: 30,
language: 'de',
});
// → { id, embedToken, status, expiresAt, widgetUrl, qrCodeUrl, ... }
// Get session
const details = await flonk.getSession(session.id);
// Update session
await flonk.updateSession(session.id, {
clientMetadata: { email: 'updated@example.com' },
});
typescript

REST API Reference

Create Session

POST /v1/sessions

Creates a new KYC verification session.

Request

{
"clientMetadata": {
"email": "user@example.com",
"userId": "user_123",
"name": "John Doe"
},
"language": "de",
"expiryMinutes": 30
}
json

Parameters

ParameterTypeRequiredDescription
clientMetadataobjectNoCustom data to associate with session
clientMetadata.emailstringNoUser email (recommended for webhook matching)
clientMetadata.userIdstringNoYour internal user ID
clientMetadata.namestringNoUser display name
languagestringNoWidget language: en, de, uk (default: de)
expiryMinutesnumberNoSession expiry in minutes, 1-60 (default: 5)

Note: All clientMetadata fields are optional. Pass any key-value pairs you need — they are returned in webhook events, so you can match verifications to your users.

Idempotency

Send an optional Idempotency-Key header to make a create safely retriable: a retry with the same key returns the original session instead of creating a duplicate (a concurrent retry while the first is still in flight gets 409). Keys are scoped to your project and remembered for 24h. The Node SDK sets one automatically, so createSession retries can never duplicate.

Idempotency-Key: 6f0c…-uuid

Response

{
"id": "clxxxxxxxxxxxxxxxxx",
"embedToken": "eyJhbGciOi...",
"status": "pending",
"expiresAt": "2026-01-15T12:30:00Z",
"createdAt": "2026-01-15T12:00:00Z",
"widgetUrl": "https://verify.flonk.id/?sessionId=...",
"qrCodeUrl": "https://verify.flonk.id/?sessionId=...",
"allowManualUpload": false,
"testMode": false
}
json

Get Session

GET /v1/sessions/{sessionId}

Retrieves details of an existing session.

Response

{
"id": "clxxxxxxxxxxxxxxxxx",
"status": "completed",
"clientMetadata": {
"email": "user@example.com",
"userId": "user_123"
},
"createdAt": "2026-01-15T12:00:00Z",
"expiresAt": "2026-01-15T12:30:00Z",
"updatedAt": "2026-01-15T12:05:00Z"
}
json

Session Statuses

StatusDescription
pendingSession created, waiting for user to open widget
connectedUser opened the widget
processingDocuments uploaded, AI verification in progress
completedVerification finished and approved (check webhook for result)
failedVerification failed — reopens for resubmission within TTL (see Direct API)
expiredSession expired before completion
manual_reviewAutomated checks were inconclusive; a human reviewer is deciding. Frozen: does not expire on TTL and rejects further uploads. See Manual review
rejectedA reviewer rejected the verification. Closed permanently — create a new session

Need Help?

Get in touch with our team for technical support.

Contact Support