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
"message": "Attempted to remove an event property, \"1962_Artwork\" for event \"Watched Video\", that is not a planned event property."
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?
Best answer by tracy.guo
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!