How to set an option to delete envelope in docusign - docusignapi

am in the process of understanding Docusign and API.
I am trying to achieve with docusign that I should have the document removed after x days and also the envelope.
I see a settings for document purge in the feature tabs.
But i am not seeing an option for deleting the sent envelope itself as i am taking the backup in my database myself.
Any reference to online material or explanation would be greatly appreciated.
Thank you!!!

The "Document Retention" feature in DocuSign will purge documents from the DocuSign servers (for Completed, Declined, and Voided envelopes) N days after the envelope becomes Completed/Declined/Voided, where N is the number you specify in Preferences > Features > Document Retention (link). See page 31 of the Admin guide for details about this setting: https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/account-administration-reference-guide.pdf.
DocuSign retains Envelope-level information for all envelopes indefinitely -- even if you purge an envelope's documents. This is done so that the transaction metadata (i.e., audit trail data like who it was sent to / when, what forms of authentication were used, who signed it / when, etc.) is always available should you need to prove the authenticity of the transaction at a later date. So, you'll still see an Envelope listed in the Sent Items folder even after envelope documents are purged -- so that you can always access Envelope history and Certificate of Completion -- but if you open an Envelope after its documents have been purged, you'll simply see "placeholder" documents in place of what used to be the 'real' documents. (Each placeholder doc contains a one-sentence message to indicate that the original document no longer exists within DocuSign.)
Also, keep in mind that the "Document Retention" feature is an account-wide setting that will apply to all Envelopes sent through the account. If you only want to purge documents for specific envelopes, you can do so via the API ("Purge Documents" operation).

Related

DocuSIgn eSign Rest API to disable sending signed document as attachment for completed workflow for specific envelopes

Is there an eSign Rest API available that can be used to disable sending the completed document as an attachment when the workflow is completed for specific envelopes ? I know that there is a settings in the Admin section that can be used to disable sending completed document when the workflow is completed. But this account level setting will work for all the envelopes being sent out from that account. Is there an envelope level eSign Rest API that can be used to achieve the same thing for specific envelopes ?
As you have noted, the Sending account has a setting to determine if completed documents are attached to the "envelope completed" email sent to the recipients. However, there is nothing in the envelope to override the account setting.
I would recommend using the account setting to prevent the completed documents from being attached to the completion emails (because email attachments are not secure), and instead advice signers to use the prompt at the end of signing to save an account that they can log into to securely download the documents at their leisure. It's also worth noting that if the documents in the envelope are too large, attachment may not take place, making it even more important to use a free signer account to securely access envelope documents.
Are you referring to the completed document being attached and sent to the recipients via email? I'm afraid you can't control this setting. It is individual to the recipient's account and only they can change the behaviour for this

Does the Docusign REST API have contract forwarding?

In certain circumstances we would like to automate the forwarding of completed Docusign contracts to certain new recipients, possibly adding another page. Is there a way to do that with the REST API, or does that have to be done manually?
The short answer is Yes.
In DocuSign-speak, "completed" means that the envelope (transaction) has reached its final stage. No more changes, it's frozen and saved in the DocuSign platform.
Also, note that virtually anything you can do via the DocuSign web app can also be done programmatically via one of DocuSign's APIs.
So you have two options:
Send the first envelope to someone else as a new envelope
After the first envelope is complete, your API program could analyse it to see if it needs some additional recipients. If so, your API program could start a new envelope transaction that includes the completed (signed) document, possibly the first envelope's certificate of completion, along with the new documents to be signed (or not) and new recipients.
You could include the first set of documents (from the first envelope) either as supplemental documents to the new envelope or as regular documents within the new envelope. To obtain the documents from the first envelope, your application would download them from DocuSign and then upload them for the new envelope.
A live "supplemental" documents example.
A envelope is optionally sent to additional recipients
An alternative is to have one envelope and optionally programmatically send it to additional signers with, perhaps, additional documents for the new signers.
This might be a bit trickier to program with the DocuSign eSign APIs but is certainly doable.
After the last "original" signer has completed signing, you can pause the workflow.
Once the workflow is paused, your application can again analyse the document to see if more recipients need to sign, an additional document needs to be added, etc. Then your API program uses the API to update the envelope as needed, including adding additional recipients (who may or may not be signers). This is called "correcting" the envelope. Then your program resumes the envelope's workflow.
Your program should be notified that the envelope has paused by using the Connect webhook feature, either at the account or envelope level.
If you have more questions about this answer, please open new questions on StackOverflow. Make each question as specific as you can. Thank you.

