LM-Kit OneDocs2026.9.7lm-kit.comEULA
Image Utilities

Image Redaction

Permanently removes content from an image (redaction).#

POST/lmkit/v1/image-redact

Paints opaque boxes over the regions to remove, re-encodes the pixels so the covered content cannot be recovered from the file, and strips the metadata (EXIF, XMP, embedded thumbnails) that could carry it. Specify what to remove with 'search_terms' (every occurrence located on the page by OCR is painted over; needs the server's OCR engine, otherwise 503 with error 'ocr_unavailable') and/or 'areas' (explicit pixel regions, per page of a multi-page TIFF). The redacted image is returned base64-encoded in the source encoding by default, so a multi-page TIFF stays one file; set 'output_format' to transcode a single-page result. The report counts the matches and areas painted. Explicit areas involve no AI model; search terms read the pixels through OCR. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.

Request body

application/json ·

PropertyTypeDescription
inputrequiredstring

The input image. When input_format is 'Base64EncodedFile', provide a base64-encoded image payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.

input_format

How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.

search_termsstring[]

Strings to locate on the page by OCR; every occurrence is painted over. Requires an OCR engine on the server (503 with error 'ocr_unavailable' otherwise). May be empty when 'areas' is given.

areas[]

Explicit regions to paint over, in image pixels with the origin at the top-left of their page. Use them for a signature, a face, or any region regardless of its content. May be empty when 'search_terms' is given.

case_sensitiveboolean

Whether 'search_terms' match case. Default: false.

whole_wordboolean

Whether 'search_terms' match only at word boundaries. Default: false.

fill_colorstring

Color of the painted boxes as '#RRGGBB'. Default: '#000000'.

strip_metadataboolean

Drops EXIF, XMP and every other metadata block from the output, so nothing about the original (camera, location, thumbnails) survives beside the redacted pixels. Default: true.

output_formatone of object ·
output_qualityobject (int32)

Quality (1-100) for the lossy encodings when 'output_format' is 'webp' or 'jpeg'. Default: 80.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

503

Service Unavailable

500application/json

Internal Server Error

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/image-redact" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "",
  "input_format": "Base64EncodedFile",
  "search_terms": [
    "string"
  ],
  "areas": [
    {
      "page_index": 0,
      "x": "string",
      "y": "string",
      "width": "string",
      "height": "string"
    }
  ],
  "case_sensitive": false
}'