Deskew API reference

Technical reference for the POST /v1/deskew endpoint. Use this to preprocess any image with text.

Endpoint
Rotate/tilt any image until the text is horizontal (x-axis). Images-only (JPEG, PNG, WEBP, HEIC/HEIF) are supported; PDFs and other formats are rejected.

Method: POST

Path: /v1/deskew

Auth: Bearer token in Authorization: Bearer <API_KEY>

Tip: For best results, capture the paper on a contrasting background (light paper on a dark surface, or dark paper on a light surface).

Request body
Provide either an image URL or base64-encoded image. Only JPEG, PNG, WEBP, and HEIC/HEIF sources are accepted (the formats apply to both fileUrl and fileBase64).

Fields

  • fileUrl (string, optional) - Public or signed URL to the source image (JPEG, PNG, WEBP, or HEIC/HEIF).
  • fileBase64 (string, optional) - Base64 image content. Used if fileUrl is not provided.
  • Every response includes a requestId for tracing requests through logs.

Limits

The deskewed image is always returned as a PNG, kept under 20 MB. If needed, we'll downscale to stay within that limit.

HEIC/HEIF uploads are converted to PNG before deskewing.

Big photos are resized to a maximum dimension of 3000 px before rotation to keep performance snappy.

Images with multiple pages or frames (like multi-page TIFFs or animated images) aren't supported.

{
  "fileUrl": "https://example.com/receipt.jpg"
}

// Or with base64:
{
  "fileBase64": "iVBORw0KGgoAAAANS..."
}
Response
Successful 200 OK response body.
{
  "requestId": "7b4b44b0-34c2-4e65-8b65-6fe7c7d8e1a2",
  "imageBase64": "<base64-encoded-image>",
  "contentType": "image/png",
  "width": 1024,
  "height": 2048,
  "deskewAngle": -2.3,
  "passes": [],
  "notes": [
    "output:forced-format=png:requested=image/png",
    "compress:final:1.23mb"
  ]
}