Integration Guide

Step-by-step guide to integrating AdvanGuard's verification API into your product.

Prerequisites

  • An AdvanGuard account with API Key access
  • At least one Level configured in your Dashboard (see Configure a Level)
  • A registered Webhook endpoint for receiving results

Step 1 — Create a Profile

Before creating a verification Application, ensure a Profile exists for the user. If a Profile already exists for a given externalUserId, you can skip this step — the Application creation will automatically associate the Profile.

POST https://openapi.advance.ai/v2/profiles

{
  "externalUserId": "user_123456",
  "fixedInfo": {
    "firstName": "John",
    "lastName": "Doe",
    "dob": "1990-01-15",
    "nationality": "GBR"
  },
  "email": "[email protected]",
  "phone": "+447700900123"
}
{
  "profileId": "prf_a1b2c3d4e5f6",
  "externalUserId": "user_123456",
  "status": "init",
  "createdAt": "2026-05-01T10:00:00Z"
}

Step 2 — Create an Application

POST https://openapi.advance.ai/v2/applications

{
  "externalUserId": "user_123456",
  "levelId": "basic-kyc",
  "conflictStrategy": "RESUME_SAME_LEVEL"
}
{
  "applicationId": "app_x9y8z7w6v5u4",
  "profileId": "prf_a1b2c3d4e5f6",
  "levelId": "basic-kyc",
  "status": "init",
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "tokenExpiresAt": "2026-05-01T11:00:00Z",
  "createdAt": "2026-05-01T10:05:00Z"
}

The token is a short-lived SDK access token (default 1 hour). Pass it to your frontend to initialize the AdvanGuard SDK. Do not expose your API Key to the frontend.


Step 3 — Initialize the SDK (Frontend)

// Web SDK initialization
const advanGuard = new AdvanGuard({
  token: "<APPLICATION_TOKEN_FROM_BACKEND>",
  onComplete: (result) => {
    // result.applicationId, result.status
    console.log("Verification submitted:", result);
  },
  onError: (error) => {
    console.error("Verification error:", error);
  }
});

advanGuard.launch();

Step 4 — Handle Webhooks

Register your Webhook endpoint in the Dashboard under Settings → Webhooks. AdvanGuard will POST events to your endpoint on every Application status change.

{
  "eventId": "evt_abc123def456",
  "type": "application.completed",
  "applicationId": "app_x9y8z7w6v5u4",
  "externalUserId": "user_123456",
  "profileId": "prf_a1b2c3d4e5f6",
  "levelId": "basic-kyc",
  "status": "completed",
  "reviewAnswer": "GREEN",
  "createdAtMs": 1746093600000
}
Event TypeDescriptionreviewAnswer
application.initApplication created-
application.pendingCollection complete, checks running-
application.onHoldAwaiting manual review-
application.completedVerification finishedGREENor RED
application.terminatedApplication cancelled or timed out-

Step 5 — Query the Application (optional)

You can also poll the Application status directly rather than relying solely on Webhooks.

GET/v2/applications/{applicationId}


Did this page help you?