# Operations

Source: https://smartpdf.ru/en/developers/docs/operations

Each operation is a `POST /v1/pdf/<operation>` request with JSON: the `file_id` of the uploaded file (or `file_ids` for operations on several files: merging, photos and images) and parameters. The response is `202` and a `task_id`; then see [status and download](https://smartpdf.ru/en/developers/docs/tasks).

| Group | Operation | Request | MCP tool | Price unit |
|---|---|---|---|---|
| To PDF | [Word to PDF](https://smartpdf.ru/en/developers/docs/operations/word-to-pdf.md) | `POST /v1/pdf/word-to-pdf` | `word_to_pdf` | 10 MB |
| To PDF | [JPG to PDF](https://smartpdf.ru/en/developers/docs/operations/jpg-to-pdf.md) | `POST /v1/pdf/jpg-to-pdf` | `jpg_to_pdf` | 10 MB of all files |
| To PDF | [Photo to PDF](https://smartpdf.ru/en/developers/docs/operations/photo-to-pdf.md) | `POST /v1/pdf/photo-to-pdf` | `photo_to_pdf` | 10 MB of all files |
| To PDF | [Excel to PDF](https://smartpdf.ru/en/developers/docs/operations/xlsx-to-pdf.md) | `POST /v1/pdf/xlsx-to-pdf` | `xlsx_to_pdf` | 10 MB |
| To PDF | [PowerPoint to PDF](https://smartpdf.ru/en/developers/docs/operations/pptx-to-pdf.md) | `POST /v1/pdf/pptx-to-pdf` | `pptx_to_pdf` | 10 MB |
| To PDF | [DjVu to PDF](https://smartpdf.ru/en/developers/docs/operations/djvu-to-pdf.md) | `POST /v1/pdf/djvu-to-pdf` | `djvu_to_pdf` | 10 MB |
| To PDF | [FB2 to PDF](https://smartpdf.ru/en/developers/docs/operations/fb2-to-pdf.md) | `POST /v1/pdf/fb2-to-pdf` | `fb2_to_pdf` | 10 MB |
| To PDF | [EPUB to PDF](https://smartpdf.ru/en/developers/docs/operations/epub-to-pdf.md) | `POST /v1/pdf/epub-to-pdf` | `epub_to_pdf` | 10 MB |
| To PDF | [HTML to PDF](https://smartpdf.ru/en/developers/docs/operations/html-to-pdf.md) | `POST /v1/pdf/html-to-pdf` | `html_to_pdf` | 10 MB |
| From PDF | [PDF to Word](https://smartpdf.ru/en/developers/docs/operations/pdf-to-word.md) | `POST /v1/pdf/to-word` | `pdf_to_word` | 10 MB or 50 pages |
| From PDF | [PDF to JPG](https://smartpdf.ru/en/developers/docs/operations/pdf-to-jpg.md) | `POST /v1/pdf/to-jpg` | `pdf_to_jpg` | 10 MB or 50 pages (300 dpi: 25) |
| From PDF | [PDF to PNG](https://smartpdf.ru/en/developers/docs/operations/pdf-to-png.md) | `POST /v1/pdf/to-png` | `pdf_to_png` | 10 MB |
| From PDF | [PDF to Excel](https://smartpdf.ru/en/developers/docs/operations/pdf-to-excel.md) | `POST /v1/pdf/to-excel` | `pdf_to_excel` | 10 MB or 50 pages |
| From PDF | [PDF to PowerPoint](https://smartpdf.ru/en/developers/docs/operations/pdf-to-pptx.md) | `POST /v1/pdf/to-pptx` | `pdf_to_pptx` | 10 MB or 50 pages |
| From PDF | [PDF to Markdown](https://smartpdf.ru/en/developers/docs/operations/pdf-to-markdown.md) | `POST /v1/pdf/to-markdown` | `pdf_to_markdown` | 10 MB or 50 pages |
| From PDF | [PDF to text](https://smartpdf.ru/en/developers/docs/operations/pdf-to-txt.md) | `POST /v1/pdf/to-txt` | `pdf_to_txt` | 10 MB |
| Images | [Compress image](https://smartpdf.ru/en/developers/docs/operations/compress-image.md) | `POST /v1/pdf/compress-image` | `compress_image` | 10 MB of all files |
| Images | [HEIC to JPG](https://smartpdf.ru/en/developers/docs/operations/heic-to-jpg.md) | `POST /v1/pdf/heic-to-jpg` | `heic_to_jpg` | 10 MB of all files |
| Images | [Image to text](https://smartpdf.ru/en/developers/docs/operations/image-to-text.md) | `POST /v1/pdf/image-to-text` | `image_to_text` | 10 MB of all files or 10 photos |
| Images | [PNG to JPG](https://smartpdf.ru/en/developers/docs/operations/png-to-jpg.md) | `POST /v1/pdf/png-to-jpg` | `png_to_jpg` | 10 MB of all files |
| Images | [JPG to PNG](https://smartpdf.ru/en/developers/docs/operations/jpg-to-png.md) | `POST /v1/pdf/jpg-to-png` | `jpg_to_png` | 10 MB of all files |
| Images | [WEBP to JPG](https://smartpdf.ru/en/developers/docs/operations/webp-to-jpg.md) | `POST /v1/pdf/webp-to-jpg` | `webp_to_jpg` | 10 MB of all files |
| Images | [Resize image](https://smartpdf.ru/en/developers/docs/operations/resize-image.md) | `POST /v1/pdf/resize-image` | `resize_image` | 10 MB of all files |
| Images | [Crop image](https://smartpdf.ru/en/developers/docs/operations/crop-image.md) | `POST /v1/pdf/crop-image` | `crop_image` | 10 MB |
| Images | [Rotate image](https://smartpdf.ru/en/developers/docs/operations/rotate-image.md) | `POST /v1/pdf/rotate-image` | `rotate_image` | 10 MB of all files |
| Images | [Word to JPG](https://smartpdf.ru/en/developers/docs/operations/word-to-jpg.md) | `POST /v1/pdf/word-to-jpg` | `word_to_jpg` | 10 MB |
| Manage | [PDF editor](https://smartpdf.ru/en/developers/docs/operations/edit.md) | `POST /v1/pdf/edit` | `edit_pdf` | 10 MB |
| Manage | [Compress PDF](https://smartpdf.ru/en/developers/docs/operations/compress.md) | `POST /v1/pdf/compress` | `compress_pdf` | 10 MB |
| Manage | [Grayscale PDF](https://smartpdf.ru/en/developers/docs/operations/grayscale.md) | `POST /v1/pdf/grayscale` | `grayscale_pdf` | 10 MB |
| Manage | [PDF to PDF/A](https://smartpdf.ru/en/developers/docs/operations/to-pdfa.md) | `POST /v1/pdf/to-pdfa` | `pdf_to_pdfa` | 10 MB |
| Manage | [Repair PDF](https://smartpdf.ru/en/developers/docs/operations/repair.md) | `POST /v1/pdf/repair` | `repair_pdf` | 10 MB |
| Manage | [Merge PDF](https://smartpdf.ru/en/developers/docs/operations/merge.md) | `POST /v1/pdf/merge` | `merge_pdfs` | 10 MB of all files |
| Manage | [Split PDF](https://smartpdf.ru/en/developers/docs/operations/split.md) | `POST /v1/pdf/split` | `split_pdf` | 10 MB |
| Manage | [OCR PDF](https://smartpdf.ru/en/developers/docs/operations/ocr.md) | `POST /v1/pdf/ocr` | `ocr_pdf` | 10 MB or 10 pages |
| Manage | [Flatten PDF](https://smartpdf.ru/en/developers/docs/operations/flatten.md) | `POST /v1/pdf/flatten` | `flatten_pdf` | 10 MB |
| Pages | [Delete pages](https://smartpdf.ru/en/developers/docs/operations/delete-pages.md) | `POST /v1/pdf/delete-pages` | `delete_pages` | 10 MB |
| Pages | [Crop PDF](https://smartpdf.ru/en/developers/docs/operations/crop.md) | `POST /v1/pdf/crop` | `crop_pdf` | 10 MB |
| Pages | [Extract pages](https://smartpdf.ru/en/developers/docs/operations/extract-pages.md) | `POST /v1/pdf/extract-pages` | `extract_pages` | 10 MB |
| Pages | [Rotate pages](https://smartpdf.ru/en/developers/docs/operations/rotate.md) | `POST /v1/pdf/rotate` | `rotate_pdf` | 10 MB |
| Pages | [Reorder pages](https://smartpdf.ru/en/developers/docs/operations/reorder-pages.md) | `POST /v1/pdf/reorder-pages` | `reorder_pages` | 10 MB |
| Pages | [Add page numbers](https://smartpdf.ru/en/developers/docs/operations/add-page-numbers.md) | `POST /v1/pdf/add-page-numbers` | `add_page_numbers` | 10 MB |
| Sign & protect | [Sign PDF](https://smartpdf.ru/en/developers/docs/operations/sign.md) | `POST /v1/pdf/sign` | `sign_pdf` | 10 MB |
| Sign & protect | [Protect PDF](https://smartpdf.ru/en/developers/docs/operations/protect.md) | `POST /v1/pdf/protect` | `protect_pdf` | 10 MB |
| Sign & protect | [Unlock PDF](https://smartpdf.ru/en/developers/docs/operations/unlock.md) | `POST /v1/pdf/unlock` | `unlock_pdf` | 10 MB |
| Sign & protect | [Redact personal data](https://smartpdf.ru/en/developers/docs/operations/redact.md) | `POST /v1/pdf/redact` | `redact_pdf` | 10 MB |
| Sign & protect | [Find personal data](https://smartpdf.ru/en/developers/docs/operations/find-personal-data.md) | `POST /v1/pdf/find-personal-data` | `find_personal_data` | 10 MB |
| Sign & protect | [Add watermark](https://smartpdf.ru/en/developers/docs/operations/watermark.md) | `POST /v1/pdf/watermark` | `watermark_pdf` | 10 MB |

## Common parameter

All operations accept an optional `webhook_url` — an https address: when the operation finishes, SmartPDF sends a `POST` request with the result and a signature to it. Details: [Webhooks](https://smartpdf.ru/en/developers/docs/webhooks).

## Operation chains

The PDF result of one operation can be passed straight to the next one — without downloading and re-uploading it:

```bash
curl -X POST https://api.smartpdf.ru/v1/upload/from-task/$TASK_ID -H "X-API-Key: $SMARTPDF_API_KEY"
```

The response is the same as for an [upload](https://smartpdf.ru/en/developers/docs/upload): a new `file_id` that’s valid for an hour. This way you can, for example, recognize the text in a scan and then compress the result. It works only for PDF results (otherwise `422`); before the operation finishes, you get `409`, and after the result is deleted, `410`. On the Free plan, this doesn’t use up the one-time download link. Each operation in a chain is paid for separately.
