BrandKwikID Documentation
API SuiteDocument Processing (ML)

Document Rect

Detect document corners and rectify a perspective warp. Server-side multipart POST with Bearer auth.

API reference

Try itLoading playground…
Loading…
AuthorizationBearer <token>

JWT Bearer token authentication. Obtain a token from the KwikID dashboard.

In: header

imagestring
response_type?string
Value in"file" | "base64"
unique_id?string | null

Response Body

curl -X POST "https://__mock__/crop/document" \  -F image="string"
{
  "class": "string",
  "confidence": 0,
  "image": "string",
  "name": "string",
  "xmax": 0,
  "xmin": 0,
  "ymax": 0,
  "ymin": 0
}
{
  "detail": {
    "<location>": {
      "<field_name>": [
        "string"
      ]
    }
  },
  "message": "string"
}
{
  "detail": {},
  "message": "string"
}

Overview

Call POST /crop/document with Authorization: Bearer <token> and file (document photo). Use the rectified output before Card detection or OCR to improve accuracy on angled captures.

Key features

  • Geometry normalization for mobile scans.
  • Shared multipart pattern across ML APIs.

Implementation

Step 1: Call from your backend

Post full-page photo as file.

Error handling

HTTP statusWhen
400Could not find document bounds.
401Invalid token.

Benefits

  • Fewer OCR failures on skewed images.

Next steps