POST /v1/convert

Image Convert API

Convert images between PNG, JPG, WebP, AVIF, HEIC, TIFF, SVG, PDF, and more.

Key Operations

PNG to JPG

JPG to WebP

HEIC to JPG

SVG to PNG

PDF to JPG

Use cases

  • Website image optimization

  • Archive format normalization

  • Document to image rendering

Async Job Lifecycle

All ImageHQ processing endpoints are asynchronous. Upon a successful POST, you receive a 202 Acceptedresponse with a job_id. Poll the status endpoint until the state reaches succeeded.

Request Example

import requests

url = "https://api.imagehq.io/v1/convert"
payload = {
  "client_reference_id": "example-123",
  "input_format": "png",
  "output": {
    "background": "#ffffff",
    "output_format": "jpg",
    "quality": 90,
    "strip_metadata": True
  },
  "output_format": "jpg",
  "tool_slug": "png-to-jpg"
}
files = [("files[]", open("image.png", "rb"))]
data = {"request": json.dumps(payload)}

response = requests.post(url, files=files, data=data)
print(response.json())

Successful Response

{
  "completed": {
    "download_url": "/v1/jobs/job_123/download",
    "expires_at": "2026-05-03T00:00:00Z",
    "id": "job_123",
    "inputs": [
      {
        "filename": "input.png",
        "format": "png",
        "mime_type": "image/png",
        "size_bytes": 420122
      }
    ],
    "outputs": [
      {
        "filename": "output.jpg",
        "format": "jpg",
        "id": "0",
        "mime_type": "image/jpeg",
        "size_bytes": 161002
      }
    ],
    "progress": 100,
    "retention_policy": {
      "clamp": true,
      "ttl_hours": 24
    },
    "stages": [
      {
        "name": "queued",
        "progress": 100,
        "status": "succeeded"
      },
      {
        "name": "processing",
        "progress": 100,
        "status": "succeeded"
      }
    ],
    "status": "succeeded",
    "warnings": []
  },
  "queued": {
    "client_reference_id": "example-123",
    "created_at": "2026-05-02T00:00:00Z",
    "current_stage": "queued",
    "expires_at": "2026-05-03T00:00:00Z",
    "id": "job_123",
    "operation": "convert",
    "poll_url": "/v1/jobs/job_123",
    "progress": 0,
    "status": "queued",
    "tool_slug": "png-to-jpg"
  }
}

Frequently Asked Questions

What image formats can I convert?

You can convert between common raster formats and selected document/image bridge formats like PDF where supported.

Does the API run asynchronously?

Yes. Jobs are queued and processed asynchronously with polling and downloadable outputs.

Can I send S3 keys instead of uploads?

Yes. Requests can include S3 input references where configured.

How do I download converted files?

Poll the job status endpoint and call the returned download URL after success.


Related APIs

optimize APItransform APIpipeline APIbatch API

ImageHQ

Smart image tools for conversion, compression, and automation.

Tools

Compress ImageResize ImagePNG to JPGFiltersEnhance

© 2026 ImageHQ. All rights reserved.