Skip to main content
This tool requires a publicly accessible PDF URL. If your file is stored locally or in memory, you can upload it to our temporary bucket first using the Get Signed Upload URL endpoint.
POST https://api.pdfnoodle.com/v1/tools/compress-pdf

Request

curl --location 'https://api.pdfnoodle.com/v1/tools/compress-pdf' \
--header 'Authorization: Bearer pdfnoodle_api_123456789' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/large-document.pdf",
    "compressLevel": "medium",
    "finalFilename": "compressed-document.pdf",
    "expiration": 3600
}'

Response

{
  "status": "SUCCESS",
  "url": "https://s3.amazonaws.com/...",
  "fileName": "compressed-document.pdf",
  "urlValidUntil": "2025-01-01T02:00:00.000Z",
  "metadata": {
    "originalSize": "2.5 MB",
    "compressedSize": "1.2 MB",
    "reduction": "52%"
  }
}
The response includes a metadata object with compression details so you can see exactly how much the file size was reduced.

Compression Levels

LevelQualityBest for
lowHighest quality, least compressionPrint-ready documents
mediumBalanced quality and sizeGeneral use, email attachments
highMost compression, lower qualityWeb viewing, maximum size reduction
The medium compression level is the default and works well for most use cases. Use low when you need to preserve maximum quality (e.g., print materials) and high when file size is the priority.

Parameters

url
string
required
A valid, publicly accessible URL pointing to the PDF file you want to compress.
compressLevel
string
default:"medium"
The compression intensity. Must be one of: "low", "medium", or "high". Default: "medium".
finalFilename
string
The desired filename for the compressed PDF. Must end with .pdf. If not provided, the original filename from the URL will be used, or a random name will be generated.
expiration
number
default:"3600"
Number of seconds that the generated signed URL will take to expire. Must be between 60 (1 minute) and 604800 (7 days). Default: 3600 (1 hour).