← Back to blog

Extract Driver's License Data with n8n: Dropbox to Notion

Watch Dropbox license scans, call Cryvis POST /v1/documents/driver-license with required ISO alpha-3 country, and sync fields into Notion.

Driver's license OCR is country-specific. Cryvis requires a multipart country field (ISO 3166-1 alpha-3) alongside file so the correct schema runs — India vs USA vs UK are not the same JSON shape. This n8n tutorial watches a Dropbox folder, sends each scan with an explicit country code, and upserts a Notion database row.

PAN twin: Extract PAN card data. Multi-ID intake: Automate KYC. Hub: /blog/n8n.

Architecture

Dropbox /licenses/{COUNTRY}/scan.jpg
        |
        v
n8n: Watch files
  derive country from folder name (IND, USA, ...)
        |
        v
POST https://api.cryvis.com/v1/documents/driver-license
  -F file=@scan.jpg   ($binary.data)
  -F country=USA
  -H "Authorization: Bearer ..."
        |
        v
Notion database: Licenses

Supported countries

Pass exactly one of:

CodeCountry
INDIndia
USAUnited States
VNMVietnam
GBRUnited Kingdom
THAThailand
IDNIndonesia

Anything else is rejected. Do not send US or IN — alpha-3 only.

Step 1: Dropbox layout

/licenses
  /USA
  /IND
  /GBR
  /VNM
  /THA
  /IDN
  /_failed
  /_done

Folder name = country parameter. This avoids a fragile manual mapping table inside n8n.

Step 2: Watch, download, and Set country

Dropbox Trigger on /licenses (or one trigger per country folder).

Dropbox → Download so bytes land in $binary.data.

Set node — compute country from path:

country = {{ $json.path.split('/')[2].toUpperCase() }}
# e.g. /licenses/USA/jane.jpg -> USA

Adjust the path index to match how Dropbox returns path_display / path_lower in your node version. Prefer a dedicated Set field rather than inline string surgery in every expression.

IF node: country is one of IND, USA, VNM, GBR, THA, IDN. Else move to /_failed.

Step 3: Cryvis Driver License API

HTTP Request

SettingValue
MethodPOST
URLhttps://api.cryvis.com/v1/documents/driver-license
AuthenticationHeader Auth → Bearer
Body Content TypeMultipart Form-Data
Response FormatJSON
PartTypeRequiredValue
fileBinaryyesInput Binary Field = data
countryForm Data (text)yes{{ $json.country }}

cURL (USA example):

curl -X POST https://api.cryvis.com/v1/documents/driver-license \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "country=USA" \
  -F "file=@drivers-license.jpg"

Docs: /docs/api/extractDriverLicense · /apis/driver-license.

Step 4: USA response example

Shared identity/license fields plus US-specific extras:

{
  "success": true,
  "data": {
    "full_name": "JANE DOE",
    "date_of_birth": "1990-05-20",
    "address": "123 Main St, Austin, TX 78701",
    "license_number": "D1234567",
    "issue_date": "2022-01-15",
    "expiry_date": "2030-05-20",
    "state": "TX",
    "license_class": "C",
    "restrictions": null,
    "endorsements": null,
    "sex": "F",
    "height": "5-06",
    "eye_color": "BRN"
  }
}

Always map common fields via {{ $json.data.full_name }}, date_of_birth, address, license_number, issue_date, expiry_date. Country extras when present:

CountryExtra fields (examples)
USAstate, license_class, restrictions, endorsements, height, eye_color, sex
INDvehicle_classes, blood_group, issuing_rto, father_name_or_guardian
GBRcategories, issuing_authority, sex, place_of_birth
VNMlicense_class, place_of_issue
THAlicense_type, national_id_number, blood_group, issuing_authority
IDNlicense_type, blood_group, height, place_of_birth, issuing_authority

Step 5: Notion + Switch

Notion properties: Name (title ← full_name), Country (select), License number, DOB, Address, Issue, Expiry, State/Region, Class, Restrictions, Endorsements, Sex, Height, Eye color, Dropbox path, Status.

Switch on country after HTTP so each output maps country-specific extras. Preserve country / dropbox_path in a Set before HTTP; after HTTP use {{ $('Set').item.json.country }}.

One Notion database with filtered views per country is enough — leave unused columns empty.

Step 6: Expiry, hygiene, errors

IF on expiry_date: expired / expiring_soon (< 90 days) / valid. Success → Move to /licenses/_done/{country}/. Error → /_failed/ + Notion Status error via Error Trigger. Omitting country → 400.

Multipart checklist

NameTypeValue
countryForm Data{{ $json.country }}
filen8n Binary FileBinary Property = data

Both required. country=US is rejected — use USA. Without country subfolders, parse a filename suffix (jane_doe_USA.jpg) in Set, then IF-validate against the six codes.

Credits: 1 per PDF page or image.

CTA

Parse driver's licenses with country-aware schemas: /apis/driver-license. Docs: /docs/api/extractDriverLicense. From n8n, POST $binary.data as file plus text country (IND/USA/VNM/GBR/THA/IDN) to https://api.cryvis.com/v1/documents/driver-license with Bearer auth, then sync {{ $json.data.* }} into Notion.