
Creates a new KYC verification session. Returns a session ID and a URL to redirect the user to complete their verification.
| Parameter | Type | Required | Description |
|---|---|---|---|
| did | string | Required | The subject's DID. W3C DID format (did:solidus:, did:ethr:, did:key:) |
| level | integer | Required | Verification level: 1 (basic), 2 (passport + liveness), 3 (enhanced) |
| redirect_url | string | Required | URL to redirect user after verification completes |
| metadata | object | Optional | Arbitrary key-value pairs attached to the session |
| webhook_url | string | Optional | Override endpoint for this session's webhooks |
| expires_in | integer | Optional | Session TTL in seconds (default: 3600) |
{
"id": "vsn_9f8e7d6c5b4a3291",
"did": "did:solidus:mainnet:7a3b8c9d2e1f4a6b",
"level": 2,
"status": "pending",
"url": "https://verify.solidus.network/s/vsn_9f8e7d6c",
"expires_at": 1773666000,
"created_at": 1773662400,
"webhook_url": null,
"metadata": { "userId": "usr_7a3b8c9d" }
}import { Solidus } from '@solidus/verify';
const solidus = new Solidus('sk_live_••••••••••••••••••••34ab');
const session = await solidus.sessions.create({
did: 'did:solidus:mainnet:7a3b8c9d2e1f4a6b',
level: 2,
redirectUrl: 'https://app.acmecorp.com/verify/done',
metadata: {
userId: 'usr_7a3b8c9d'
}
});{
"id": "vsn_9f8e7d6c5b4a3291",
"did": "did:solidus:mainnet:7a3b8c9d2e1f4a6b",
"level": 2,
"status": "pending",
"url": "https://verify.solidus.network/s/vsn_9f8e7d6c",
"expires_at": 1773666000,
"created_at": 1773662400,
"webhook_url": null,
"metadata": { "userId": "usr_7a3b8c9d" }
}