pdfRest API Toolkit Reference Guide
REST API Tools for simple PDF processing with GET and POST HTTP requests


Getting Started
Welcome to the pdfRest API Toolkit Reference Guide! Below you will find all the information you will need to get started using the pdfRest API Tools with your private API Key. If you don't have a key yet, generate one for free at pdfrest.com/getstarted

This guide is organized by API endpoints, which express the output file types that can be generated from input files supplied with requests. For example, to convert a JPG file to a PDF, you would send the JPG file to the /pdf endpoint.

Note that the examples throughout are presented using cURL, but you can easily integrate with these API Tools using any language that supports sending GET and POST HTTP requests, including JavaScript, Python, PHP, and most modern langauges.



API Endpoints
 GET  /resource/{id}

Summary
Retrieve a resource or its URL by ID. Resource IDs can be found in the JSON response of POST requests.

Examples
curl -X GET "https://api.pdfrest.com/resource/0950b9bdf-0465-4d3f-8ea3-d2894f1ae839?format=file" --output "@PATH_TO_FILE/output_file.pdf"
curl -X GET "https://api.pdfrest.com/resource/112f7ea0d-0e56-44bc-a3d2-42fdff96d993?format=url"


Path Parameters
NameDescriptionDefaultRequired
idAlphanumeric ID (UUID) of the resource to return

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneYes
formatResponse format can be the file itself or JSON containing the url of the resource file

Accepts:
  • file
  • url
NoneYes


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "url": "https://api.pdfrest.com/resource/0950b9bdf-0465-4d3f-8ea3-d2894f1ae839?format=file"
}
400Bad Request
{
   "error": "Invalid Request"
}
404Not Found
{
   "error": "That file does not exist"
}



 POST  /pdf

Summary
Convert many types of files to PDF

Accepts all of the following input file types:
  • Microsoft Word (.doc, .docx)
  • Microsoft Excel (.xls, .xlsx)
  • Microsoft PowerPoint (.ppt, .pptx)
  • PostScript and Encapsulated PostScript (.ps, .eps)
  • JPEG (.jpg, .jpeg)
  • TIF (.tif, .tiff)
  • BMP (.bmp)
  • PNG (.png)
  • HTML (.html)
  • HTML (from URL)

Examples
curl -X POST "https://api.pdfrest.com/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.jpg" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/index.html" -F "output=pdf_out" -F "compression=lossless" -F "downsample=600" -F "page_size=A5" -F "page_margin=15mm" -F "page_orientation=landscape"  -F "web_layout=mobile"
curl -X POST "https://api.pdfrest.com/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=pdf_out" -F "tagged_pdf=on"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any file of supported type (100MB max file size)

Example:
@PATH_TO_FILE/example_file.html
NoneOne of:
  • file
  • id
  • url
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
  • url
urlURL of web page to process

Accepts:
Any valid URL

Example:
https://en.wikipedia.org/wiki/Datalogics
NoneOne of:
  • file
  • id
  • url
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
compressionImage compression for PostScript, Microsoft Office, HTML conversion

Accepts:
  • lossy
  • lossless
lossyNo
downsampleDownsample images during PostScript, Microsoft Office, HTML conversion or preserve original resolutions with the 'off' option

Accepts:
  • off
  • 75
  • 150
  • 300
  • 600
  • 1200
300No
tagged_pdfMicrosoft Office file conversion only: Create a tagged PDF document, required for accessibility compliance

Accepts:
  • on
  • off
offNo
page_sizeHTML conversion only: Select a page size for the PDF file. Options correspond to standard paper sizes

Accepts:
  • letter
  • legal
  • ledger
  • A3
  • A4
  • A5
letterNo
page_marginHTML conversion only: Set margins for a PDF file in inches or millimeters

Accepts:
A number followed by either 'in' or 'mm'

Example:
  • 8mm
  • 2.5in
  • 10.25mm
  • 0in
1inNo
page_orientationHTML conversion only: Set the page orientation

Accepts:
  • portrait
  • landscape
portraitNo
web_layoutHTML conversion only: For web pages with responsive design, select the intended web layout

Accepts:
  • desktop
  • tablet
  • mobile
desktopNo


Responses
Response Status CodeDescriptionJSON Response Example
200A successful response
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for downsample."
}
401Unauthorized
{
   "error": "The provided key is not valid."
}



 POST  /pdfa

