> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iyzpdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Workflow Guide

> Understand the multipart request patterns for merge, remove pages, and compress operations.

The PDF editing endpoints all use `multipart/form-data` and return a PDF.

## Supported Endpoints

| Endpoint                 | Credits | Input shape                        |
| ------------------------ | ------- | ---------------------------------- |
| `POST /pdf/merge`        | 1       | multiple `files`, optional `order` |
| `POST /pdf/pages/remove` | 1       | `file`, `pages`                    |
| `POST /pdf/compress`     | 2       | `file`, optional `quality`         |

## Merge

Send between **2 and 20 PDF files**. If you need a custom output order, pass an `order` field containing a JSON array of zero-based file indexes.

```bash theme={null}
curl --request POST \
  --url https://api.iyzpdf.com/v1/pdf/merge \
  --header "X-API-Key: $IYZPDF_API_KEY" \
  --form "files=@cover.pdf" \
  --form "files=@appendix.pdf" \
  --form 'order=[0,1]' \
  --output merged.pdf
```

## Remove Pages

Send a single PDF and a JSON array of **1-indexed** page numbers.

```bash theme={null}
curl --request POST \
  --url https://api.iyzpdf.com/v1/pdf/pages/remove \
  --header "X-API-Key: $IYZPDF_API_KEY" \
  --form "file=@contract.pdf" \
  --form 'pages=[2,4]' \
  --output contract-trimmed.pdf
```

## Compress

Compression accepts one PDF plus an optional quality level:

* `low`
* `medium`
* `high`

```bash theme={null}
curl --request POST \
  --url https://api.iyzpdf.com/v1/pdf/compress \
  --header "X-API-Key: $IYZPDF_API_KEY" \
  --form "file=@catalog.pdf" \
  --form "quality=medium" \
  --output catalog-compressed.pdf
```

## Limits

* Merge accepts **2 to 20** PDFs
* Authenticated PDF editing uploads are limited to **100 MB**
* Remove pages and compress accept a single valid PDF
* Merge uses total upload size, not per-file size