Webhook warnings before purging an envelope

I am working on integrating DocuSign into our product, and I have noticed that demo envelopes are being purged every 30 days as stated in the documentation. We have set up our product to use a webhook to keep up-to-date with DocuSign's envelope data. However, there doesn't appear to be any warning via webhook before the envelope is purged, it is just suddenly inaccessible. Is there any way to allow notification via webhook before an envelope is purged? Is there any way to find out that an envelope was purged other than hitting an endpoint and then receiving an ENVELOPE_DOES_NOT_EXIST error?
Additionally, does the purging of demo envelopes behave in the same way that setting rules for Document Rentention purges envelopes?
It's worth noting that the Demo removal of envelopes isn't the same as Document Retention in Production.
In Production, envelopes targeted for purge will send a warning to signers that have a DocuSign account and they are placed in a two-week queue. After the two weeks, the documents are removed, but there is still a stub record that contains the certificate of completion.
In Demo envelopes are immediately removed without warning once they've hit the 30 day mark, and once they're gone there's zero record that the envelope ever existed.
But to answer the immediate question: No, Connect cannot be used to notify about a document that is pending removal in Demo.
Demo (also known as developer sandbox) is a testing and demonstration environment and cannot be used for real work.
The documents signed in demo are not legally binding. You get to play with all the functionality for free without any limits.
Except that DocuSign has to clean it so that storage size don't get out of hand.
So, there are no warnings or notifications in demo.

DocuSign Multiple Signers envelope

I've created a docusign template that includes multiple documents. The template declares 3 signing roles. I then create an envelope from that template that has 3 recipients. The template, and our account, have document visibility enabled, such that signers can only view the documents that they must sign. After the envelope is completed by all three signatures, I need to store a PDF of each completed envelope under the different recipient's accounts on our site. Because document visibility is enabled, there cannot be a single PDF for all 3 signers. This would break the visibility feature, and they would be able to see each other's private information. Instead, there must be a separate PDF generated for each signer/recipient.
How do I request the completed document/PDF for a specific recipient in a completed envelope?
Document Visibility will control what signers can see in the signing ceremony as well as what they can see/download after the envelope is completed and they review the documents then.
If you are looking to save individual pdf/documents for storage in your system, there is a call to get individual documents rather than a combined document/pdf. Take a look at the REST call for Get Document from Envelope. The URL is /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}.
Rob
After consultation with DocuSign engineers I decided to follow Rob's advice below, which is simple, but more manual. After the multiple signing sessions have taken place and the envelope is completed, you can extract the documents out individually using the following REST API method:
Get Envelope Document
v2/accounts/:accountId/envelopes/:envelopeId/documents/:documentId
I say this is manual, because rather than allowing document visibility to seamlessly return a combined and correct view of what the user saw and signed in PDF, you have to duplicate that intelligence in code, and will most likely end up with multiple documents per recipient. This isn't a perfect solution, and they noted that it was somewhat of a hole in their api/offering. So to recap:
Template A contains 4 documents A,B,C,D and 3 signers, Buyer, Seller, and Manager.
It uses document visibility to ensure that the buyer sees documents {A,B,C,D}, the Seller sees documents {A}, and the manager sees documents {A,B}.
An envelope is created from Template A and sent to the Buyer, Seller, and Manager.
Each sign the envelope and it is completed, but because it was an embedded signing, no emails were sent. Additionally, we would like to download and store their documents on our site under their user accounts.
Next, the code downloads the documents for each user by simulating the simple logic involved with document visibility. More specifically:
Documents {A,B,C,D} are downloaded separately and stored in the Buyer's account. Documents {A} are downloaded separately and stored in the Seller's account. Documents {A,B} are downloaded separately and stored in the Manager's account.
We could even optimize it by realizing that the Buyer sees ALL the documents, and therefore they can be downloaded as a single document by using the following REST API call:
Get Envelope Documents Combined
v2/accounts/:accountId/envelopes/:envelopeId/documents/combined
I hope this will be helpful in the future to somebody.

