Introduction
Delete Customer Profiles individually or in bulk using the Delete Customer API, removing all Customer records and all associated Conversations with the Customer. Deletion are typically performed to fulfill data subject requests. This API allows you to delete Customer records on an automated basis without requiring manual deletion within Gladly.
Common use cases for deleting customers in Gladly include:
A Customer requests to delete personal data.
The Customer data is no longer needed for its original purpose.
An internal need to purge outdated Customer records.
Before you start
To guide your process, see the Delete Customer developer guide.
Important
All Conversations associated with the Customer must be closed before the Customer can be deleted.
This operation is irreversible. Once removed, no Customer data or Conversation history can be retrieved.
You must have created an API token in Gladly. The user associated with the API token must have both Compliance Administrator and API User roles. Follow these instructions to verify your permissions.
Instructions
To identify a Customer Profile for deletion, you must first obtain the Gladly Customer ID. You may find the Customer ID using the Find Customer API.
Starting with a list of email addresses and/or mobile phone numbers of the Customers you would like to delete. You will want to loop through the list and:
Obtain the Gladly Customer ID for each Customer via the Find Customer API.
Using the obtained Gladly Customer ID, make a DELETE request to the Delete Customer API.
Log any error responses (Open Conversation, Customer not found, etc.) for additional internal investigation, as needed.
Obtain the Customer ID
Perform a GET request against the Find Customer API.
If you are searching based on a phone number, use the following URL:
https://organization.gladly.com/api/v1/customer-profiles?phoneNumber=%2B14151234567
If you are searching based on an email address, use the following URL:
https://organization.gladly.com/api/v1/[email protected]
Find Customer API Responses:
A successful request will return something like the following. The “id” value, highlighted below, is the Customer Profile ID that will be deleted:
[ { "customAttributes": { "albums": "6", "singles": "40" }, "emails": [ { "normalized": "[email protected]", "original": "[email protected]" } ], "name": "Firsto Lastly", "phones": [ { "normalized": "+12911677144", "original": "2911677144", "regionCode": "US", "type": "HOME" } ], "id": "T-QSkUthRwK6e--_ObI_OQ", "createdAt": "2024-04-23T11:26:22.321Z" } ]
For requests that return an error, if:
Customer is not found: (an empty response is returned)
[]
*The data provided does not allow for the deletion of a Customer Profile; please verify that the data provided is correct.
No Email or Phone Number Provided: { "errors": [ { "code": "blank", "detail": "one of email, phoneNumber, externalCustomerId must be present" } ] }
*Please provide an email or phone number to retrieve the Customer ID number.
Using the Delete Customer API
For each successfully returned Customer ID, you may now make a DELETE request to the Delete Customer API using the following URL:
https://organization.gladly.com/api/v1/customer-profiles/T-QSkUthRwK6e--_ObI_OQ
If the request is successful, no error response will be received, for requests with errors, if:
There is an open or waiting conversation:
{"errors":[{"attr":"conversation","code":"invalid_state","detail":"Unable to delete the profile. Please close any open or waiting conversations."}]}
No Customer ID Provided: (This should never happen if you are using the ID received above)
Response Status: 204 No Content
Handling Open/Waiting Conversations:
Depending on your circumstances, you may address open Conversations by reviewing and closing the open or waiting Conversations and then manually deleting the Customer. Or, if you wish, you could use the Update Conversation API to close the Conversation automatically, then retry the Delete Customer API.