v6

latestOpenAPI 3.1.0raw.githubusercontent.com2025-06-241833312.7 KB
Image Operations

Scan an image

Creates a task to scan an image file. This is an equivalent operation for detect-documents and warp combined, additionally it can apply effects to the scanned image.

post/v1/image-operations/scan

Request body

inputstring required

The id of the file or task to operate on.

namestring

The name of the file

scan_mode'none' | 'standard' required

Mode for detecting documents in the image. Available modes are:

  • none: No document detection is performed.
  • standard: Using a quick algorithm. Document is detected in the image, and the image is cropped to the detected document area fixing the perspective to match the document's shape.
effect'none' | 'grayscale' | 'scanner' | 'black-background' required

The effect to apply to the image

callback_urlstring uri

The URL to call when the task is completed or failed. If you want to receive events, you probably prefer to use webhooks instead.

Example request

{
  "input": "file_avyrvozb9302uwhq",
  "name": "File Name",
  "scan_mode": "standard",
  "callback_url": "https://example.com/callback"
}

Response

Task created successfully. Returns the task details.

OR
OR
OR

Example response

{
  "id": "task_euyrvozb9302uwhq",
  "operation": "scan",
  "parameters": {
    "input": "file_avyrvozb9302uwhq",
    "name": "File Name",
    "scan_mode": "standard",
    "callback_url": "https://example.com/callback"
  },
  "status": "completed",
  "result": {
    "generated_files": [
      {
        "id": "file_euyrvozb9302uwhq",
        "name": "Example Image",
        "type": "image/png",
        "properties": {
          "size": 1024,
          "width": 800,
          "height": 600
        },
        "task_id": "task_euyrvozb9302uwhq",
        "created_at": "2021-05-01T12:00:00Z"
      }
    ]
  },
  "callback_url": "https://example.com/callback",
  "created_at": "2021-05-01T12:00:00Z",
  "updated_at": "2021-05-01T12:00:00Z"
}