How to Create a Document from a Public URL
Create a PandaDoc document by providing a publicly accessible PDF URL instead of uploading a local file.
Problem
You have a PDF hosted at a public URL (e.g., on S3, a CDN, or another web server) and you want to create a PandaDoc document from it via the API without uploading a local file.
Prerequisites
- A PandaDoc API key or OAuth token
- A PDF file hosted at a publicly accessible URL
Solution
Step 1: Make the PDF publicly accessible
Host your PDF at a URL that PandaDoc servers can reach. If you're using AWS S3, ensure the bucket policy allows GetObject for public access. The PDF must be fully uploaded and accessible before you send the create request.
Step 2: Prepare interactive fields (optional)
If you want PandaDoc to recognize interactive fields in your PDF, choose one of these approaches:
- Native PDF form fields -- add form fields in Adobe Acrobat or similar, then set
parse_form_fields: true. See How to Use Native PDF Form Fields. - Field tags -- embed bracket-notation tags like
[textfield:s1:optId___]in the PDF text, then setparse_form_fields: false. See How to Add Field Tags to Documents.
Sample files for testing:
Step 3: Send the create request
POST /public/v1/documents
{
"name": "My document",
"url": "https://example.com/path/to/mydocument.pdf",
"recipients": [
{
"email": "[email protected]"
}
],
"parse_form_fields": false
}The response returns the document ID with status document.uploaded:
{
"id": "XHjv8z3SfDuTseFSnhprML",
"name": "My document",
"status": "document.uploaded",
"date_created": "2021-07-05T15:05:27.787341Z",
"date_modified": "2021-07-05T15:05:27.787341Z",
"uuid": "XHjv8z3SfDuTseFSnhprML"
}Step 4: Wait for draft status
Document creation is asynchronous. Wait for the document to reach document.draft before sending or modifying it. See Understanding Asynchronous Document Creation for polling and webhook strategies.
Verification
- Check the document status -- confirm it reaches
document.draft. - Open the document in the PandaDoc web app to verify the PDF rendered correctly and any fields were recognized.
- Use the Document Details endpoint to inspect the document programmatically.
Related
- Create Document API reference -- full endpoint parameters
- How to Create a Document from a File Upload -- alternative method using local file upload
- How to Send a Document via API -- send the document after creation
- Understanding Asynchronous Document Creation -- async patterns and error handling
Updated 8 days ago
