SDK Utilities
SDK Settings
Configure the liveness-check behavior (security threshold, which actions to require, whether to randomize them, how many, and per-action duration) used by the Anti-Deepfake Liveness SDK.
POST
/
v2
/
sdk
/
identity
/
liveness
/
settings
SDK Settings
curl --request POST \
--url https://api.youverify.co/v2/sdk/identity/liveness/settings \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"threshold": "mid",
"actions": [
"faceRotation",
"openMouth",
"blink"
],
"randomizeActions": true,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"blink": 2
}
}
'import requests
url = "https://api.youverify.co/v2/sdk/identity/liveness/settings"
payload = {
"threshold": "mid",
"actions": ["faceRotation", "openMouth", "blink"],
"randomizeActions": True,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"blink": 2
}
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
threshold: 'mid',
actions: ['faceRotation', 'openMouth', 'blink'],
randomizeActions: true,
numberofActions: 3,
actionsDuration: {faceRotation: 5, openMouth: 3, blink: 2}
})
};
fetch('https://api.youverify.co/v2/sdk/identity/liveness/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.youverify.co/v2/sdk/identity/liveness/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'threshold' => 'mid',
'actions' => [
'faceRotation',
'openMouth',
'blink'
],
'randomizeActions' => true,
'numberofActions' => 3,
'actionsDuration' => [
'faceRotation' => 5,
'openMouth' => 3,
'blink' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.youverify.co/v2/sdk/identity/liveness/settings"
payload := strings.NewReader("{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.youverify.co/v2/sdk/identity/liveness/settings")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.youverify.co/v2/sdk/identity/liveness/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "liveness settings updated successfully!",
"data": {
"threshold": "high",
"actions": [
"faceRotation",
"openMouth",
"blink"
],
"randomizeActions": true,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"zoom": 0,
"blink": 2
},
"businessId": "62b2e8b281442b03187f7896",
"createdAt": "2024-09-09T08:24:35.285Z",
"lastModifiedAt": "2024-09-09T13:08:26.490Z",
"id": "66deb0c395f3cd56ddfe6a17"
},
"links": []
}{
"success": false,
"statusCode": 401,
"message": "Permission denied",
"name": "UnauthorizedError",
"data": {}
}{
"success": false,
"statusCode": 402,
"message": "Insufficient fund",
"name": "PaymentRequiredError",
"data": {}
}{
"success": false,
"statusCode": 404,
"message": "You have attempted to get a resource that does not exist.",
"name": "ResourceNotFoundError",
"data": {}
}{
"success": false,
"statusCode": 429,
"message": "Too many requests",
"name": "RateLimitError",
"data": {}
}{
"success": false,
"statusCode": 500,
"message": "Internal Server Error",
"name": "Error",
"data": {}
}Authorizations
Your Youverify API secret key. Never expose client-side.
Headers
API secret token
Body
application/json
Security threshold for liveness detection. Default: "low".
Available options:
low, mid, high Liveness actions to require.
Available options:
faceRotation, openMouth, zoom, blink, passive, motion, yesOrNo Whether to randomize the actions during the session. Default: false.
Number of actions to perform in the session. Default: 1.
Per-action duration in seconds.
Show child attributes
Show child attributes
Response
Success
⌘I
SDK Settings
curl --request POST \
--url https://api.youverify.co/v2/sdk/identity/liveness/settings \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"threshold": "mid",
"actions": [
"faceRotation",
"openMouth",
"blink"
],
"randomizeActions": true,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"blink": 2
}
}
'import requests
url = "https://api.youverify.co/v2/sdk/identity/liveness/settings"
payload = {
"threshold": "mid",
"actions": ["faceRotation", "openMouth", "blink"],
"randomizeActions": True,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"blink": 2
}
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
threshold: 'mid',
actions: ['faceRotation', 'openMouth', 'blink'],
randomizeActions: true,
numberofActions: 3,
actionsDuration: {faceRotation: 5, openMouth: 3, blink: 2}
})
};
fetch('https://api.youverify.co/v2/sdk/identity/liveness/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.youverify.co/v2/sdk/identity/liveness/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'threshold' => 'mid',
'actions' => [
'faceRotation',
'openMouth',
'blink'
],
'randomizeActions' => true,
'numberofActions' => 3,
'actionsDuration' => [
'faceRotation' => 5,
'openMouth' => 3,
'blink' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.youverify.co/v2/sdk/identity/liveness/settings"
payload := strings.NewReader("{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.youverify.co/v2/sdk/identity/liveness/settings")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.youverify.co/v2/sdk/identity/liveness/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"threshold\": \"mid\",\n \"actions\": [\n \"faceRotation\",\n \"openMouth\",\n \"blink\"\n ],\n \"randomizeActions\": true,\n \"numberofActions\": 3,\n \"actionsDuration\": {\n \"faceRotation\": 5,\n \"openMouth\": 3,\n \"blink\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "liveness settings updated successfully!",
"data": {
"threshold": "high",
"actions": [
"faceRotation",
"openMouth",
"blink"
],
"randomizeActions": true,
"numberofActions": 3,
"actionsDuration": {
"faceRotation": 5,
"openMouth": 3,
"zoom": 0,
"blink": 2
},
"businessId": "62b2e8b281442b03187f7896",
"createdAt": "2024-09-09T08:24:35.285Z",
"lastModifiedAt": "2024-09-09T13:08:26.490Z",
"id": "66deb0c395f3cd56ddfe6a17"
},
"links": []
}{
"success": false,
"statusCode": 401,
"message": "Permission denied",
"name": "UnauthorizedError",
"data": {}
}{
"success": false,
"statusCode": 402,
"message": "Insufficient fund",
"name": "PaymentRequiredError",
"data": {}
}{
"success": false,
"statusCode": 404,
"message": "You have attempted to get a resource that does not exist.",
"name": "ResourceNotFoundError",
"data": {}
}{
"success": false,
"statusCode": 429,
"message": "Too many requests",
"name": "RateLimitError",
"data": {}
}{
"success": false,
"statusCode": 500,
"message": "Internal Server Error",
"name": "Error",
"data": {}
}