Summary
Converts PDF to any of the following PDF/A versions:
  • PDF/A-1b - Basic conformance with visual appearance.
  • PDF/A-2b - Basic conformance with archival standards but revised for later versions of the PDF format. PDF/A-2 includes options for OpenType fonts, layers, attachments (which must also be PDF/A compliant) and JPEG 2000 image compression.
  • PDF/A-2u - Matches PDF/A-2b but also requires that all text in the document have Unicode mappings.
  • PDF/A-3b - Matches PDF/A-2b, except that it is possible to embed any kind of file in the PDF document. For example, with PDF/A-3 a user can save a XML, CSV, CAD, spreadsheet, or other type of file in the PDF document and be compliant. The file embedded in the PDF/A-3 does not need to PDF/A compliant.
  • PDF/A-3u - Matches PDF/A-3b, but also requires that all text in the document have Unicode mapping.

Examples
curl -X POST "https://api.pdfrest.com/pdfa" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "output_type=PDF/A-2u"
curl -X POST "https://api.pdfrest.com/pdfa" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=file_out" -F "output_type=PDF/A-2u" -F "rasterize_if_errors_encountered=on"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
output_typeDesired PDF/A version for the output PDF

Accepts:
  • PDF/A-1b
  • PDF/A-2b
  • PDF/A-2u
  • PDF/A-3b
  • PDF/A-3u
NoneYes
rasterize_if_errors_encounteredWhen set to ON, if the API finds errors when converting a PDF document, it will rasterize the page with the problem into a graphic image and continue to save the document as a PDF/A document. If set to OFF it will instead return an error in such cases.

Accepts:
  • on
  • off
offNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "PDF/A-2x is not within the acceptable range for output_type."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /compressed-pdf

Summary
Compresses a PDF to maximally reduce file size while maintaining usable content. Three preset compression levels are offered: low, medium, and high. These produce progressively smaller files with a tradeoff between fidelity and size reduction. Compression options may also be customized via a configurable JSON profile.

Examples
# Example of using a preset compression_level
curl -X POST "https://api.pdfrest.com/compressed-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output" -F "compression_level=high"
# Example of a using a custom json profile with compression_level
curl -X POST "https://api.pdfrest.com/compressed-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output" -F "compression_level=custom" -F "profile=@PATH_TO_FILE/example_profile.json"

Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
compression_levelDegree of compression with a tradeoff between preserving fidelity (low) and maximizing file size reduction (high)
NOTE: When custom is selected, profile parameter is required

Accepts:
  • low
  • medium
  • high
  • custom
NoneYes
profileJSON profile to be uploaded with specifications for configurable compression settings

Create a JSON profile with custom settings

Accepts:
Any valid JSON profile

Example:
@PATH_TO_FILE/example_profile.json
NoneRequired when compression_level is set to custom


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "138aadb71-ee34-4621-9098-9686441e84e2"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}
422Unprocessable Entity
{
   "error": "The 'profile' file provided is not a JSON file, please see documentation for sample profile."
}



 POST  /linearized-pdf

Summary
Linearize a PDF to optimize the document for fast web view. This restructures the document to be loaded one page at a time from web servers.

Examples
curl -X POST "https://api.pdfrest.com/linearized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "https://api.pdfrest.com/linearized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "138aadb71-ee34-4621-9098-9686441e84e2"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /flattened-transparencies-pdf

Summary
Flatten all transparent objects in a PDF to increase RIP speed in a prepress workflow and to enable compatibility for workflows in which transparency is not supported.

Examples
curl -X POST "https://api.pdfrest.com/flattened-transparencies-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "https://api.pdfrest.com/flattened-transparencies-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output" -F "quality=high"

Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
qualitySet the quality to define the resolution level to use when flattening transparent objects in your PDF.
  • low - ideal for proofs that will be printed on black-and-white desktop printers and for documents that will be published on the web
  • medium - best for desktop proofs and documents that will be printed on color printers
  • high - ideal for final press outputs when high quality separations-based color proofs are needed


Accepts:
  • low
  • medium
  • high
mediumNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "138aadb71-ee34-4621-9098-9686441e84e2"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /merged-pdf

Summary
Merges multiple PDF documents or specified pages from PDF documents into a single PDF document. Any number of PDFs may be merged by specifying "file" and/or "id[]" paramaters multiple times. Files will be merged in the order they are specified.

NOTE: For each included "file" or "id[]" a corresponding "pages[]" and "type[]" must also be included to correspond to the type and desired page(s) for that input file.

