Skip to main content
JohnSantos
Guru
Guru
Jun 26, 2024 8:34 PM UTC
Solved

Purging documents

I’m testing the API call to add an envelope to be purged.  I have a completed envelope ID from one of our Dev environment.  I’ve been able to successfully change the purgeState from “documents_and_metadata_and_redact_queued” to “documents_dequeued” using the API Explorer from developers.docusign.com  

When I try the same API call from Postman, I’m getting the following error: 

    "errorCode": "DOCUMENT_PURGE_FAILED",

    "message": "Error adding documents to the purge queue. Only the sender may remove the envelope documents"

I can make other successful calls using Postman.  I’m the same user; that sent the envelope.

Any idea what the issue is in Postman?

Docusign Employee
Jun 28, 2024 6:17 AM UTC

Unfortunately, I wasn't able to reproduce the same issue. The purgeState changed without issue from "documents_and_metadata_and_redact_queued" to "documents_dequeued" via Postman. The API call I made to update the purgeState is like below:

PUT https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}

{
 "envelopeId": "{envelopeId}",
 "purgeState": "documents_dequeued"
}

I assume the user you used to obtain the access token is different from the sender of the envelope. Please try creating the envelope via Postman and change the purge state of that envelope.

4 replies

Docusign Employee
Jun 28, 2024 6:17 AM UTC

Unfortunately, I wasn't able to reproduce the same issue. The purgeState changed without issue from "documents_and_metadata_and_redact_queued" to "documents_dequeued" via Postman. The API call I made to update the purgeState is like below:

PUT https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}

{
 "envelopeId": "{envelopeId}",
 "purgeState": "documents_dequeued"
}

I assume the user you used to obtain the access token is different from the sender of the envelope. Please try creating the envelope via Postman and change the purge state of that envelope.

Translate
JohnSantos
Guru
Guru
Jun 28, 2024 3:09 PM UTC

Thank you @Byungjae.Chung.   I figured out what the issue was.  Thank you for looking into it.

Translate
Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.
New Voice
Dec 13, 2024 10:47 AM UTC

​@Byungjae.Chung what can be done in the case where contract is created by a docusign user but needed to be purged using APIs?

Translate
Docusign Employee
Dec 16, 2024 6:29 AM UTC

​@knowrahulj 

If the API caller user can act on behalf of the sender, the user can purge the envelope via the API call. It means the user with the permission profile that is enabled with the “Allow send on behalf of other users through API” option can purge the envelope on behalf of other users via API call. More information about the options of the permission profile is here: https://support.docusign.com/s/document-item?language=en_US&bundleId=pik1583277475390&topicId=mfo1583277360424.html&_LANG=enus

More information about the limitations is introduced in the “Limitations” section here: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/documents/purging/#:~:text=In%20eSignature%20Admin%2C%20select%20Document,want%20to%20purge%2C%20select%20PURGE.

Translate