Solved

Use taxonomy Api to delete the event property

  • 30 March 2021
  • 3 replies
  • 290 views

Badge

Hello, 

I am exploring the taxonomy api (https://developers.amplitude.com/docs/taxonomy-api).
The requirement is to programatically delete the event-properties from the event.
Assume that there is some event with name `Watched Videos` which contains numerous event_properties. I need to delete some specific event property from the event. e.g `1962_Artwork` is an event property in the event `Watched Videos`.

I was trying to use the taxonomy api , below attached is the curl command and error.
 
curl -u <api_key>:<secret> -X DELETE https://amplitude.com/api/2/taxonomy/event-property/1962_Artwork\?event_type\=Watched%20Video  | jq '.' | less

response
{
  "errors": [
    {
      "message": "Attempted to remove an event property, \"1962_Artwork\" for event \"Watched Video\", that is not a planned event property."
    }
  ],
  "success": false
}

Also tried using adding this property in the planned properties from the amplitude ui (https://help.amplitude.com/hc/en-us/articles/360047579471-Plan-events-and-properties) but similar response.

Using the reference from documentation https://developers.amplitude.com/docs/taxonomy-api#delete-an-event-property
the response recieved doesn’t matches to the doc. 
Please suggest is there any proper api’s available to delete the event properties from the events?

icon

Best answer by tracy.guo 31 March 2021, 23:55

View original

3 replies

Userlevel 4
Badge +3

Hi @samrat! Thank you for providing so much context and information! 

It looks like you’re trying to use our Taxonomy API which is used to plan and organize your project’s taxonomy. At this time, the “Delete” functions are meant for deleting planned events/properties (aka data that has not yet been sent to Amplitude) and not for deleting events/properties that already exist and have data. 

For your use case, is there already data for what is equivalent to the `1962_Artwork` event property? If so, the Taxonomy API will not be able to delete that event property. If there is already data for the event property, you also will not be able to plan that event property since it is already live.

To delete the property, you will need to do this from within the Amplitude UI in Govern. More information on how to do that can be found here: https://help.amplitude.com/hc/en-us/articles/360047138392#delete-and-undelete-events-and-event-properties

That said, I’d be happy to submit a feature request to our Product team to look into adding more API capabilities for data management such as blocking and deleting events and properties. Would you be able to provide a bit of context around the need to manage your data via API rather than within the UI?

Thank you for your note regarding the response as well! I’ve submitted a request to update the developer docs with an updated error response example. 

Hope this information helps and please let me know if you have any questions!

Badge

@tracy.guo 
Thank you so much for information.

Is there any feature available in which we can define whitelisted event-properties for the event?
If let say stream pushing a payload for the event we want to whitelist an list of event-properties through taxonomy apis. Amplitude keeps/filters only the list of whitelisted event-properties and discards other fields in the payload ?
 

Userlevel 4
Badge +3

Hi @samrat! Based on your description, it sounds like the Govern Add-on would be a good fit for your needs. The Govern Add-on is a paid feature that provides additional data governance features such as initializing and planning your schema and then configuring the schema settings to automatically accept or reject unplanned events and properties. This would work in tandem with the Taxonomy API so that you can plan your whitelisted event properties. 

More information on the Govern Add-on can be found here: https://help.amplitude.com/hc/en-us/articles/115001477311

Let me know if that helps!

Reply