Skip to main content
Export Results
curl --request GET \
  --url https://api.example.com/exports/{jobId}

Documentation Index

Fetch the complete documentation index at: https://docs.compliance.legaltalent.ai/llms.txt

Use this file to discover all available pages before exploring further.

Generate and download PDF reports of completed KYC validation results. Reports include all scan results, matches, and metadata from the original screening.

Endpoint

GET /exports/{jobId}

Authentication

Requires kyc: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

FieldTypeDescription
request_idstringThe job ID that was requested
bucketstringS3 bucket name where PDF is stored
keystringS3 object key (path)
presigned_urlstringPre-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"
}
This occurs when:
  • The jobId is 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

CodeDescription
200Success - PDF generated and presigned URL returned
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid token
403Forbidden - Insufficient permissions
404Not Found - Job not found
500Internal Server Error

PDF Report Contents

The generated PDF includes:
  1. Header Section
    • Report generation timestamp
    • Job ID
    • Entity name checked
  2. Summary Section
    • Total lists checked
    • Match status (Yes/No)
    • Overall risk level
  3. Entity Information
    • Full name
    • Document ID (if provided)
    • Nationality (if provided)
    • Other identifiers
  4. Results by List
    • List name
    • Match status
    • Match count
    • Confidence scores
    • Match details (entity names, programs)
  5. 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

  1. Perform KYC check via POST /kyc
  2. Save the job_id from the response
  3. Request export via GET /exports/{jobId}
  4. Download PDF from the presigned URL
  5. Presigned URL is valid for 1 hour