You can delete events stored in Zendesk by deleting the profile associated with the events.

Each event is associated with aprofile, which in turn is associated with a Zendesk user.

EventProfile亚博Zendesk用户

As a result, you can delete events by deleting the profile associated with the events. Deleting a profile is the only way to delete events.

For information on storing events, seeTracking events.

This article includes curl and Python examples. The Python examples use Python 3.6 or greater and therequestslibrary.

Deleting events by profile

You can delete events by deleting a profile associated with the events:

DELETE /api/v2/user_profiles/{profile_id}

You can retrieve the profile id value by making a preliminary request for the profile using an identifier query or the Zendesk user id of the person associated with the profile. SeeAccessing profiles.

Example

Data

  • Profile id:

    "01E1G0NJSQPNPZRV096JXKXFAA"

旋度request

             
旋度"https://coolbikes.zendesk.com/api/v2/user_profiles/01E1G0NJSQPNPZRV096JXKXFAA"\-v-u[email protected].com:t1retube5-XDELETE

Python request

             
importrequestsprofile_id='01E1G0NJSQPNPZRV096JXKXFAA'url=f'https://coolbikes.zendesk.com/api/v2/user_profiles/{profile_id}'credentials='[email protected]','t1retube5'response=requests.delete(url,auth=credentials)ifresponse.status_code!=204:print(f'{response.status_code}: {response.text}')else:print(response.json())

Response

             
Status204OK