Skip to main content

MegaTools API

Automate conversions from your own servers with an asynchronous REST API.

Authentication

Every request needs an X-API-Key header. Create a key from your dashboard — the plaintext is shown once, at creation, and cannot be recovered afterwards.

Request header

X-API-Key: mt_live_a1b2c3d4e5f6...

How it works

Every operation is asynchronous. You upload a file, the server returns a job id immediately, and you poll for status until it completes. A slow conversion therefore never holds an HTTP connection open.

1. Submit a job

curl -X POST https://your-domain/api/v1/pdf/compress \
  -H "X-API-Key: mt_live_..." \
  -F "[email protected]" \
  -F "level=high"

Response — 202 Accepted

{
  "jobId": "8f2a1c4e-...",
  "status": "processing",
  "statusUrl": "https://your-domain/api/v1/jobs/8f2a1c4e-..."
}

2. Poll until complete

curl https://your-domain/api/v1/jobs/8f2a1c4e-... \
  -H "X-API-Key: mt_live_..."

Response — completed

{
  "jobId": "8f2a1c4e-...",
  "status": "completed",
  "progress": 100,
  "durationMs": 1840,
  "outputs": [
    {
      "fileName": "report-compressed.pdf",
      "sizeBytes": 481203,
      "contentType": "application/pdf",
      "downloadUrl": "https://your-domain/api/download/eyJ...",
      "expiresAt": "2026-08-17T12:30:00Z"
    }
  ]
}
Download links are signed and expire. Fetch your result before the expiresAt timestamp.

Endpoints

POST/api/v1/pdf/to-wordConvert a PDF into an editable Word document.
POST/api/v1/pdf/to-excelExtract tabular data from a PDF into XLSX.
POST/api/v1/pdf/compressReduce PDF file size. Form field: level.
POST/api/v1/pdf/mergeCombine several PDFs. Send two or more files.
POST/api/v1/pdf/splitSplit a PDF. Form field: pages.
POST/api/v1/image/to-pdfBuild a PDF from one or more images.
POST/api/v1/pdf/to-imageRender PDF pages as images. Form field: dpi.
POST/api/v1/ocrRecognise text in a scanned PDF. Form field: language.
GET/api/v1/jobs/{jobId}Poll job status and collect download links.
GET/api/v1/accountRead the quota and rate limit for your key.

Errors

Every error returns the same shape, with a stable code your integration can branch on.

{
  "code": "FILE_TOO_LARGE",
  "message": "The file is too large.",
  "correlationId": "0HN7...",
  "details": { "actualBytes": 251658240, "limitBytes": 209715200 }
}

Common codes: FILE_TOO_LARGE, UNSUPPORTED_FORMAT, PDF_ENCRYPTED, QUOTA_EXCEEDED, RATE_LIMITED, PROCESSING_FAILED.

Rate limits

A key allows 60 requests per minute by default. Exceeding it returns 429 with code RATE_LIMITED. Query /api/v1/account for your remaining quota.

Create an API key in your dashboard