Skip to main content

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?

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.


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


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


@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.


Reply