Create session
curl --request POST \
--url https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions \
--header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"name": "Jane Doe verification",
"description": "Real-person portrait group",
"callback_url": "https://www.example.com/callback"
}'import requests
url = "https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions"
payload = {
"name": "Jane Doe verification",
"callback_url": "https://www.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jane Doe verification',
callback_url: 'https://www.example.com/callback'
})
};
fetch('https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"BytedToken": "202603311449168C23BA26**************",
"H5Link": "https://h5-v2.kych5.com/verify?bytedToken=202603311449168C23BA26**************&lng=en",
"CallbackURL": "https://www.example.com/callback"
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}Assets API
Create a real-person verification session
Create a single-use H5 verification session; save the token and complete the flow within 120 seconds.
POST
/
assets
/
real-human
/
verification-sessions
Create session
curl --request POST \
--url https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions \
--header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"name": "Jane Doe verification",
"description": "Real-person portrait group",
"callback_url": "https://www.example.com/callback"
}'import requests
url = "https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions"
payload = {
"name": "Jane Doe verification",
"callback_url": "https://www.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jane Doe verification',
callback_url: 'https://www.example.com/callback'
})
};
fetch('https://gengen.farm/api/gengen/v1/assets/real-human/verification-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"BytedToken": "202603311449168C23BA26**************",
"H5Link": "https://h5-v2.kych5.com/verify?bytedToken=202603311449168C23BA26**************&lng=en",
"CallbackURL": "https://www.example.com/callback"
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}{
"error_code": "<string>",
"error": "<string>",
"error_params": {}
}Authorizations
A workspace API key beginning with gengen_live_.
Body
application/json
Response
A short-lived H5 verification session.
Short-lived token used to retrieve the created asset group.
Single-use H5 verification link. Append lng with zh, en, or zh-Hant to select the interface language.
Destination URL opened after verification. A resultCode of 10000 indicates success; other callback fields include bytedToken, algorithmBaseRespCode, reqMeasureInfoValue, and verify_type.