Deleting events from Keen IO
Sometimes you need to do some tests, and you might end up with unwanted events in your Keen IO collections. Fear not, as it's super easy to delete one or a small group of events!
First, you want to use the extraction endpoint to make sure you're getting just the events you want to delete. Adjust it by changing the timeframe and filters parameters:
# GET
$ curl https://api.keen.io/3.0/projects/:PROJECT_ID/queries/extraction?api_key=READ_KEY&event_collection=EVENT_COLLECTION&timeframe=this_1_days
After you're sure of getting only the events you want to delete, make a DELETE request to the endpoint below, with the same parameters you used in the previous request (with the exception of the MASTERKEY in place of the READKEY):
# DELETE
$ curl https://api.keen.io/3.0/projects/:PROJECT_ID/events/:EVENT_COLLECTION?api_key=MASTER_KEY&timeframe=TIMEFRAME&filters=FILTERS
And that's it. 🎉
Written by Heitor Tashiro Sergent
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Events
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#