Create and share a document in realtime

This recipe assumes:

Locate your template ID

In the PandaDoc app navigate to the template you would like to use for this particular document. When you are viewing the template the ID is the final part of the URL. For example, in the template ID is “ustHNnVaPCD6MzuoNBbZ8L”

Structure your Document details

Use the create document endpoint description to decide what metadata and details you need to pass to your document. The simplest possible document schema consists of a name, template ID, and at least one recipient. Include your template ID under “template_uuid”

 "name": "My minimal document",
 "template_uuid": "ustHNnVaPCD6MzuoNBbZ8L",
 "recipients": [
     "email":"[email protected]"

Create the Document

Using your authentication token or API key, and the content-type application/json
The response will contain the document ID as the element “id”

  "name":"My minimal document",

Wait for the Document to enter draft status

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

Update the Document to “Sent” status

Even though you don’t plan to send this Document via email, it’s still necessary to move it to “sent” status to lock in changes from the draft and enable a shared session. If you don’t want an email to go out as part of this process you can use the "silent": true option in the sending endpoint.
Where {id} is the document ID from above.

  "silent": true

Generate a shared session

After the Document is updated to “Sent” you can generate a shared session ID
Where {id} is the document ID from above.

  "recipient": "[email protected]",
  "lifetime": 90000

You must choose a recipient, even though this won’t be used in silent mode. Lifetime determines the number of seconds that the document link will live for and is optional. It will default to 3600 seconds.
This endpoint will respond with an ID and expiration timestamp

  "id": "QYCPtavst3DqqBK72ZRtbF",
  "expires_at": "2022-08-29T22:18:44.315Z"

Embed the shared session in your page or app

This process creates a page at{id}
where {id} in this instance is QYCPtavst3DqqBK72ZRtbF from above. This page can be embedded in an iframe in your application, or you can send it to recipients to open directly.

Did this page help you?