Current direct API: PDF Compress V2
For a new direct API workflow, use POST https://api.pdf.co/v2/pdf/compress. The older /v1/pdf/optimize endpoint is deprecated.
Choose compressionLevel: low, medium, high, or aggressive. The default is medium. Set colorQuality from 1 to 100; the default is 60. Lower quality can reduce file size at the cost of image detail.
Send this JSON body with your API key in x-api-key and Content-Type: application/json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-compress/sample.pdf",
"compressionLevel": "medium",
"colorQuality": 25,
"name": "compressed.pdf"
}For V2 advanced overrides, use the config object. Legacy options such as profiles.JPEGQuality do not apply to V2. Compression results vary by document; the historical figures below do not predict V2 results. See the current API reference.
Existing Make/Zapier workflows using legacy profiles
The integration guides currently document a Profiles field in Make’s Compress and Optimize PDF module and a Custom Profiles field in Zapier’s Compress & Optimize action. For a workflow using those legacy optimization settings, enter this JSON directly in that dedicated field:
{
"ImageOptimizationFormat": "JPEG",
"JPEGQuality": 25,
"ResampleImages": true,
"ResamplingResolution": 120,
"GrayscaleImages": false
}Use these options only with an operation that supports the legacy profile. They are not V2 config settings. Consult the Make guide or Zapier guide for your integration.
Legacy direct API request format
For an existing request to POST https://api.pdf.co/v1/pdf/optimize, profiles is a JSON-encoded string, as shown below. Prefer V2 for new direct API integrations.
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-optimize/sample.pdf",
"profiles": "{\"ImageOptimizationFormat\":\"JPEG\",\"JPEGQuality\":25,\"ResampleImages\":true,\"ResamplingResolution\":120,\"GrayscaleImages\":false}",
"async": false
}In a Custom API Call action, first check which endpoint it calls. Send the matching request format above. A module may use a fixed API-version base URL; use its documented endpoint-path format and confirm it supports V2 before switching versions.
Historical V1 sample results
These figures were recorded for one 3,169 KB input using the older optimization endpoint. The final column shows the output size as a percentage of the original size, rather than the percentage saved. Actual results depend on the file.
Legacy profile | Output size | Original size remaining |
|---|---|---|
Default (no custom profile) | 1,654 KB | 52.19% |
| 1,352 KB | 42.66% |
| 759 KB | 23.95% |
| 1,552 KB | 48.97% |
| 1,358 KB | 42.85% |
Check the output’s readability as well as its size before choosing settings for your workflow.