Erase what the website widget remembers about one signed-in visitor
const url = 'https://app.surveyrock.com/api/v1/contacts/erase-widget-visitor';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"userId":"example","email":"example","websiteId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.surveyrock.com/api/v1/contacts/erase-widget-visitor \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "userId": "example", "email": "example", "websiteId": "example" }'Deletes, on every Website of the workspace (or the one named), the record the website widget keeps for a signed-in visitor: when each widget was shown, closed or answered. Give the user ID your site signs; if your site signs only an email, give that. The visitor’s answers are not touched.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”1 to 128 characters, chosen by the caller. A retry with the same key and body replays the first response instead of applying the write twice; the same key with a different body is a 409
Request Bodyrequired
Section titled “Request Bodyrequired”object
The user ID your site signs
The email your site signs, when it signs no user ID
Only this Website (all of the workspace’s Websites when absent)
Examplegenerated
{ "userId": "example", "email": "example", "websiteId": "example"}Responses
Section titled “ Responses ”Erased: deleted is how many records were deleted (0 when there was nothing to erase)
Neither userId nor email given
No such Website in this workspace