Examples
curl -X POST "https://api.pdfrest.com/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file1.pdf" -F "pages[]=1-7" -F "type[]=file" -F "file=@PATH_TO_FILE/example_file.pdf2" -F "pages[]=2-last" -F "type[]=file" -F "file=@PATH_TO_FILE/example_file3.pdf" -F "pages[]=2,4,6,8" -F "type[]=file" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "pages[]=1,5-8" -F "type[]=id" -F "id[]=0kd720sdh-3756-s92j-lg0s-0z9m31js68c9" -F "pages[]=last-1" -F "type[]=id" -F "output=file_out"
curl -X POST "https://api.pdfrest.com/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file1.pdf" -F "pages[]=1-7" -F "type[]=file" -F "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "pages[]=1,5-8" -F "type[]=id" -F "id[]=0kd720sdh-3756-s92j-lg0s-0z9m31js68c9" -F "pages[]=last-1" -F "type[]=id" "file=@PATH_TO_FILE/example_file.pdf2" -F "pages[]=2-last" -F "type[]=file" -F "output=file_out"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and merged with other files. This parameter may be included multiple times to specify multiple files to be merged.

Accepts:
Any PDF file (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne or more of:
  • file
  • id[]
id[]Alphanumeric ID (UUID) of existing file on server to be merged with other files. This parameter may be included multiple times to specify multiple files to be merged.

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne or more of:
  • file
  • id[]
pages[]Page or range of pages to include in merged file. This parameter must be specified for each "file" and "id[]" specified.

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number.

Example:
  • 14-last
  • 9-2
  • 1,2,5-10,12-last
  • even
  • odd
NoneYes
type[]This parameter must be specified for each "file" and "id[]" specified and indicates whether a document is a new file to upload or an id for an existing file on the server. This is required to maintain the order of documents to merge.

Accepts:
  • file
  • id
NoneYes
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": ["112f7ea0d-0e56-44bc-a3d2-42fdff96d993", "198f7ad08-9da2-44bc-52b3-a962d2f75114", "187d8cab2-1f53-ae13-b798-2c766db23098", "128db087e-990a-7e27-1c28-028585af8287"]
}
400Bad Request
{
   "error": "Too many 'file' or 'id' values."
}
401Unauthorized
{
   "error": "The provided key is not valid."
}



 POST  /split-pdf

Summary
Splits a single PDF document into one or more PDF documents with specified pages. Any number of PDFs may be split out from the original PDF by including "pages[]" multiple times. Output files will be returned in the order they are included.

NOTE: If "pages[]" is not specified, an output file will be created for each page of the input file containing only that page. A ten page PDF would be split into ten single-page PDFs.



Examples
curl -X POST "https://api.pdfrest.com/split-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf"
curl -X POST "https://api.pdfrest.com/split-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf"  -F "pages[]=3-last" -F "pages[]=2,4,6,9" -F "output=file_out"

Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and split into new files.

Accepts:
Any PDF file (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be split into new files.

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
pages[]Page or range of pages to include in output file. This parameter may be specified multiple times to create multiple output files. If this paramater is not specified, an output file will be created for each page of the input file containing only that page.

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number.

Example:
  • 14-last
  • 2-9
  • 1,2,10-5,12-last
  • even
  • odd
NoneNo
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name. If this parameter is not specified, the original input file name will be used as the output prefix.

Accepts:
Any valid file name

Example:
example_out
Original file name, without extensionNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": ["https://api.pdfrest.com/resource/255b5217c-a7cd-447b-99b3-0cadc9dc3831?format=file", "https://api.pdfrest.com/resource/203090407-cb1e-4c68-b7e1-c5b21211c0cd?format=file", "https://api.pdfrest.com/resource/24dd24471-a8b7-4f7c-b82b-5fc7ed55f74c?format=file"],
"outputId": [ "255b5217c-a7cd-447b-99b3-0cadc9dc3831", "203090407-cb1e-4c68-b7e1-c5b21211c0cd", "24dd24471-a8b7-4f7c-b82b-5fc7ed55f74c"],
"inputId": "1cb17d88c-7096-4d37-8b38-b97b00f587ac"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}
401Unauthorized
{
   "error": "The provided key is not valid."
}



 POST  /bmp

Summary
Convert PDF to BMP image files, one per PDF page

Examples
curl -X POST "https://api.pdfrest.com/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=bmp_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"
curl -X POST "https://api.pdfrest.com/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"  -F "output=bmp_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name.

Accepts:
Any valid file name

