---
title: "Compress a PDF and optionally report target-size fit"
method: POST
path: "/api/v1/compress"
tags: ["Portal-Ready Workflows"]
---

# Compress a PDF and optionally report target-size fit

`POST /api/v1/compress`

## Request

- Base URL: `https://exactpdf.com`
- URL: `https://exactpdf.com/api/v1/compress`
- Auth: HTTP bearer

Upload one PDF, rebuild/repack it, and return measured output headers. Optional target_bytes reports whether the best-effort output is at or below 100KB/200KB/500KB/1MB style upload limits. Costs 1 credit on successful output. This is not guaranteed exact-size compression.

## Response `200`

PDF output with ExactPDF workflow measurement headers.

## Other responses

- `400`: Structured ExactPDF API error.
- `401`: Structured ExactPDF API error.
- `402`: Structured ExactPDF API error.
- `413`: Structured ExactPDF API error.

---

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