---
title: "Compresses an uploaded image and returns the WebP result."
method: POST
path: "/asset/compress"
tags: ["Asset"]
---

# Compresses an uploaded image and returns the WebP result.

`POST /asset/compress`

Compression metrics are returned in response headers: X-Original-Size, X-Compressed-Size,
 X-Processing-Time-Ms, X-Original-Dimensions, X-Output-Dimensions.

## Query parameters

- `quality` integer
- `maxdim` integer

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthenticated
- `403` — Forbidden

## Changes

- **2026-09-04** `9da534659e5f` — 1 info
  - the security scope `api` was added to the endpoint's security scheme `OpenIdConnect`

[Change history](https://skmtc.dev/rapidata/apis/rapidata-api/changes/asset/compress/post.md)

---

[API](https://skmtc.dev/rapidata/apis/rapidata-api.md) · [All operations](https://skmtc.dev/rapidata/apis/rapidata-api/llms.txt) · [OpenAPI document](https://skmtc.dev/rapidata/apis/rapidata-api/revisions/9da534659e5f?raw)