Example:
example_out
NoneYes
pagesPage or range of pages to process

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document.

Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last
1-last
(all pages)
No
resolutionOutput image resolution in Dots Per Inch (DPI)

Accepts:
12 to 2400
300No
color_modelColor model of the output file

Accepts:
  • rgb
  • gray
rgbNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for resolution."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /jpg

Summary
Convert PDF to JPEG image files, one per PDF page

Examples
curl -X POST "https://api.pdfrest.com/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=jpg_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray" -F "jpeg_quality=100"
curl -X POST "https://api.pdfrest.com/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "pages=1,3-last" -F "jpeg_quality=25" -F "color_model=cmyk"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name.

Accepts:
Any valid file name

Example:
example_out
NoneYes
pagesPage or range of pages to process

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document.

Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last
1-last
(all pages)
No
resolutionOutput image resolution in Dots Per Inch (DPI)

Accepts:
12 to 2400
300No
color_modelColor model of the output file

Accepts:
  • rgb
  • cmyk
  • gray
rgbNo
jpeg_qualityJPEG compression quality. Higher values produce a higher quality image but also a larger output file size.

Accepts:
1 to 100
75No


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for resolution."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /png

Summary
Convert PDF to PNG image files, one per PDF page

Examples
curl -X POST "https://api.pdfrest.com/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=png_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"
curl -X POST "https://api.pdfrest.com/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "pages=2-last" -F "color_model=rgba"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name.

Accepts:
Any valid file name

Example:
example_out
NoneYes
pagesPage or range of pages to process

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document.

Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last
1-last
(all pages)
No
resolutionOutput image resolution in Dots Per Inch (DPI)

Accepts:
12 to 2400
300No
color_modelColor model of the output file

Accepts:
  • rgb
  • rgba
  • gray
rgbNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for resolution."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /gif

Summary
Convert PDF to GIF image files, one per PDF page

Examples
curl -X POST "https://api.pdfrest.com/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=gif_out" -F "pages=2-9,20" -F "resolution=1200" -F "color_model=rgb"
curl -X POST "https://api.pdfrest.com/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "pages=2-last" -F "color_model=gray"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name.

Accepts:
Any valid file name

Example:
example_out
NoneYes
pagesPage or range of pages to process

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document.

Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last
1-last
(all pages)
No
resolutionOutput image resolution in Dots Per Inch (DPI)

Accepts:
12 to 2400
300No
color_modelColor model of the output file

Accepts:
  • rgb
  • gray
rgbNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for resolution."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /tif

Summary
Convert PDF to TIFF image files, one per PDF page

Examples
curl -X POST "https://api.pdfrest.com/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=tif_out" -F "pages=3,5,7" -F "resolution=2400" -F "color_model=cmyk"
curl -X POST "https://api.pdfrest.com/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "pages=1,9-last" -F "color_model=lab"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputPrefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name.

Accepts:
Any valid file name

Example:
example_out
NoneYes
pagesPage or range of pages to process

Accepts:
Any mix of individual pages and/or ranges seperated by commas. "last" can be used to represent the number of the last page of the document.

Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last
1-last
(all pages)
No
resolutionOutput image resolution in Dots Per Inch (DPI)

Accepts:
12 to 2400
300No
color_modelColor model of the output file

Accepts:
  • rgb
  • rgba
  • cmyk
  • lab
  • gray
rgbNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "0 is not within the acceptable range for resolution."
}
401Unauthorized
{
   "error": "The input file is password protected and cannot be processed."
}



 POST  /restricted-pdf

Summary
Apply one or more document security restrictions to PDF with a permissions password. At minimum, a permissions password prevents the security settings of a document from being modified. Use "restrictions[]" to add additional security restrictions.

Use "current_permissions_password" with "new_permissions_password" to change the permissions password on a document.

NOTE: Setting a new permissions password will normally overwrite existing security data, including the open password. Use "current_open_password" to keep encryption with an already applied open password.

Examples
curl -X POST "https://api.pdfrest.com/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "new_permissions_password=password"
curl -X POST "https://api.pdfrest.com/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=restricted_out" -F "new_permissions_password=password" -F "restrictions[]=print_low" -F "restrictions[]=edit_content"
curl -X POST "https://api.pdfrest.com/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "new_permissions_password=mypermspassword" -F "current_open_password=myopenpassword" -F "restrictions[]=accessibility_off"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
new_permissions_passwordNew permissions password

