Configuration

Your configuration holds the settings that apply to every transaction you create. Unlike the document scan settings, which you send with each transaction, your configuration is stored for your account and is not part of the transaction request.

It currently contains the image quality checks for your document scan tasks.

Image quality checks

Image quality checks let you reject a document scan when the submitted image is not good enough, for example when it is blurry, has glare, or is not fully visible.

How it works

For every document scan the service evaluates a set of quality checks on the submitted image. Each check returns ok or error.

A document scan is only rejected when at least 1 individual check that returned error is enabled in your configuration.

When a scan is rejected, the document scan task fails with the image_quality_requirements_not_met error and the end user is asked to submit the document again. See document scan errors.

📘

All checks are disabled by default

Available checks

CheckDescription
glareGlare is present on the document image.
focusThe document image is out of focus.
resolutionThe image resolution is below the required threshold.
colorThe image is colorless, for example a black-and-white scan or photocopy.
perspectiveThe document in the image has perspective distortion.
boundsThe document is not fully present in the image.
moireMoiré patterns were detected, indicating a screen capture instead of a physical document.
portraitThe portrait is not present on the document.
handwrittenThe document contains handwritten text in the scanned fields.
brightnessThe document image is not bright enough.
occlusionPart of the document is occluded in the image.

Retrieve the configuration

GET https://api.cm.com/id-scan/v1/config

Request headers

Authorization: Bearer GENERATED_TOKEN_HERE

Response

{
  "documentScan": {
    "imageQualityChecks": {
      "glare": false,
      "focus": false,
      "resolution": false,
      "color": false,
      "perspective": false,
      "bounds": false,
      "moire": false,
      "portrait": false,
      "handwritten": false,
      "brightness": false,
      "occlusion": false
    }
  }
}

Update the configuration

PUT https://api.cm.com/id-scan/v1/config

Request headers

Content-Type: application/json
Authorization: Bearer GENERATED_TOKEN_HERE

Request body

PropertyTypeDescription
documentScanobjectConfiguration that applies to your document scan tasks.
documentScan.imageQualityChecksobjectThe image quality checks to enforce. Every available check can be set as an optional boolean.

All properties are optional and only the checks you send are changed. Checks you leave out keep their current value.

Enable the checks for blurry images and screen captures

{
  "documentScan": {
    "imageQualityChecks": {
      "focus": true,
      "moire": true
    }
  }
}

Response

The full configuration is always returned, including the checks you did not send.

{
  "documentScan": {
    "imageQualityChecks": {
      "glare": false,
      "focus": true,
      "resolution": false,
      "color": false,
      "perspective": false,
      "bounds": false,
      "moire": true,
      "portrait": false,
      "handwritten": false,
      "brightness": false,
      "occlusion": false
    }
  }
}

For a full list of all options see the API reference


Did this page help you?