The PDFGate API provides a set of HTTP endpoints for working with PDF documents, with a focus on digital signatures. You can sign documents and manage document workflows, along with generating PDFs from HTML or URLs and processing existing files.
All requests are authenticated using an API key and return JSON responses using standard HTTP status codes.
PDFGate offers a sandbox environment for testing your integration without affecting production data. The environment is determined by the request URL, and your API key must match the selected environment.
Each request operates on a single document or resource.
All API requests must be authenticated using an API key. Authentication is handled via the Authorization header in your HTTP requests.
To get started, log in to your PDFGate account and create an API key from the Settings page in the dashboard. Ensure the key is active before using it in your code.
Include the API key in your request headers like this:
PDFGate supports two types of API keys:
Use sandbox keys for testing purposes and production keys in your live environment.
The PDFGate API uses different rate limits for each account type in the production environment. In the sandbox environment, the rate limits are the same for all account types.
| Endpoint | Production | Sandbox |
|---|---|---|
POST /v1/generate/pdf POST /forms/flatten POST /forms/extract-data POST /watermark/pdf POST /protect/pdf POST /compress/pdf POST /envelope POST /envelope/:id/send POST /upload | Per account type requests:
| Per account type requests:
|
GET /document/:id DELETE /document/:id GET /file/:id GET /envelope/:id | 40 concurrent requests | 10 concurrent requests |
| Code | Error |
|---|---|
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Not found |
| 422 | Unprocessable entity |
| 429 | Too many requests |
| 500 | Internal server error |
The Generate PDF endpoint converts HTML content into a PDF document. You can provide the content either as a publicly accessible URL or as raw HTML in the request body.
By default, the endpoint returns the generated PDF as a binary file. If you prefer a JSON response, you can include the jsonResponse field in your request.
Endpoint
Examples
Request body fields
"1-5" or "1,3,5". If not specified, all pages are included.Available responses
The Flatten PDF endpoint converts an interactive PDF (with fillable form fields or annotations) into a static, non-editable version.
documentId referencing an existing file already stored in our database.If a documentId is provided, the API will always create a new flattened file in the database, rather than overwriting the existing one.
In this case, the response includes a derivedFrom parameter (when jsonResponse is set to true), it indicates the original document ID from which the flattened file was created.
Endpoint
Examples
Request body fields
.pdfAvailable responses
The Extract PDF Form Data endpoint lets you read data from a fillable PDF. It extracts all form fields in the document along with their current values and returns them as a JSON object.
You can either upload a new PDF file directly or provide the documentId of an existing file stored on the server.
Endpoint
Examples
Request body fields
.pdfAvailable responses
The Watermark PDF endpoint adds a watermark to an existing PDF document. You can apply either a text watermark or an image watermark, depending on your needs.
Endpoint
Examples
Request body fields
.pdf.png .jpeg .jpg.ttf .otffontFile is provided, this parameter will be ignored.Available responses
The Protect PDF endpoint secures a PDF document by applying password protection and permission restrictions.
You can encrypt the PDF using AES-128 or AES-256, set user and owner passwords, and control which actions are allowed, such as printing, copying, or editing.
Endpoint
Examples
Request body fields
.pdfAvailable responses
The Compress PDF endpoint reduces the file size of a PDF without changing its visual appearance. You can also enable linearization so the first page loads faster when the PDF is opened over a network.
Note: In the sandbox environment, the compression result may be limited because our watermark image is automatically added to the document. As a result, the file size will be increased. We recommend testing this endpoint in the production environment.
Endpoint
Examples
Request body fields
.pdfAvailable responses
Retrieves a generated document object containing metadata and file details.
Endpoint
Examples
Request query fields
Response
Deleting a document performs a soft delete to preserve internal records and maintain audit integrity.
Note: Documents used as a source in an envelope with in_progress status cannot be deleted. A document can only be deleted once all associated envelopes are in created, completed, or expired status.
Endpoint
Examples
Response
Retrieves a raw PDF file previously generated.
Note: To access a generated file, you must enable file storage in your PDFGate dashboard under Settings → Storage. Files are retained only for the configured storage duration. By default, file storage is disabled.
Endpoint
Examples
Response
Upload a PDF document. The document can be provided either as a file upload or by specifying a publicly accessible URL where the PDF is hosted.
Endpoint
Examples
Request body fields
.pdf500 mbAvailable responses
The Create Envelope endpoint creates a new envelope from one or more existing source documents.
Each document must reference a previously created document by its sourceDocumentId and include one or more recipients.
You can also attach optional metadata to the envelope for your own tracking and internal reference.
This endpoint creates the envelope in the created status. After calling this endpoint, you should use the POST /envelope/:id/send endpoint to send an email to the recipient with a link to the signing UI, where they can sign the document.
See the Getting Started guide for a complete example.
Endpoint
Examples
Request body fields
Available responses
The Send Envelope endpoint sends an email to each recipient in the envelope with a secure link to access the signing UI and sign the document. The link remains valid for 30 days, after which it expires and can no longer be used. To ensure secure access, recipients must complete OTP (one-time password) verification before accessing the signing experience.
Endpoint
Examples
Request path parameters
Available responses
The Get Envelope endpoint retrieves the current state of an envelope by its ID.
You can use this endpoint to track the envelope status, inspect document-level progress, and view recipient statuses.
Endpoint
Examples
Request path parameters
Available responses