Skip to main content
All CollectionsIntegrationsAPI
API recipes: Create and send a document from a publicly accessible PDF
API recipes: Create and send a document from a publicly accessible PDF
M
Written by Marya Maksimchuk
Updated over a week ago

Availability: Enterprise*

* Additional volume charge will be applied for document generation via production API.

These instructions assume:

Create the original PDF

If you want to include PandaDoc native elements such as signature or text fields in your PDF-derived document, you’ll need to use either the PDF native form fields structure or add manual field tags to the PDF.

An example of form fields is available here.

An example of field tags is available here.

You can read more about the structure and respective benefits of form fields versus field tags in the Create document from PDF documentation. If you choose to use form fields, make sure you set "parse_form_fields": true; otherwise set "parse_form_fields": false.

Once you’ve finalized your PDF, you’re ready for the next step.

Upload the document to your host

You’ll need to post your PDF to a publicly accessible URL. For example, if you’re using an S3 bucket on AWS, you’ll need to set the GetObject to “allow” for *. The PDF must be fully uploaded and accessible before you post it to PandaDoc.

POST the document to PandaDoc

To inform PandaDoc to ingest and parse your PDF, add:

Be sure to include content type application/JSON and a JSON block to identify the document.

mceclip0.png


The response will contain the document ID as the element “id”:

mceclip1.png

Wait for the document to enter draft status

See Listening for changes in document status. If you’re actively polling your document, the ID is “id” from the previous step.

Send the document

Once you’ve determined that the document has entered “document.draft” status, you can send it by adding the following ({id} is the document ID from above):

You can also include these optional parameters in your POST to set a subject line and body text:

mceclip2.png


Don’t set the “silent” parameter to “true” unless you don’t want an email to go out with the document link. For more information about why you might want to send silently, see “Create a document and share it in real time.”

Note:

When sending documents via API, the sender is the person who generated the API key, even if it was created on another member’s behalf.

Did this answer your question?