KYC Docs Get credentials
Docs › Blink API › Session API

Session API

Your backend creates one session per verification attempt and hands the session token to the app. Create it when the customer starts, not ahead of time — sessions are short-lived.

method POST path /api/blink/session/create auth client key + secret

Request

POST https://kyc-api.blink-pay.net/api/blink/session/createhttp
curl -sX POST https://kyc-api.blink-pay.net/api/blink/session/create \
  -H 'content-type: application/json' \
  -d '{
        "clientKey":    "bkyc_live_…",
        "clientSecret": "bksec_…",
        "purpose":      "FULL_CAPTURE",
        "userRef":      "customer-8841"
      }'
FieldTypeRequiredDescription
clientKeystringyesYour client key.
clientSecretstringyesYour client secret.
purposestringnoFULL_CAPTURE (default), DOCUMENT_VERIFICATION, LIVENESS, FACE_MATCH. See Use cases.
userRefstringnoYour own opaque reference for the customer. Don't put personal data in it.
originAllowliststring[]noWeb only: browser origins allowed to use this session's token.

Response

200 OKjson
{
  "sessionId":    "[SESSION_ID]",
  "sessionToken": "bkyc_sess_…",
  "expiresAt":    "2026-09-15T18:42:10Z",
  "purpose":      "FULL_CAPTURE"
}
FieldDescription
sessionIdUUID. Store it against your customer — you need it for the Result API. Never send it as a credential.
sessionTokenGive this, and only this, to the SDK or a hosted link.
expiresAtWhen the token stops working.
purposeThe purpose the session was created with.

Example backend endpoint

Wrap the call in an endpoint of your own that your app calls after authenticating the customer:

server.jsjavascript
app.post('/kyc/sessions', requireUser, async (req, res) => {
  const r = await fetch('https://kyc-api.blink-pay.net/api/blink/session/create', {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({
      clientKey: process.env.BLINK_CLIENT_KEY,
      clientSecret: process.env.BLINK_CLIENT_SECRET,
      purpose: 'FULL_CAPTURE',
      userRef: req.user.id,
    }),
  });
  if (!r.ok) return res.status(502).json({ error: 'kyc_unavailable' });

  const { sessionId, sessionToken, expiresAt } = await r.json();
  await db.kycSessions.insert({ userId: req.user.id, sessionId, status: 'CREATED' });
  res.json({ sessionId, sessionToken, expiresAt });   // never the key or secret
});

A Dart version is in the Flutter guide.

Errors

CodeHTTPMeaning
BLINK_CLIENT_MISSING400Credentials were not supplied.
BLINK_CLIENT_AUTH_FAILED400Credentials were not accepted.
BLINK_UNKNOWN_PURPOSE400purpose is not one of the four values.
BLINK_SCOPE_DENIED400That product is not enabled for your client.
BLINK_QUOTA_EXCEEDED429Your plan's quota is used up.
BLINK_RATE_LIMITED429Too many requests — wait for Retry-After seconds.