Accepts:
A string between 6 and 128 characters long
NoneYes
current_permissions_passwordExisting permissions password

Accepts:
A valid password
NoneNo
restrictions[]Document restrictions to be applied. Restricted operations are locked behind the permissions password when interacting with a restricted document.

Accepts:
  • print_low
  • print_high
  • edit_document_assembly
  • edit_fill_and_sign_form_fields
  • edit_annotations
  • edit_content
  • copy_content
  • accessibility_off
NoneNo
current_open_passwordExisting open password

Accepts:
A valid password
NoneNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
             "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
             "error": "The given new password is too short."
}
401Unauthorized
{
             "error": "Cannot process the given input file without the correct permissions password."
}



 POST  /unrestricted-pdf

Summary
Remove all document security restrictions from a PDF.

NOTE: Removing the permissions password will normally remove all existing security data, including the open password. Use "current_open_password" to keep encryption with an already applied open password.

Examples
curl -X POST "https://api.pdfrest.com/unrestricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "current_permissions_password=password"
curl -X POST "https://api.pdfrest.com/unrestricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "current_permissions_password=password"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
current_permissions_passwordExisting permissions password

Accepts:
A valid password
NoneYes
current_open_passwordExisting open password

Accepts:
A valid password
NoneNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
			"outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
			"error": "This route will only accept a File or an ID, not both."
}
401Unauthorized
{
			"error": "Cannot process the given input file without the correct permissions password."
}



 POST  /encrypted-pdf

Summary
Encrypt a PDF using 256-bit AES encryption with a 32-bit key. Encrypted PDFs cannot be viewed without first providing the open password.

Use "current_open_password" with "new_open_password" to change the open password on a document that was already encrypted. Use "current_permissions_password" if the input document has a permissions password.

Examples
curl -X POST "https://api.pdfrest.com/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "new_open_password=password"
curl -X POST "https://api.pdfrest.com/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=encrypted_out" -F "current_open_password=oldpassword" -F "new_open_password=newpassword"
curl -X POST "https://api.pdfrest.com/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out"  -F "new_open_password=openpassword" -F "current_permissions_password=permspassword"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
new_open_passwordNew open password

Accepts:
A string between 6 and 128 characters long
NoneYes
current_open_passwordExisting open password

Accepts:
A valid password
NoneNo
current_permissions_passwordExisting permissions password

Accepts:
A valid password
NoneNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
              "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
              "error": "The given new password is too short."
}
401Unauthorized
{
              "error": "The input file was corrupted, password-protected, or not a PDF."
}



 POST  /decrypted-pdf

Summary
Remove encryption from a PDF. Use "current_permissions_password" if the input document has a permissions password.

Examples
curl -X POST "https://api.pdfrest.com/decrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "current_open_password=password"
curl -X POST "https://api.pdfrest.com/decrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "current_open_password=openpassword" -F "current_permissions_password=permspassword"


Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
PDF file (100MB max file size)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes
current_open_passwordExisting open password

Accepts:
A valid password
NoneYes
current_permissions_passwordExisting permissions password

Accepts:
A valid password
NoneNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
              "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
              "error": "A password is required to process the document."
}
401Unauthorized
{
              "error": "The input file was corrupted, password-protected, or not a PDF."
}



 POST  /zip

Summary
Compress any number of files into a .zip by specifying "file" and/or "id[]" paramaters multiple times.



Examples
curl -X POST "https://api.pdfrest.com/zip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "https://api.pdfrest.com/zip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -F "file=@PATH_TO_FILE/example_file.pdf" -F "file=@PATH_TO_FILE/example_file_2.pdf" "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" "output=example_out"

Required Headers
Accept: application/json
Content-Type: multipart/form-data
Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file.

Accepts:
Any file of supported type (Default 100MB max file size unless changed in the server settings)

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne or more of:
  • file
  • id[]
id[]Alphanumeric ID (UUID) of existing file on server to be zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file.

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne or more of:
  • file
  • id[]
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
NoneYes


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "https://api.pdfrest.com/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": ["112f7ea0d-0e56-44bc-a3d2-42fdff96d993", "198f7ad08-9da2-44bc-52b3-a962d2f75114", "187d8cab2-1f53-ae13-b798-2c766db23098", "128db087e-990a-7e27-1c28-028585af8287"]
}
400Bad Request
{
   "error": "Found more than one output key, only one is allowed."
}
401Unauthorized
{
   "error": "The provided key is not valid."
}



© 2022 Datalogics, Inc. All rights reserved.