Reuse/alter a DocuSign envelope, to update its document PDF, once the envelope is In Process

We need to be able to handle a scenario where the document PDF needs to be updated and resent, after the envelope is In Process. Do we always need to create a new envelope or can we reuse the current envelope ID?
Our process goes roughly like this:
A PDF document is generated (not using a DocuSign template).
We create an envelope for the document PDF.
The first signer (our employee) signs the document (using an embedded signing page).
The other signers sign the document (also using an embedded signing page).
Firstly, we want to know if we're forced to incur another "sent" envelope (i.e. we're billed) every time we want to update a document PDF. Secondly, we're looking for a clean way to implement updates, without the need to manage multiple envelopes.
Yes you will unfortunately have to make a new envelope if you want to make changes to the underlying document(s) of the envelope after it has been sent. This is actually a fundamental part of the service and the reason is not to make you incur a new envelope - instead it's actually a security / legal requirement.
Imagine that we are in the old world and I need two people to sign a document on paper. I have the first person sign, then before the second person signs I make a change to the document that says the first person owes me $1,000,000. Then the second person signs, the document completes, and now you have a signature from both people but it contains content that the first person did not actually agree to (and they apparently owe you $1,000,000 now!). That's the main reason why you can't change the underlying document once it's been sent.
Two possible workarounds I can think of:
1. Add data fields or other Stick-eTabs to the envelope for the parts of the document that might change.
2. Use the signer attachments tab to add additional documents.
For #1, let's say you send out a sales contract for $100,000, but after it's been sent a new price is determined. If the $100,000 is in the document content itself then you can not edit it and you'd have to create a new envelope with the new document; however if it's through a Data Field then your recipients can simply edit the value as the document works towards completion.
For #2, there are special Stick-eTabs you can add called Signer Attachment Tabs which allow recipients to attach whole documents and other files to the envelope. You could utilize this to add your changes to the envelope.
Is there a human involved in updating/replacing the document, or are you looking to fully automate the process with the API? As Ergin stated, it's not possible to add/remove documents using the API once an Envelope has been Sent. However, it IS possible for the Sender of the envelope to "Correct" (and re-send) the Envelope using the DocuSign web console -- including adding or removing documents for an Envelope that's already been Sent, but documents can be ONLY be removed/replaced IF none of the recipients have yet acted on the Envelope. i.e., once at least one recipient has acted on the Envelope, it won't be possible for the Sender to remove/replace documents in the Envelope (although they can Add new documents, as long as the Envelope is still in-process).
You can use the API to launch the "Correct Envelope" view as follows:
POST https://demo.docusign.net/restapi/v2/accounts/{acctId}/envelopes/{envelopeId}/views/correct
The response to this operation will return a URL that you can use to launch the "Correct Envelope" view.
Finally, one important caveat about using the "Correct Envelope" feature to enable the Sender to modify documents in an envelope: once the person is logged into the DocuSign web console where they'll correct the envelope, they'll have full access to that user account in the DocuSign web console -- i.e, they'll be able to access all Envelopes in that user account (Sent Items, Inbox, Deleted Items, etc.), send new Envelopes, access user settings via "Preferences", etc. So, be careful using the Correct view if you're concerned at all with providing the person with full access to that user account within the DocuSign web console.
Note: In order for the Sender to be able to add/remove Documents in the "Correct Envelope" view, the "Advanced Correct" feature must be enabled for the DocuSign account (in Preferences >> Features).

Resources