Backend Verification & Webhooks

To guarantee security and prevent client-side response tampering, your backend server should always perform server-to-server verification or listen for webhooks before granting user access or updating account states.


1. Backend Session Lookup API

When the client-side SDK finishes a verification flow, it returns a session_id. Send this session_id to your backend server, where your server can query Prembly's backend API securely using your Secret Key.

Endpoint Specification

GET /api/v1/checker-widget/sdk/sessions/{session_id}/ HTTP/1.1
Host: api.prembly.com
x-api-key: your_secret_api_key
x-organisation-id: your_org_id
Content-Type: application/json

Request Headers

HeaderDescriptionRequired
x-api-keyYour Secret API Key (found in Integrations & API in the dashboard).Yes
x-organisation-idYour Prembly Organisation ID.Yes

Response Example

{
  "status": true,
  "detail": "Session fetched successfully",
  "response": {
    "session_id": "550e8400-e29b-41d4-a716-446655440000",
    "verification_status": "VERIFIED",
    "user_ref": "usr_9921",
    "confidence_score": 0.98,
    "created_at": "2026-10-06T10:00:00Z",
    "metadata": {
      "internal_user_id": "usr_9921",
      "plan": "premium"
    }
  }
}

metadata is the object you passed when starting the verification, returned as sent — with one exception: if you prefilled a BVN or NIN and it was used, the ID number is removed from metadata and does not appear here or in webhooks. An ID that was ignored stays in metadata as sent. Keys set on the widget in the dashboard are not included.


2. Webhooks

When a user finishes an SDK session, Prembly sends an SDK session completed webhook to your organisation's webhook URL.

The Webhooks guide covers everything you need:

Confirm before you grant access

Treat the webhook as a signal that a session finished. Before you grant access or change a user's status, call the session lookup API above with your secret key and act on its response.

On this page

Prembly Slack Community

Join our developer Slack channel for real-time integration support, engineering updates, and direct Q&A with the Prembly team.

Join Slack Channel