How to delete user data from one or more accounts as an organization admin
This topic demonstrates how an organization administrator can delete a user’s Personal Identifiable Information (PII) data from one or more accounts.
Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
Prerequisites
- User data can only be deleted after the user’s account has been closed for at least 24 hours.
Required data
Running the code in this how-to requires this data:
Step 1: Obtain your OAuth token
To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different OAuth grant types: Authorization Code Grant, Implicit Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario. See Authenticate for guidance on your options to get an OAuth token.
Docusign Admin OAuth access tokens are the same ones used for our eSignature REST API, although you must request one or more Docusign Admin scopes to call the Docusign Admin API. The API calls made in this how-to require that you request the Docusign Admin-specific user_data_redact scope when obtaining your access token. See Docusign Admin Authentication for the full list of Docusign Admin scopes.
Step 2. Construct your API headers
After you have a valid OAuth access token, you are ready to construct the API headers that you will pass to the API call. Construct your headers like this, but make sure to substitute your valid OAuth access token for {ACCESS_TOKEN}.
Step 3. Construct the request body
Next, create the request body. Be sure to substitute the ID of the user whose data will be deleted for {USER_ID}. Use the memberships field to specify a list of API account IDs for the accounts that the user is a member of. The user’s data will be deleted in all of those accounts.
Step 4. Call the Docusign Admin API
Now that you have constructed your API headers and request body, make a POST request to the DataDeletion: redactIndividualUserData endpoint and include the request body to delete the user’s data from the organization. Here’s how you make the call, but make sure to substitute your organization ID for {ORGANIZATION_ID}.
Expected response
If you run the code for this how-to from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.
Next steps
- Run this code example from our Quickstart or launcher projects: Bash.
- See Delete personal data for your users.
- Learn How to create a new active eSignature user.
- See how to Go-Live with a completed app and find the base path for API calls in the production environment.