Export Results
curl --request GET \
--url https://api.example.com/exports/{jobId}import requests
url = "https://api.example.com/exports/{jobId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/exports/{jobId}', 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.example.com/exports/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/exports/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/exports/{jobId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exports/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyReporting & Analytics
Export Results
Export Results
curl --request GET \
--url https://api.example.com/exports/{jobId}import requests
url = "https://api.example.com/exports/{jobId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/exports/{jobId}', 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.example.com/exports/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/exports/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/exports/{jobId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exports/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGenerate and download PDF reports of completed KYC validation results. Reports include all scan results, matches, and metadata from the original screening.
This occurs when:
Endpoint
GET /exports/{jobId}
Authentication
Requireskyc:export permission. Include your Bearer token in the Authorization header.
Path Parameters
Description
This endpoint generates a PDF report for a completed KYC check and returns a presigned URL for downloading the report. The PDF includes:- Entity information checked
- Lists scanned
- Match results (if any)
- Confidence scores
- Timestamps
- Processing metadata
Request Example
curl "https://stg.kyc.legaltalent.ai/exports/abc-123-def" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"
Response Format
Success Response
{
"request_id": "abc-123-def",
"bucket": "kyc-exports-develop",
"key": "exports/tenants/tenant123/abc-123-def.pdf",
"presigned_url": "https://kyc-exports-develop.s3.amazonaws.com/exports/tenants/tenant123/abc-123-def.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE&X-Amz-Date=20241122T103000Z&X-Amz-Expires=3600&X-Amz-Signature=abc123def456"
}
Response Fields
| Field | Type | Description |
|---|---|---|
request_id | string | The job ID that was requested |
bucket | string | S3 bucket name where PDF is stored |
key | string | S3 object key (path) |
presigned_url | string | Pre-signed URL valid for 1 hour (default) |
Presigned URL Details
- Validity: 1 hour by default
- Access: Direct download via HTTPS
- Format: PDF document
- Size: Typically 50-500 KB depending on match count
Usage Examples
Download PDF with cURL
# Get presigned URL
RESPONSE=$(curl -X GET "https://stg.kyc.legaltalent.ai/exports/abc-123-def" \
-H "Authorization: Bearer YOUR_TOKEN")
# Extract presigned URL (using jq)
URL=$(echo $RESPONSE | jq -r '.presigned_url')
# Download the PDF
curl -o report.pdf "$URL"
Python Example
import requests
job_id = "abc-123-def"
token = "YOUR_TOKEN"
# Get presigned URL
response = requests.get(
f"https://stg.kyc.legaltalent.ai/exports/{job_id}",
headers={"Authorization": f"Bearer {token}"}
)
if response.status_code == 200:
data = response.json()
presigned_url = data["presigned_url"]
# Download PDF
pdf_response = requests.get(presigned_url)
with open("kyc_report.pdf", "wb") as f:
f.write(pdf_response.content)
print("PDF downloaded successfully")
else:
print(f"Error: {response.json()}")
JavaScript/Fetch Example
const jobId = "abc-123-def";
const token = "YOUR_TOKEN";
async function downloadReport() {
// Get presigned URL
const response = await fetch(
`https://stg.kyc.legaltalent.ai/exports/${jobId}`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Accept": "application/json"
}
}
);
const data = await response.json();
if (response.ok) {
// Download PDF in browser
window.location.href = data.presigned_url;
// Or download programmatically:
// const pdfResponse = await fetch(data.presigned_url);
// const blob = await pdfResponse.blob();
// const url = window.URL.createObjectURL(blob);
// const a = document.createElement('a');
// a.href = url;
// a.download = 'kyc_report.pdf';
// a.click();
} else {
console.error("Error:", data.error);
}
}
Error Responses
400 Bad Request - Missing Job ID
{
"error": "Missing request_id/job_id"
}
400 Bad Request - Missing Tenant ID
{
"error": "Missing tenant_id"
}
404 Not Found
{
"error": "Record not found"
}
- The
jobIdis incorrect - The record has been deleted
- The job never completed successfully
- The job belongs to a different tenant
500 Internal Server Error
{
"error": "Internal error",
"message": "Detailed error description"
}
Status Codes
| Code | Description |
|---|---|
| 200 | Success - PDF generated and presigned URL returned |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Missing or invalid token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Job not found |
| 500 | Internal Server Error |
PDF Report Contents
The generated PDF includes:-
Header Section
- Report generation timestamp
- Job ID
- Entity name checked
-
Summary Section
- Total lists checked
- Match status (Yes/No)
- Overall risk level
-
Entity Information
- Full name
- Document ID (if provided)
- Nationality (if provided)
- Other identifiers
-
Results by List
- List name
- Match status
- Match count
- Confidence scores
- Match details (entity names, programs)
-
Metadata
- Processing time
- Search type used
- Timestamp
Notes
- PDFs are generated on-demand when requested
- Reports are stored in S3 for 90 days (configurable)
- Presigned URLs expire after 1 hour
- Each tenant’s reports are stored in separate S3 prefixes for data isolation
- Large reports (many matches) may take longer to generate
Workflow
- Perform KYC check via
POST /kyc - Save the
job_idfrom the response - Request export via
GET /exports/{jobId} - Download PDF from the presigned URL
- Presigned URL is valid for 1 hour