Skip to main content
POST
/
v1
/
scan
/
business-card
Scan Business Card
curl --request POST \
  --url https://api.example.com/v1/scan/business-card \
  --header 'Content-Type: application/json' \
  --data '
{
  "image_base64": "<string>",
  "image_url": "<string>",
  "language": "<string>",
  "create_contact": true
}
'
{
  "data": {
    "fields": {
      "full_name": "<string>",
      "first_name": "<string>",
      "last_name": "<string>",
      "job_title": "<string>",
      "company_name": "<string>",
      "email": "<string>",
      "phone": "<string>",
      "mobile": "<string>",
      "website": "<string>",
      "address": "<string>"
    },
    "contact_id": "<string>",
    "confidence": 123,
    "raw_text": "<string>",
    "credits_remaining": 123
  }
}
This endpoint consumes 1 enrichment credit per successful scan. Requests that fail to detect any card fields return 409 no_match and do not consume credits. If the workspace balance is zero, the API returns 402 insufficient_credits.

Request

Upload either a base64-encoded image or a URL. The endpoint runs OCR, parses the result with an LLM, and returns structured contact fields. It does not create a contact automatically - call POST /v1/contacts with the returned data to persist it.

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Idempotency-Key
string
Optional UUID. Same image and key returns the cached result within 24 hours without consuming additional credits.

Body Parameters

image_base64
string
Base64-encoded image bytes. Supported formats: PNG, JPG, WEBP, HEIC. Maximum 10 MB. Either image_base64 or image_url is required.
image_url
string
Public HTTPS URL to fetch the image from. The URL must be reachable within 5 seconds.
language
string
default:"auto"
ISO 639-1 language hint for OCR (e.g. en, de, fr). Defaults to automatic detection.
create_contact
boolean
default:"false"
When true, the extracted data is used to create a new contact and the resulting contact_id is returned alongside the raw fields.

Response

data
object
Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl -X POST \
  https://data.leadlex.com/functions/v1/api-gateway/v1/scan/business-card \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://example.com/cards/jane.jpg"}'

Example Response

{
  "data": {
    "fields": {
      "full_name": "Jane Doe",
      "first_name": "Jane",
      "last_name": "Doe",
      "job_title": "General Counsel",
      "company_name": "Acme Corp",
      "email": "jane@acme.com",
      "phone": "+1-555-0100",
      "mobile": null,
      "website": "https://acme.com",
      "address": "500 5th Ave, New York, NY 10110"
    },
    "contact_id": null,
    "confidence": 0.88,
    "raw_text": "Jane Doe\nGeneral Counsel\nAcme Corp\njane@acme.com\n+1-555-0100",
    "credits_remaining": 4868
  }
}

Errors

StatusCodeDescription
400validation_errorNeither image_base64 nor image_url provided, or image exceeds size cap
401invalid_keyInvalid or expired API key
402insufficient_creditsWorkspace credit balance is exhausted
403insufficient_permissionsMissing write:enrich permission
409no_matchOCR detected no card-like fields
413payload_too_largeImage exceeds 10 MB
429rate_limitedRate limit exceeded