### Minimal Device Intelligence Usage Example
Source: https://docs.sumsub.com/reference/get-started-with-device-intelligence
A minimal setup example demonstrating how to initialize, capture a fingerprint, and destroy the Device Intelligence SDK instance.
```javascript
import { init, destroy } from '@sumsub/fisherman'
const fisherman = await init({ token })
const handleLoginSubmit = async () => {
await fisherman.fingerprint();
// Confirm applicant platform event
destroy();
// Redirect user
}
```
--------------------------------
### Get Started with API
Source: https://docs.sumsub.com/reference/get-started-with-api
This section provides an overview of how to get started with the Sumsub API, including authentication and basic usage patterns.
```APIDOC
## Introduction
This document outlines the Sumsub API, enabling programmatic access to identity verification services. It covers authentication, core endpoints, and data structures.
### Authentication
API requests must be authenticated using an API Token. The token should be included in the `X-App-Token` header of your requests.
```
X-App-Token: YOUR_API_TOKEN
```
Replace `YOUR_API_TOKEN` with your actual Sumsub API token.
### Base URL
All API endpoints are relative to the following base URL:
```
https://api.sumsub.com
```
### Rate Limiting
The Sumsub API enforces rate limits to ensure service stability. Exceeding these limits may result in temporary blocking of requests. Please refer to the Sumsub dashboard for specific rate limit details.
### Error Handling
API responses include standard HTTP status codes. Error responses typically contain a JSON body with an error code and message.
```json
{
"code": "ERROR_CODE",
"message": "Error description"
}
```
```
--------------------------------
### Retrieve Webhook Logs
Source: https://docs.sumsub.com/docs/webhook-logs
Example of how to retrieve webhook logs using a GET request. This is a common starting point for debugging webhook issues.
```bash
curl -X GET \
'https://api.sumsub.com/webhook-logs?limit=100&offset=0' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```
--------------------------------
### Initialize WebSDK 1.0 with Customization
Source: https://docs.sumsub.com/docs/get-started-with-web-sdk
This snippet shows how to initialize and launch the WebSDK 1.0 with custom CSS and i18n configurations. It includes event listeners for step completion, errors, and messages. Replace `$ACCESS_TOKEN` and `$NEW_ACCESS_TOKEN` with your actual tokens.
```html
WebSDK CDN Example
```
--------------------------------
### Basic Webhook Endpoint Setup
Source: https://docs.sumsub.com/docs/webhook-manager
This snippet demonstrates a basic Express.js server setup to receive webhook POST requests. Ensure you have Express.js installed (`npm install express`).
```javascript
const express = require('express');
const app = express();
const port = 3000;
// Middleware to parse JSON bodies
app.use(express.json());
// POST endpoint for webhooks
app.post('/webhook', (req, res) => {
console.log('Received webhook:', req.body);
// Process the webhook data here
res.sendStatus(200);
});
app.listen(port, () => {
console.log(`Webhook server listening on port ${port}`);
});
```
--------------------------------
### Configuring SDK with Direct Integration
Source: https://docs.sumsub.com/docs/sdk-customization
This example shows how to initialize the Sumsub SDK for direct integration, bypassing the default web view. Ensure your backend is set up to handle direct API calls.
```javascript
sumsub.init(TOKEN, {
config: {
directSDK: true
}
});
```
--------------------------------
### Initialize Sumsub SDK with Customization Options
Source: https://docs.sumsub.com/docs/sdk-customization
Example of initializing the Sumsub SDK with custom configuration. This sets up the SDK for your specific integration needs.
```javascript
const sumsub = new SumSubSdk(
'YOUR_ACCESS_TOKEN',
'YOUR_APP_ID',
'YOUR_BASE_URL'
);
sumsub.init({
// Customization options go here
// For example:
// lang: 'en',
// theme: 'dark',
// onComplete: (data) => {
// console.log('Verification complete:', data);
// },
});
```
--------------------------------
### Make a GET Request
Source: https://docs.sumsub.com/reference/get-started-with-api
Example of making a GET request to the Sumsub API. This is typically used for retrieving information about verification statuses or user data.
```javascript
const axios = require('axios');
const secret = 'YOUR_SECRET_KEY';
const timestamp = Math.floor(Date.now() / 1000);
const signature = generateSignature(secret, timestamp);
async function getVerificationStatus(applicantId) {
try {
const response = await axios.get(`https://api.sumsub.com/resources/applicants/${applicantId}?key=YOUR_API_KEY×tamp=${timestamp}&sig=${signature}`);
return response.data;
} catch (error) {
console.error('Error fetching verification status:', error);
throw error;
}
}
```
--------------------------------
### Initialize WebSDK 2.0
Source: https://docs.sumsub.com/docs/get-started-with-web-sdk
This snippet demonstrates how to initialize and launch the WebSDK 2.0 using a CDN. It includes basic configuration for language, email, and phone, along with event listeners for step completion, errors, and general messages. Ensure you replace `$ACCESS_TOKEN` and `$NEW_ACCESS_TOKEN` with your actual tokens.
```html
WebSDK CDN Example
```
--------------------------------
### File Attachment Question Type Example
Source: https://docs.sumsub.com/docs/review-questionnaire-structure
Example of the `fileAttachment` type of question. Note that there is no placeholder with the question, still you get the `placeholder` and `localizedPlaceholder` fields in the API response.
```json
{
"id":"fileUploadId",
"title":"File upload",
"localizedTitle":{
"values":[
{
"lang":"en",
"value":"File upload"
}
]
},
"desc":"Question 11",
"localizedDesc":{
"values":[
{
"lang":"en",
"value":"Question 11"
}
]
},
"type":"fileAttachment",
"required":true,
"format":null,
"condition":null,
"showCondition":null,
"placeholder":"",
"localizedPlaceholder":{
"values":[
{
"lang":"en",
"value":""
}
]
},
"options":null
}
```
--------------------------------
### Get Fraud Network by ID Request
Source: https://docs.sumsub.com/reference/get-fraud-network-by-id
This cURL example demonstrates how to make a GET request to retrieve a fraud network by its ID. Ensure you replace placeholders with your actual application token, signature, and timestamp.
```curl
curl -X GET \
'https://api.sumsub.com/resources/applicantFraudNetworks/networkId/one' \
-H 'X-App-Token: ' \
-H 'X-App-Access-Sig: ' \
-H 'X-App-Access-Ts: '
```
--------------------------------
### Configuring SDK Appearance and Behavior
Source: https://docs.sumsub.com/docs/sdk-customization
This example shows how to initialize the Sumsub SDK with various configuration options to customize its appearance and behavior. This includes setting the theme, language, and enabling/disabling specific features.
```javascript
sumsub.init(TOKEN, {
theme: 'light',
language: 'en',
// Example of disabling a specific feature
// disableFaceTecSDK: true,
// Example of enabling a specific feature
// enableEmailVerification: true,
// ... other configuration options
});
```
--------------------------------
### Get Cases by Filters - Success Response Example
Source: https://docs.sumsub.com/reference/get-cases-by-filters
This example demonstrates a successful response when retrieving cases. It includes a list of cases, each with detailed information about the applicant, review status, and associated AML cases.
```APIDOC
## Get Cases by Filters
### Description
Retrieves a list of cases based on specified filters.
### Method
GET
### Endpoint
`/cases` (This is an inferred endpoint based on the context of retrieving cases)
### Parameters
#### Query Parameters
- **limit** (integer) - Optional - The maximum number of items to return.
- **offset** (integer) - Optional - The number of items to skip before starting to collect the result set.
### Response
#### Success Response (200)
- **list** (object) - Contains the list of cases and pagination information.
- **items** (array) - An array of case objects.
- **id** (string) - The unique identifier of the case.
- **name** (string) - The name of the case.
- **applicantReference** (object) - Reference to the applicant.
- **applicantId** (string) - The applicant's ID.
- **fullName** (string) - The applicant's full name.
- **createdByType** (string) - The type of entity that created the case.
- **groupByType** (string) - The type used for grouping cases.
- **createdByRule** (object) - Information about the rule that created the case.
- **id** (string) - The rule's ID.
- **name** (string) - The rule's name.
- **title** (string) - The rule's title.
- **revision** (integer) - The rule's revision number.
- **createdAt** (string) - The timestamp when the case was created.
- **updatedAt** (string) - The timestamp when the case was last updated.
- **totalAmountInDefaultCurrency** (number) - The total amount in the default currency.
- **clientId** (string) - The client's ID.
- **review** (object) - Information about the review.
- **reviewId** (string) - The review's ID.
- **attemptId** (string) - The attempt's ID.
- **attemptCnt** (integer) - The number of attempts.
- **createDate** (string) - The date the review was created.
- **reviewStatus** (string) - The status of the review.
- **applicantInfo** (object) - Information about the applicant.
- **firstName** (string) - The applicant's first name.
- **firstNameEn** (string) - The applicant's first name in English.
- **middleName** (string) - The applicant's middle name.
- **middleNameEn** (string) - The applicant's middle name in English.
- **lastName** (string) - The applicant's last name.
- **lastNameEn** (string) - The applicant's last name in English.
- **country** (string) - The applicant's country.
- **blueprintReference** (object) - Reference to the blueprint.
- **name** (string) - The blueprint's name.
- **blueprintId** (string) - The blueprint's ID.
- **caseReview** (object) - Information about the case review.
- **status** (string) - The status of the case review.
- **checklistState** (object) - The state of the checklist.
- **checklist** (array) - An array of checklist items.
- **name** (string) - The name of the checklist item.
- **checked** (boolean) - Whether the item is checked.
- **amlCases** (array) - An array of AML case objects.
- **amlCaseId** (string) - The AML case ID.
- **priority** (string) - The priority of the case.
- **totalItems** (integer) - The total number of items returned.
- **pageInfo** (object) - Pagination information.
- **limit** (integer) - The limit for the current page.
- **offset** (integer) - The offset for the current page.
#### Response Example
```json
{
"list": {
"items": [
{
"id": "69ce2a555b353c0000000000",
"name": "Check counterparty for AML (sanctions, peps, etc.) - John Doe",
"applicantReference": {
"applicantId": "69a6974e0ad36b0000000000",
"fullName": "John Doe"
},
"createdByType": "byRule",
"groupByType": "byRule",
"createdByRule": {
"id": "6970bfd90eefbc0000000000",
"name": "che-cou-for-aml-san-peps-etc-DKsb",
"title": "Check counterparty for AML (sanctions, peps, etc.)",
"revision": 3
},
"createdAt": "2026-04-02 08:35:33+0000",
"updatedAt": "2026-04-02 08:35:33+0000",
"totalAmountInDefaultCurrency": 50000,
"clientId": "your_cool_id",
"review": {
"reviewId": "KlLJY",
"attemptId": "sGjxs",
"attemptCnt": 0,
"createDate": "2026-04-02 08:35:33+0000",
"reviewStatus": "init"
},
"applicantInfo": {
"firstName": "John",
"firstNameEn": "John",
"middleName": "Jack",
"middleNameEn": "Jack",
"lastName": "Doe",
"lastNameEn": "Doe",
"country": "USA"
},
"blueprintReference": {
"name": "brand new BP",
"blueprintId": "6970bf0a0eefbc0000000000"
},
"caseReview": {
"status": "open",
"checklistState": {
"checklist": [
{
"name": "checklist action 1",
"checked": false
},
{
"name": "checklist action 2",
"checked": false
},
{
"name": "checklist action 3",
"checked": false
},
{
"name": "checklist action 4",
"checked": false
}
]
}
},
"amlCases": [
{
"amlCaseId": "69ce2a535b353c0000000000"
}
],
"priority": "medium"
}
],
"totalItems": 2,
"pageInfo": {
"limit": 10,
"offset": 0
}
}
}
```
```
--------------------------------
### Initialize and Configure SDK
Source: https://docs.sumsub.com/docs/non-doc-identity-verification
Initializes the Sumsub SDK with your access token and configuration. Use this to set up the verification flow.
```javascript
const access_token = "YOUR_ACCESS_TOKEN";
const config = {
lang: "en",
// ... other configuration options
};
sumsub.init(access_token, config).then(() => {
console.log("Sumsub SDK initialized successfully");
}).catch((error) => {
console.error("Sumsub SDK initialization failed:", error);
});
```
--------------------------------
### Get Applicant Status (JavaScript)
Source: https://docs.sumsub.com/reference/get-started-with-api
This JavaScript example shows how to fetch the status of an applicant using their ID.
```javascript
const axios = require('axios');
const apiUrl = 'https://api.sumsub.com';
const apiKey = 'YOUR_API_KEY';
const applicantId = 'YOUR_APPLICANT_ID';
async function getApplicantStatus() {
try {
const response = await axios.get(`${apiUrl}/resources/applicants/${applicantId}/status?key=${apiKey}`);
console.log('Applicant status:', response.data);
return response.data;
} catch (error) {
console.error('Error getting applicant status:', error.response ? error.response.data : error.message);
}
}
getApplicantStatus();
```
--------------------------------
### Setting up Custom UI Configuration
Source: https://docs.sumsub.com/docs/sdk-customization
Demonstrates how to configure the SDK's user interface with custom colors and styles. This allows for branding alignment.
```swift
let config = SumsubConfig(
accessToken: "YOUR_ACCESS_TOKEN",
// ... other config parameters
uiConfig: SumsubUIConfig(
// ... other UI config parameters
primaryColor: UIColor.hex("#007AFF"),
secondaryColor: UIColor.hex("#5AC8FA"),
buttonTextColor: UIColor.white
)
)
SumsubSDK.shared.present(config: config, delegate: self)
```
--------------------------------
### Initialize and Launch Sumsub WebSDK
Source: https://docs.sumsub.com/docs/configure-verification-levels
This snippet demonstrates how to initialize and launch the Sumsub WebSDK using a provided access token. It includes configurations for language and event handling.
```javascript
import snsWebSdk from '@sumsub/websdk';
/**
* @param accessToken - access token that you generated
* on the backend with levelName: sumsub-signin-demo-level
*/
function launchWebSdk(accessToken) {
let snsWebSdkInstance = snsWebSdk.init(
accessToken,
// token update callback, must return Promise
() => this.getNewAccessToken()
)
.withConf({
//language of WebSDK texts and comments (ISO 639-1 format)
lang: 'en',
})
.on('onError', (error) => {
console.log('onError', payload)
})
.onMessage((type, payload) => {
console.log('onMessage', type, payload)
})
.build();
// you are ready to go:
// just launch the WebSDK by providing the container element for it
snsWebSdkInstance.launch('#sumsub-websdk-container')
}
```
--------------------------------
### Get Signed Document (QES) - Not Found Response Example
Source: https://docs.sumsub.com/reference/get-signed-document-qes
Example of an HTTP 404 Not Found response when the specified applicant or document is not found. It includes a description of the error, the status code, and a correlation ID for tracking.
```json
{
"description" : "Applicant with id 67332d69a03e196d72ec4a11 not found",
"code" : 404,
"correlationId" : "ec2e24b561c852d10217f3ce97920ce9"
}
```
--------------------------------
### Example API Request (Go)
Source: https://docs.sumsub.com/reference/get-started-with-api
Shows how to make an API request using Go's standard 'net/http' package. This creates a new applicant.
```go
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.sumsub.com/resources/applicants"
appToken := "YOUR_APP_TOKEN"
data := map[string]string{
"externalUserId": "a1b2c3d4e5f6",
"type": "EMAIL",
"email": "test@example.com",
}
jsonData, err := json.Marshal(data)
if err != nil {
fmt.Println("Error marshaling JSON:", err)
return
}
client := &http.Client{}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
auth := appToken + ":"
encodedAuth := base64.StdEncoding.EncodeToString([]byte(auth))
req.Header.Set("Authorization", "Basic "+encodedAuth)
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
```
--------------------------------
### Get Document Images Request Example
Source: https://docs.sumsub.com/reference/get-document-images
Use this cURL command to make a GET request to retrieve document images for a given inspection and image ID. Ensure you replace placeholders with your actual App Token, signature, and timestamp.
```curl
curl -X GET \
'https://api.sumsub.com/resources/inspections/abc123/resources/123456789' \
-H 'X-App-Token: ' \
-H 'X-App-Access-Sig: ' \
-H 'X-App-Access-Ts: '
```
--------------------------------
### Get Cases by Filters - Error Response Example
Source: https://docs.sumsub.com/reference/get-cases-by-filters
This example illustrates an error response, specifically an HTTP 400 Bad Request, which occurs due to malformed filtering parameters, an empty request body, or invalid field names.
```APIDOC
## Get Cases by Filters - Error Response
### Description
Handles errors when retrieving cases, such as malformed parameters or invalid fields.
### Method
GET
### Endpoint
`/cases` (This is an inferred endpoint based on the context of retrieving cases)
### Response
#### Error Response (400)
- **code** (integer) - The HTTP status code (e.g., 400).
- **correlationId** (string) - A unique identifier for tracing the request.
- **description** (string) - A message explaining the error.
- **type** (string) - The type of exception that occurred.
#### Response Example
```json
{
"code": 400,
"correlationId": "b66c98b82f7ed5e026fb4965975f6739",
"description": "Invalid parameters provided",
"type": "de.smtdp.commons.service.exceptions.ServiceException"
}
```
```
--------------------------------
### Configure Sumsub Web SDK with Customization
Source: https://docs.sumsub.com/docs/non-doc-address-verification
This example shows how to customize the appearance and behavior of the Sumsub Web SDK using configuration options during initialization. This includes setting the theme and language.
```javascript
import { sumsub } from '@sumsub/websdk';
const accessToken = 'YOUR_ACCESS_TOKEN';
const apiUrl = 'https://your-api-url.com';
const lang = 'en';
const customization = {
theme: 'dark', // or 'light'
lang: 'es' // override language if needed
};
sumsub.init(accessToken, { apiUrl, lang, customization })
.then((result) => {
console.log('SDK initialized successfully:', result);
sumsub.open();
})
.catch((error) => {
console.error('SDK initialization failed:', error);
});
```