Sharp-powered processing
JPEG · PNG · WebP · HEIC · AVIF
6MB Limit
Health + Metrics

Image Processing API

A production-ready image processing REST API to resize, compress, convert, crop, and run multi-step pipelines. Designed for reliability with consistent outputs, health checks, metrics, and predictable error handling.

Loading image processing playground
/health
/metrics

Endpoints @ A Glance

Start with /process for multi-step workflows, or call single-operation endpoints directly.
GET/
Service Info
Returns supported operations + formats (great for quick integration checks).
POST/process
Recommended
Pipeline (multi-step)
Run multiple operations in one request (resize → convert → metadata, etc.).
POST/resize
Resize
High-quality resize with optional dimensions.
POST/compress
Compress
Quality-controlled compression (default 80).
POST/convert
Convert
Convert between jpeg/png/webp with optimized settings.
POST/crop
Crop
Crop by x/y and size with bounds validation.
POST/upload
Upload (test)
Upload + return original image (validation).
GET/health
Health Check
Service status, uptime, env, temp dir.
GET/metrics
Prometheus Metrics
Request counts, histograms, error rate.

Pipeline + Production

Chain multiple image operations into a single request, then deploy with confidence using production-ready endpoints, metrics, and health checks.
Pipeline: resize → convert → metadata

One request, multiple operations. Ideal for “ingest then optimize” flows.

{
  "image_url": "https://example.com/image.jpg",
  "operations": [
    { "operation": "resize", "width": 512, "height": 512 },
    { "operation": "convert", "format": "webp" },
    { "operation": "metadata" }
  ],
  "output": { "type": "json" }
}
Output can be binary image or JSON depending on your pipeline.
Production-ready by default

Monitoring routes + consistent error shapes make it easy to operate.

Health

https://datpaq.com/api/v1/image-processing/health

Status, version, uptime, environment, temp directory.

Metrics

https://datpaq.com/api/v1/image-processing/metrics

Prometheus request counts, histograms, and error rate.

Supported formats

Input: JPEG
Input: PNG
Input: WebP
Input: GIF
Input: BMP
Input: TIFF
Output: JPEG
Output: PNG
Output: WebP

Legacy routes

Backwards compatible endpoints exist without the /api/v1 prefix (e.g. /resize /api/v1/resize).

Error Handling

When something goes wrong, responses are explicit and structured—making failures easy to understand, trace, and recover from.
Example error response
{
  "error": "Unsupported image format",
  "correlationId": "req-123456789"
}

Predictable error handling

Common failure cases return clear HTTP codes + a correlation ID for debugging.

400 Bad Request
404 Not Found
413 Payload Too Large
422 Unprocessable Entity
500 Internal Server Error
Working example

See the Image Processing sample app

An open-source single-page app that calls this API from JavaScript, with auth and rendering wired up.

FAQ

API questions developers ask first.

How do I authenticate with this API?

Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.

Is there a free tier?

Yes. Datpaq APIs include a free tier for building, testing, and small production workloads before you move to a paid plan.

What format do requests and responses use?

Datpaq APIs use REST over HTTPS and return JSON by default. Endpoint docs show the supported methods, query parameters, request bodies, and response fields.

Where can I see limits and errors?

Each API documents rate limits, validation rules, and error responses in the landing page and API docs so integrations can retry and fail cleanly.

Ship image workflows faster

Replace ad-hoc scripts with a stable API: resize for thumbnails, convert to WebP, compress for performance, and monitor it all in production.