Image Operations

Convert image format

Creates a task to convert an image file to a different format.

POST
/v1/image-operations/convert

Authorization

x-api-key
<token>

API Key for authentication

In: header

Request Body

application/jsonOptional
body
PNG Options | JPEG Options | WEBP Options

Response Body

The response of an convert task

TypeScript Definitions

Use the response body type in TypeScript.

responserequired
Convert Response

The response of an convert task

curl -X POST "https://api.scan-documents.com/v1/image-operations/convert" \
  -H "x-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "file_avyrvozb9302uwhq",
    "name": "Example Image",
    "target_format": "image/png"
  }'
{
  "id": "task_euyrvozb9302uwhq",
  "operation": "convert",
  "parameters": {
    "input": "file_avyrvozb9302uwhq",
    "name": "Example Image",
    "target_format": "image/png"
  },
  "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"
      }
    ]
  },
  "created_at": "2021-05-01T12:00:00Z",
  "updated_at": "2021-05-01T12:00:00Z"
}