curl --request POST \
--url https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "passport front.jpg",
"id_doc_type": "PASSPORT"
}
'import requests
url = "https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url"
payload = {
"file_name": "passport front.jpg",
"id_doc_type": "PASSPORT"
}
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({file_name: 'passport front.jpg', id_doc_type: 'PASSPORT'})
};
fetch('https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"passport front.jpg\",\n \"id_doc_type\": \"PASSPORT\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url",
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([
'file_name' => 'passport front.jpg',
'id_doc_type' => 'PASSPORT'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Verification session document upload URL generated successfully.",
"data": {
"url": "https://blaaiz-compliance-prod-storage.s3.eu-west-1.amazonaws.com/merchant-kyc/9d4c4ec5/9f2c7b41/4a7f1c92e0_passport%20front.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=EXAMPLE",
"file_name": "4a7f1c92e0_passport front.jpg",
"headers": {}
}
}{
"message": "Invalid or missing access token"
}{
"message": "The Signa feature is not enabled for this business.",
"status": 403
}{
"message": "Verification session not found."
}{
"message": "Documents of type SELFIE are not accepted for this session; the selfie is captured on the verification link."
}Create a document upload URL
Get a presigned URL for one document, then send the file to it with an HTTP PUT, then register the file on the documents endpoint. Use this transport for every real document: a request body larger than about 8 KB is rejected at the network edge. The URL is valid for 5 minutes and the staged file must be 5 MB or smaller. The session must be HEADLESS. A HOSTED session refuses the call with a 422, because the end customer supplies the documents on the verification link. Signa must be enabled for your business. Required scope: compliance-kyc:create.
curl --request POST \
--url https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "passport front.jpg",
"id_doc_type": "PASSPORT"
}
'import requests
url = "https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url"
payload = {
"file_name": "passport front.jpg",
"id_doc_type": "PASSPORT"
}
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({file_name: 'passport front.jpg', id_doc_type: 'PASSPORT'})
};
fetch('https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"passport front.jpg\",\n \"id_doc_type\": \"PASSPORT\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.blaaiz.com/api/external/compliance/kyc/sessions/{sessionId}/documents/upload-url",
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([
'file_name' => 'passport front.jpg',
'id_doc_type' => 'PASSPORT'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Verification session document upload URL generated successfully.",
"data": {
"url": "https://blaaiz-compliance-prod-storage.s3.eu-west-1.amazonaws.com/merchant-kyc/9d4c4ec5/9f2c7b41/4a7f1c92e0_passport%20front.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=EXAMPLE",
"file_name": "4a7f1c92e0_passport front.jpg",
"headers": {}
}
}{
"message": "Invalid or missing access token"
}{
"message": "The Signa feature is not enabled for this business.",
"status": 403
}{
"message": "Verification session not found."
}{
"message": "Documents of type SELFIE are not accepted for this session; the selfie is captured on the verification link."
}Authorizations
Use your OAuth client credentials to obtain a short-lived Bearer token from POST /oauth/token.
Path Parameters
The verification session id returned by the create endpoint.
Body
Your name for the file. Use letters, numbers, spaces, dashes, or underscores, and end it in .jpg, .jpeg, .png, .webp, or .pdf. Blaaiz adds a random prefix and returns the result in data.file_name.
128^[a-zA-Z0-9_ -]+\.(jpg|jpeg|png|webp|pdf)$What the document is. UTILITY_BILL and BANK_STATEMENT satisfy the proof-of-address step. Every other type except SELFIE satisfies the documents step. Which types a session accepts depends on its requirement set. A session that includes SELFIE rejects a SELFIE upload, because Blaaiz captures the selfie.
PASSPORT, ID_CARD, DRIVERS, RESIDENCE_PERMIT, UTILITY_BILL, BANK_STATEMENT, SELFIE Was this page helpful?