---
title: "Clean up a camera photo and return enhanced JPEG bytes"
method: POST
path: "/api/invoices/digitalize-image"
tags: ["invoices"]
---

# Clean up a camera photo and return enhanced JPEG bytes

`POST /api/invoices/digitalize-image`

Run the document-digitalization pipeline (perspective correction + CLAHE
+ unsharp mask) on a camera photo and return the result as a JPEG so the
frontend can show it in the preview tile and feed it into the QR reader.

Stateless — no DB writes, no S3 writes. PDFs are rejected (the save-side
flow already handles them). On any CV failure or unsupported input we
return the original bytes so the frontend can stay simple — it always
gets *some* bytes back.

## Headers

- `x-api-token` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/multigest/multigest-protected-api/revisions/4b44eb76b3ee/schema)
