TABLE OF CONTENTS
- API Setup
- Business Use Case
- Good to Know
- Authentication
- Endpoint
- Request
- Anonymized Fields
- Response
- Not the API you're looking for?
API Setup
Choose your Host Region to have the documentation adapt to your use case.
Host Region | |
---|---|
Label | Value |
EU | eu |
US | us |
AU | au |
Business Use Case
The POST Anonymize Contact API can be used to redact the personal information of a specified contact. Using this API will cause all survey records belonging to the contact to be anonymized.
Good to Know
Required Parameters
The API requires only one of the following fields to be present:
Parameter | Description |
email or telephone | The Contact's Email or Phone. Only one of these parameters must be present. |
Authentication
OAuth2 Authentication is used to connect to this API. Once you've created your Authentication, you can acquire a Bearer Access Token by calling our OAuth2/Token API:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials&client_id={{ Client ID }}&client_secret={{ Client Secret }}"
https://auth.{{ apiRegion }}.customergauge.com/oauth2/token
The acquired Bearer Access Token is used in the Authorization header in your API request.
Note: The Access Token is only valid for up to 1 hour. Save the Access Token temporarily when calling the API multiple times in a row, or obtain a fresh Access Token before calling the API.
Endpoint
Endpoint URL
https://api.{{ apiRegion }}.customergauge.com/v6/system-admin/data-admin/contacts/anonymize
Resource (Request History)
/v6/system-admin/data-admin/contacts/anonymize
Request
Payload
Use these parameters in the API request to pass the relevant information to the API.
Parameter | Description | Rules | Example Values |
Email that belongs to the contact you wish to anonymize. |
| john.doe@example.com | |
phone | Phone number that belongs to the contact's you wish to anonymize. |
| 336123456789 |
Supported Formats
JSON (raw request body)
Data can be passed to this API using the JSON format in the body of the request.
Example parameters:
{ "email": "john.doe@example.com" }
x-www-form-urlencoded (body)
Data can be passed to this API using the x-www-form-urlencoded format in the body of the request.
Example parameters:
email: "joe.doe@example.com"
Outcome: Anonymized Fields Format
Standard Anonymized Fields
When a contact is anonymized there information that is redacted appears in the following manner in the platform.
Information Type | Technical Field Name (Field Settings) | Data after anonymizing |
a random anonymous email is generated for the contact. | ||
First Name | first_name | Replaced by *** |
Last Name | last_name | Replaced by *** |
Phone | phone | Replaced by *** |
Follow-up Details | - | Replaced by *** |
Job Level | job_level | Replaced by *** |
Job Title | job_title | Value is dettached from contact. Survey record page will display it as a dash ( - ). |
NPS Comment | - | Replaced by "This comment has been anonymized based on customer request" |
NPS Comment Translation | - | Replaced by "This comment has been anonymized based on customer request" |
Close the Loop notes | - | First name, Last name, and Phone are redacted from the notes, replacing it by *** Email is replaced by the new random anonymous email. |
Direct Replies | - | First name, Last name, and Phone are redacted from the reply, replacing it by *** Email is replaced by the new random anonymous email. |
Additional Comment | - | First name, Last name, and Phone are redacted from the comment, replacing it by *** Email is replaced by the new random anonymous email. |
Single Line Text | - | First name, Last name, and Phone are redacted from the text, replacing it by *** Email is replaced by the new random anonymous email. |
Additional Fields to be Anonymized
In addition to the default anonymized fields, users can choose which additional fields should be anonymized. This can be done by System Administrators, directly in Field Settings (System Admin), by marking any field as storing personal data. Once marked, the system will automatically include these fields in the anonymization process, ensuring compliance with privacy requirements.
Effect of Anonymization on Segments and Custom Fields
Segments
When anonymizing segments, there are two possible scenarios:
- If the segment value from the contact being anonymized is also present in another contact, the contact being anonymized will have the segment value dettached from it. Causing it to be displayed as a dash ( - ) in the survey record page.
- If the segment value from the contact being anonymized only exists in this contact, the value will be redacted using the following format: anon+18fdfd660077111aca01.
Custom Fields
When a custom field is marked as storing personal data, the value is replaced by ***.
Response
HTTP Status Code 200
OK - everything worked as expected.
Example Response Body
{ "message": "Anonymization job has been queued successfully.", "data": { "email": "john.doe@customergauge.com", "phone": "" } }
HTTP Status Code 401
The authentication was invalid - this usually means that you're not using a valid Bearer Access Token in the Authorization header.
Not authenticated - Example Response Body
{
"message": "Unauthenticated."
}
HTTP Status Code 422
An issue occurred - this usually means one of the required fields is missing.
Email or Phone required - Example Response Body
This error happens when the request does not contain Email or Phone parameters.
{ "message": "The email or phone field is required. (and 1 more error)", "errors": { "email": [ "The email or phone field is required." ], "phone": [ "The email or phone field is required." ] } }
Email not valid - Example Response Body
This error happens when the email address does not follow the correct format e.g. john.doe@example.com.
{ "message": "The email must be a valid email address.", "errors": { "email": [ "The email must be a valid email address." ] } }
Too many characters - Example Response Body
This error happens when the value for phone has more than 20 characters.
{ "message": "The phone must not be greater than 20 characters.", "errors": { "phone": [ "The phone must not be greater than 20 characters." ] } }
Only one field must be present - Example Response Body
This error happens when both parameters are sent in the request body.
{ "message": "The email field must be missing when phone is present. (and 1 more error)", "errors": { "email": [ "The email field must be missing when phone is present." ], "phone": [ "The phone field must be missing when email is present." ] } }
HTTP Status Code 404
Records not found - Example Response Body
This error happens when a contact with the provided Email or Phone has not been found.
{ "message": "No records found" }
Not the API you're looking for?
Get an overview of our APIs here.